We recommend to use a mysql version later than 5.6.26
.
You can download mysql using wget. Below is an example downloading version 5.7, but you can change it to the desired version.
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
yum -y install mysql-devel
If you have problems to install mysql with the above step, add the new mysql repository to local server with this yum command and then re-run the previous commands.
sudo yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
PS: Be aware that if you install mysql via yum install mysql
on Centos 7, Mariadb will be installed instead. Since that's not what we want, we recommend you to follow the procedure described above.
If your mysql version is later than 5.6, you need to configure strong password rules as follows:
set global validate_password_policy=0;
set global validate_password_length=1;
Make sure that the path of mysql source is the default. Tars uses /usr/local/mysql/
as default path. If yours is not this, please modify the file CMakeLists.txt (framework/tarscpp/CMakeLists.txt
, framework/CMakeLists.txt
) before compiling.
After, you can change the tarscomm properties as follows.
[tarscomm]
mysql.host=127.0.0.1
mysql.port=3306
mysql.root.password=tars12345
cd /data
git clone https://github.com/TarsCloud/Tars.git --recursive
cd /data/Tars/deploy
python ./deploy.py all
You can check, build, deploy and test Tars with the commands below.
python ./deploy.py [option]
[option]
all:
check() //check if the needed tools is installed
build() //compile and build framework
deploy() //initial db and deploy framework and web
test() //test if the servers successfully started
check:
check()
build:
build()
deploy:
deploy()
test:
test()
- In order to successfully build Tars, make sure your machine has at least 2 Gb of RAM (It's ok to have virtual RAM).
- Make sure your machine supports Python 2.7.
- Make sure your network is unobstructed.
- You have to install: gcc,gcc-c++, cmake, yasm, glibc-devel, flex, bison, ncurses-devel, zlib-devel, autoconf.
- The NIC name in some CentOS7 is
ens33
instead ofeth0
. If that is your case, you need to change the following file:Tars/deploy/comm/tarsUtil.py :line 24: getAddress()
. - If you face this error:
Error: npm command not found
, you should deletesource /etc/profile
inTars/ deploy/comm/tarsDeploy.py: line 70: deployWeb()
and retry. - The error
Error: tarsDeploy.py: line 51 :shutil.copy: no such file or directory
might be caused by build error. In this case, please verify item 1.