author: headsen  chen

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

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

参考:

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

环境: centos7.3-x86_64  kernel :3.10

1,依赖

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

2,安装gcc

# 安装,下载好包并放在/mnt下面
cd /mnt
tar fx gcc-6.3.0.tar.gz
cd gcc-6.3.0/
./contrib/download_prerequisites
./configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
make -j2
make install
# 配置gcc环境变量
mv /usr/bin/gcc /usr/bin/gcc4.4.7
ln -s /usr/local/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++4.4.7
ln -s /usr/local/bin/g++ /usr/bin/g++
mv /usr/bin/cc /usr/bin/cc4.4.7
ln -s /usr/local/bin/cc /usr/bin/cc
mv /usr/bin/c++ /usr/bin/c++4.4.7
ln -s /usr/local/bin/c++ /usr/bin/c++
gcc --version
echo "/usr/local/lib64" >>/etc/ld.so.conf
ldconfig

3,安装protoc-3.6.1

cd /mnt
unzip protobuf-master.zip
cd protobuf-master/
./autogen.sh
./configure
make
make check
make install
protoc --\version

4,安装jdk

cd /mnt
tar xf jdk-8u181-linux-x64.tar.gz -C /usr/java
cat >> /etc/profile << EOF
export JAVA_HOME=/usr/java/jdk1.8.0_181
export JRE_HOME=\${JAVA_HOME}/jre
export CLASSPATH=.:\${JAVA_HOME}/lib:\${JRE_HOME}/lib
export PATH=\${JAVA_HOME}/bin:\$PATH
EOF source /etc/profile
echo $JAVA_HOME

5,安装mysql-5.6

# 安装mysql
useradd mysql
tar fx mysql-5.6.35.tar.gz
cd 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_ci
make && make install
#配置mysql
yum -y install perl
cd /usr/local/mysql/
rm -rf /usr/local/mysql/data/
mkdir -p /data/mysql-data
ln -s /data/mysql-data/ /usr/local/mysql/data
chown -R mysql. /data/mysql-data/
chown -R mysql. /usr/local/mysql/data/
cp support-files/mysql.server /etc/init.d/mysql
rm -rf /etc/my.cnf
yum install -y perl-Module-Install.noarch
perl 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/mysql
datadir = /usr/local/mysql/data
# port = .....
# server_id = .....
socket = /tmp/mysql.sock
bind-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 = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
~  
ln -s /usr/local/mysql /usr/local/mysql-5.6.35
service mysql start
netstat -plnt |grep 3306
chkconfig mysql on
mkdir -p /var/lib/mysql/
ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock               
# 添加环境变量
echo "PATH=$PATH:/usr/local/mysql/bin" >>/etc/profile
echo "export PATH" >>/etc/profile
source /etc/profile
service 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.conf
ldconfig

6,安装resin

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

7,安装maven

cd /mnt
tar fx apache-maven-3.5.4-bin.tar.gz
mv apache-maven-3.5.4 /usr/local/maven
cp /etc/profile /etc/profile.bak
echo "export MVEN_HOME=/usr/local/maven" >>/etc/profile
echo "export PATH=$MVEN_HOME/bin:$PATH" >>/etc/profile
source /etc/profile
mvn -version

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

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

9,安装bison组件和flex组件

yum -y install bison flex

10,安装Java语言工具包

cd /mnt
tar fx thirdparty.tgz
cd thirdparty/tars-1.5.0/;ls
----->
build docs Install_faq.en.md Install.md Introduction.md LICENSE.TXT php README.en.md tup
cpp Install.en.md Install_faq.md Introduction.en.md java nodejs plugins README.md web cd java
mvn clean install
mvn clean install -f core/client.pom.xml
mvn 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 all
mkdir /usr/local/tars
make 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/sql
sed -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-tar make tarsstat-tar
make tarsnotify-tar
make tarsproperty-tar
make tarslog-tar
make tarsquerystat-tar
make tarsqueryproperty-tar

15、安装核心基础服务

mkdir -p /usr/local/app/tars/
cd /mnt/thirtyparty/tars-1.5.0/cpp/build cp framework.tgz /usr/local/app/tars/
cd /usr/local/app/tars
tar xf framework.tgz sed -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 package
cp ./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
<!--
- Resin 4.0 configuration file.
-->
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="urn:java:com.caucho.resin"> <!-- property-based Resin configuration -->
<resin:properties path="\${__DIR__}/resin.properties" optional="true"/> <resin:if test="\${properties_import_url}">
<resin:properties path="\${properties_import_url}"
optional="true" recover="true"/>
</resin:if> <!-- Logging configuration for the JDK logging API -->
<log-handler name="" level="all" path="stdout:"
timestamp="[%y-%m-%d %H:%M:%S.%s]"
format=" {\${thread}} \${log.message}"/> <!--
- Alternative pseudo-TTCC log format
-
- <log-handler name="" level="all" path="stdout:"
- timestamp="%y-%m-%d %H:%M:%S.%s"
- format=" [\${thread}] \${log.level} \${log.shortName} - \${log.message}"/>
--> <!--
- level='info' for production
- 'fine' or 'finer' for development and troubleshooting
-->
<logger name="" level="\${log_level?:'info'}"/> <logger name="com.caucho.java" level="config"/>
<logger name="com.caucho.loader" level="config"/> <!--
- Default configuration applied to all clusters, including
- HTTP, HTTPS, and /resin-admin configuration.
-->
<resin:import path="\${__DIR__}/cluster-default.xml"/> <!--
- health configuration
-->
<resin:import path="\${__DIR__}/health.xml"/> <!--
- Remote management requires at least one enabled admin user.
-->
<resin:AdminAuthenticator>
<user name="\${admin_user}" password="\${admin_password}"/> <resin:import path="\${__DIR__}/admin-users.xml" optional="true"/>
</resin:AdminAuthenticator> <!--
- For clustered systems, create a password in as cluster_system_key
-->
<cluster-system-key>\${cluster_system_key}</cluster-system-key> <!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
-->
<dependency-check-interval>\${dependency_check_interval?:'2s'}</dependency-check-interval> <!-- For resin.properties dynamic cluster joining -->
<home-cluster>\${home_cluster}</home-cluster>
<home-server>\${home_server}</home-server>
<elastic-server>\${elastic_server}</elastic-server>
<elastic-dns>\${elastic_dns}</elastic-dns> <!--
- Configures the main application cluster. Load-balancing configurations
- will also have a web cluster.
-->
<cluster id="app">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="\${app_servers}" port=""/> <host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="\${webapp_multiversion_routing}"
path-suffix="\${elastic_webapp?resin.id:''}"/>
</host-default> <!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy> <!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" document-directory="webapps/tars"/> </host> <resin:if test="\${resin_doc}">
<host id="\${resin_doc_host}" root-directory="\${resin_doc_host}">
<web-app id="/resin-doc" root-directory="\${resin.root}/doc/resin-doc"/>
</host>
</resin:if>
</cluster> <cluster id="web">
<!-- define the servers in the cluster -->
<server-multi id-prefix="web-" address-list="\${web_servers}" port=""/> <host id="" root-directory="web">
<web-app id="">
<resin:LoadBalance regexp="" cluster="app"/>
</web-app>
</host>
</cluster> <cluster id="memcached" xmlns:memcache="urn:java:com.caucho.memcached">
<!-- define the servers in the cluster -->
<server-multi id-prefix="memcached-" address-list="\${memcached_servers}" port="">
<!-- listen for the memcache protocol -->
<listen port="\${memcached_port?:11211}"
keepalive-timeout="600s" socket-timeout="600s">
<memcache:MemcachedProtocol/>
</listen>
</server-multi>
</cluster> <cluster id="proxycache">
<!-- define the servers in the cluster -->
<server-multi id-prefix="proxycache-" address-list="\${proxycache_servers}" port=""/> <host id="" root-directory="proxycache">
<web-app id="">
<resin:HttpProxy regexp=".*">
<!-- backend HTTP servers to proxy to -->
<addresses>\${backend_servers}</addresses>
</resin:HttpProxy>
</web-app>
</host>
</cluster> </resin>
EOF

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

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

http://172.25.196.66:8080

tars环境部署的更多相关文章

  1. Web应用之LAMP源码环境部署

    一.LAMP环境的介绍 1.LAMP环境的重要性 思索许久,最终还是决定写一篇详细的LAMP的源码编译安装的实验文档,一来是为了给自己一个交代,把技术进行系统的归纳,将技术以极致的形式呈现出来,做为一 ...

  2. Jmeter安装与环境部署

    Jmeter安装与环境部署 版权声明:本文为博主原创文章,未经博主允许不得转载. 博主:海宁 联系:whnsspu@163.com

  3. 微信公众号开发系列教程一(调试环境部署续:vs远程调试)

    http://www.cnblogs.com/zskbll/p/4080328.html 目录 C#微信公众号开发系列教程一(调试环境部署) C#微信公众号开发系列教程一(调试环境部署续:vs远程调试 ...

  4. .Net Core 跨平台系列之环境部署

    前言 作为一名.NET程序员,很多时候都会被什么拖控件.跨平台等字眼所鄙视过,但是在我的的内心还是没有把自己看低过.因为说到底,平台和语言只是我们吃饭的工具.很多时候公司的发展是取决于商业竞争的,微软 ...

  5. DotNet Core 1.0 集成 CentOS 开发与运行环境部署

    一.     DotNet Core 1.0 开发环境部署 操作系统安装 我们使用CentOS 7.2.1511版本. 安装libunwind库 执行:sudo yum install libunwi ...

  6. Nutch2+Hbase环境部署和基本使用

    由于项目想借助Nutch来做网络爬虫,所以一番研究,发现网上文档比较散,学习的很艰难,因此总结了一些,放上来与大家交流. 1       环境部署 Nutch有1.x系列和2.x系列,主要区别是2.x ...

  7. Anyconnect的VPN环境部署(2)-在Linux客户机上连接Anyconnect

    由于之前已经在机房IDC安装了Anyconnect的VPN服务环境(参考:Anyconnect的VPN环境部署(1)-OpenConnect server(ocserv)服务安装)今天介绍下在linu ...

  8. Jenkins实现生产环境部署文件的回滚操作(Windows)

    由于dotnet项目的生产环境环境部署工具比较少,所以我使用jenkins作为生产环境的自动化部署工具. 既然有回滚操作,那么就会有部署操作:要实现回滚,先要实现部署的操作,我在jenkins搭建了一 ...

  9. storm单机环境部署

    前面说过storm集群的部署,这篇主要介绍storm单机环境部署,其实他们之间很类似,就是将之前配置文件中所有的集群条目改成本机的地址即可,部署之前应该按前面solr和zookeeper单机环境部署那 ...

随机推荐

  1. Linux学习笔记(二):实战-根据微服务端口号关闭进程

    前言 现在项目组基本都用Springboot,每个服务占用一个端口号,有时需要选择性的关闭,但在任务管理器上他们的名称都是java.exe,无法区分,这才学以致用. killPort.sh 作用:根据 ...

  2. 解决iredmail下postfix发送邮件时报错[need fully-qualified hostname]

    iredmail配置好后,尝试从一客户端的OE中发送邮件,结果报错,在mail主机中查看tail /var/log/maillog,发现如下错误信息: Oct :: mail2 postfix/smt ...

  3. 【.NET】正则表达式笔记

    很早就听说正则表达式的强大,今天终于一睹它的真容,在这里记下学习时候的笔记,以便以后查看 1.正则表达式 用于描述字符串规则的的特殊的字符(正则表达式本身是字符串,用来描述字符串的相关规则,用于与其他 ...

  4. VCL 中的 Windows API 函数(2): ActivateKeyboardLayout

    ActivateKeyboardLayout 分别在 Controls.DBGrids.Grids 单元用到, 基本都是如下语句: ActivateKeyboardLayout(Screen.Defa ...

  5. JS中 try...catch...finally (转)

    JS的try..catch..finally var array = null; try { document.write(array[0]); } catch(err) { document.wri ...

  6. 9 云计算系列之Cinder的安装与NFS作为cinder后端存储

    preface 在前面我们知道了如何搭建Openstack的keystone,glance,nova,neutron,horizon这几个服务,然而在这几个服务中唯独缺少存储服务,那么下面我们就学习块 ...

  7. 给一个由n-1个整数组成的未排序的序列,其元素都是1~n中的不同的整数。如何在线性时间复杂度内寻找序列中缺失的整数

    思路分析:尼玛这不就是等差数列么.首先将该n-1个整数相加,得到sum,然后用(1+n)n/2减去sum,得到的差即为缺失的整数.因为1~n一共n个数,n个数的和为(1+n)n/2,而未排序数列的和为 ...

  8. 8 -- 深入使用Spring -- 3...1 Resource实现类ClassPathResource

    8.3.1 Resource实现类------ClassPathResource : 访问类加载路径下的资源的实现类 2.访问类加载路径下的资源 ClassPathResource 用来访问类加载路径 ...

  9. 转载nginx+uwsgi+django

    Django的部署可以有很多方式,采用nginx+uwsgi的方式是其中比较常见的一种方式. 在这种方式中,我们的通常做法是,将nginx作为服务器最前端,它将接收WEB的所有请求,统一管理请求.ng ...

  10. 第五篇:Hadoop流

    前言 Hadoop流提供了一个API,允许用户使用任何脚本语言编写Map函数或Reduce函数. 本文对此知识点进行介绍. Hadoop流的工作原理 在以前的例子中,Map和Reduce工作都是由类来 ...