博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
tars环境部署
阅读量:6844 次
发布时间:2019-06-26

本文共 8251 字,大约阅读时间需要 27 分钟。

author: headsen  chen

date: 2018-10-18 12:35:40

注意:依据Git上的tars搭建步骤整理而来

参考: 

https://max.book118.com/html/2017/0527/109698528.shtmhttps://github.com/TarsCloud/Tars/blob/master/Install.zh.md

环境: centos7.3-x86_64  kernel :3.10    

1,依赖

yum install mpfr -yyum install gmp -yyum install *mpc* -yyum install glibc-static libstdc++-static -yyum -y install gcc gcc-c++yum -y install autoconf automake libtool curl make g++ unzip zlib zlib-develyum install glibc-devel -yyum install cmake -yyum install perl -yyum install -y gityum install ncurses-devel -y

2,安装gcc

# 安装,下载好包并放在/mnt下面cd /mnttar  fx gcc-6.3.0.tar.gzcd gcc-6.3.0/./contrib/download_prerequisites./configure -enable-checking=release -enable-languages=c,c++ -disable-multilibmake -j2make install# 配置gcc环境变量mv /usr/bin/gcc /usr/bin/gcc4.4.7ln -s /usr/local/bin/gcc /usr/bin/gccmv /usr/bin/g++ /usr/bin/g++4.4.7ln -s /usr/local/bin/g++ /usr/bin/g++mv /usr/bin/cc /usr/bin/cc4.4.7ln -s /usr/local/bin/cc /usr/bin/ccmv /usr/bin/c++ /usr/bin/c++4.4.7ln -s /usr/local/bin/c++ /usr/bin/c++gcc --versionecho "/usr/local/lib64" >>/etc/ld.so.confldconfig

3,安装protoc-3.6.1

cd /mntunzip protobuf-master.zipcd protobuf-master/./autogen.sh./configuremakemake checkmake installprotoc --\version

4,安装jdk

cd /mnttar xf jdk-8u181-linux-x64.tar.gz -C /usr/javacat >> /etc/profile << EOFexport JAVA_HOME=/usr/java/jdk1.8.0_181export JRE_HOME=\${JAVA_HOME}/jreexport CLASSPATH=.:\${JAVA_HOME}/lib:\${JRE_HOME}/libexport PATH=\${JAVA_HOME}/bin:\$PATHEOFsource /etc/profileecho $JAVA_HOME

5,安装mysql-5.6

# 安装mysqluseradd mysqltar fx mysql-5.6.35.tar.gzcd  mysql-5.6.35/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_cimake && make install
#配置mysqlyum -y install perlcd /usr/local/mysql/rm  -rf /usr/local/mysql/data/mkdir -p /data/mysql-dataln -s /data/mysql-data/ /usr/local/mysql/datachown -R mysql. /data/mysql-data/chown -R mysql. /usr/local/mysql/data/cp support-files/mysql.server /etc/init.d/mysqlrm -rf /etc/my.cnfyum install -y perl-Module-Install.noarchperl scripts/mysql_install_db --user=mysql

[root@bogon mysql]# vim /usr/local/mysql/my.cnf

# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html[mysqld]# Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.log_bin# These are commonly set, remove the # and set as required.basedir = /usr/local/mysqldatadir = /usr/local/mysql/data# port = .....# server_id = .....socket = /tmp/mysql.sockbind-address=172.25.196.66# Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.join_buffer_size = 128Msort_buffer_size = 2Mread_rnd_buffer_size = 2M  sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES~                                             
ln -s /usr/local/mysql /usr/local/mysql-5.6.35service mysql startnetstat -plnt |grep 3306chkconfig mysql onmkdir -p /var/lib/mysql/ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock               
# 添加环境变量echo "PATH=$PATH:/usr/local/mysql/bin" >>/etc/profileecho "export PATH" >>/etc/profilesource /etc/profileservice mysql restart./bin/mysqladmin -u root password 'root@appinside'./bin/mysqladmin -u root -h 172.25.196.66 password 'root@appinside'echo "/usr/local/mysql/lib/" >>/etc/ld.so.confldconfig

6,安装resin

cd /usr/local/wget http://www.caucho.com/download/resin-4.0.49.tar.gztar xf resin-4.0.49.tar.gzln -s resin-4.0.49 resin

7,安装maven

cd /mnttar fx apache-maven-3.5.4-bin.tar.gzmv apache-maven-3.5.4 /usr/local/mavencp /etc/profile /etc/profile.bakecho "export MVEN_HOME=/usr/local/maven" >>/etc/profileecho "export PATH=$MVEN_HOME/bin:$PATH" >>/etc/profilesource /etc/profilemvn -version

8,安装web管理系统开发环境nvm

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bashsource ~/.bashrcnvm install v8.11.3npm install -g pm2 --registry=https://registry.npm.taobao.org

9,安装bison组件和flex组件

yum -y install bison flex

10,安装Java语言工具包

cd /mnttar fx thirdparty.tgzcd  thirdparty/tars-1.5.0/;ls----->build  docs           Install_faq.en.md  Install.md          Introduction.md  LICENSE.TXT  php      README.en.md  tupcpp    Install.en.md  Install_faq.md     Introduction.en.md  java             nodejs       plugins  README.md     webcd javamvn clean installmvn clean install -f core/client.pom.xmlmvn clean install -f core/server.pom.xml

12、安装c++环境

yum -y install dos2unix flex bison cd /mnt/thirdparty/tars-1.5.0/cpp/thirdparty git clone https://github.com/Tencent/rapidjson.git cd /mnt/thirdparty/tars-1.5.0/cpp/build/./build.sh allmkdir /usr/local/tarsmake install

13、tars数据库环境初始化

mysql -uroot -proot@appinside -e "grant all on *.* to 'tars'@'%' identified by 'tars2015' with grant option;"mysql -uroot -proot@appinside -e "grant all on *.* to 'tars'@'localhost' identified by 'tars2015' with grant option;"mysql -uroot -proot@appinside -e "grant all on *.* to 'tars'@'${MachineName}' identified by 'tars2015' with grant option;"mysql -uroot -proot@appinside -e "flush privileges;"
cd /mnt/thirtparty/tars-1.5.0/cpp/framework/sqlsed -i "s/192.168.2.131/172.25.196.66/g" `grep 192.168.2.131 -rl ./*`sed -i "s/db.tars.com/172.25.196.66/g" `grep db.tars.com -rl ./*`chmod u+x exec-sql.sh./exec-sql.sh

14、打包框架基础服务

cd /mnt/thirdparty/tars-1.5.0/cpp/build/make framework-tarmake tarsstat-tarmake tarsnotify-tarmake tarsproperty-tarmake tarslog-tarmake tarsquerystat-tarmake tarsqueryproperty-tar

15、安装核心基础服务

mkdir -p /usr/local/app/tars/cd /mnt/thirtyparty/tars-1.5.0/cpp/buildcp framework.tgz /usr/local/app/tars/cd /usr/local/app/tarstar xf framework.tgzsed -i "s/192.168.2.131/172.25.196.66/g" `grep 192.168.2.131 -rl ./*`sed -i "s/db.tars.com/172.25.196.66/g" `grep db.tars.com -rl ./*`sed -i "s/registry.tars.com/172.25.196.66/g" `grep registry.tars.com -rl ./*`sed -i "s/web.tars.com/172.25.196.66/g" `grep web.tars.com -rl ./*`chmod u+x tars_install.sh./tars_install.sh./tarspatch/util/init.sh

16、安装web管理系统

cd /mnt/thirtparty/tars-1.5.0/web/sed -i "s/db.tars.com/172.25.196.66/g" `grep db.tars.com -rl ./src/main/resources/*`sed -i "s/registry1.tars.com/172.25.196.66/g" `grep registry1.tars.com -rl ./src/main/resources/*`sed -i "s/registry2.tars.com/172.25.196.66/g" `grep registry2.tars.com -rl ./src/main/resources/*`mvn clean packagecp ./target/tars.war /usr/local/resin/webapps/#./web/target/tars/WEB-INF/classes/log4j.properties  这里可以修改日志目录mkdir -p /data/log/tars/mv /usr/local/resin/conf/resin.xml /usr/local/resin/conf/resin.xml.backup
cat > /usr/local/resin/conf/resin.xml << EOF
\${cluster_system_key}
\${dependency_check_interval?:'2s'}
\${home_cluster}
\${home_server}
\${elastic_server}
\${elastic_dns}
\${backend_servers}
EOF

17、现在可以访问8080端口的web管理系统了

/usr/local/resin/bin/resin.sh start

http://172.25.196.66:8080

 

转载于:https://www.cnblogs.com/kaishirenshi/p/9809864.html

你可能感兴趣的文章
W3wp.exe占用CPU及内存资源
查看>>
Rabbitmq~对Vhost的配置
查看>>
CentOS下Web服务器环境搭建LNMP一键安装包
查看>>
Redis发布订阅实现原理
查看>>
Java魔法堂:JVM的运行模式 (转)
查看>>
thinkPHP四种URL访问方式(二)
查看>>
使用InstallShield打包VS程序
查看>>
我的Android进阶之旅------&gt;Android关于HttpsURLConnection一个忽略Https证书是否正确的Https请求工具类...
查看>>
shell正则表达式匹配样例
查看>>
Sublime Text 的安装和配置
查看>>
数据库设计三大范式
查看>>
为了加速应用物联网,IT高管必须做的6件事
查看>>
查看MYSQL中数据表占用的空间
查看>>
栗蔚:中国云计算“风景独好”
查看>>
使用sqlparse分析SQL语句,及自己写的SQL分析语句
查看>>
搭建国际交流平台 黑龙江海外人才工作站涉及3D打印
查看>>
嵌入式工控机在舞台灯光控制中的应用
查看>>
简单部署边缘计算的五种方式
查看>>
私有云2.0时代来临,OpenStack已上车
查看>>
Every Programmer Should Know These Latency Numbers
查看>>