tars 部署
TarsFramework
git clone git://github.com/TarsCloud/TarsFramework.git
TarsCpp: TarsFramework/tarscpp
git clone git://github.com/TarsCloud/TarsCpp.git
Tars-Unittest : TarsFramework/tarscpp/unittest
git clone git://github.com/TarsCloud/Tars-Unittest.git
TarsProtocol : TarsFramework/tarscpp/servant/protocol
git clone git://github.com/TarsCloud/TarsProtocol.git
TarsWeb
git clone https://github.com/TarsCloud/TarsWeb.git
如果 pm2 list 中查看模块启动不了, 可以进入改目录定位问题:
>> cd /usr/local/app/web; npm run start
//TLS通信支持(只支持 C++)
cmake .. -DTARS_SSL=ON
PropertyServer: 服务起不来 ---- 解决办法 删除:/usr/local/app/tars/tarsnode/data/DCache.PropertyServer/data/clone/xxxx.txt
[fail] get remote config 'PropertyServer.conf' error:remote config file is empty:PropertyServer.conf
1. mysql
url: 192.168.101.3
port: 3306
pw: 123456
一键部署
sudo ./linux-install.sh localhost 123456 en0 false false root 3306
参考:https://tarscloud.github.io/TarsDocs/installation/source.html
linux-install.sh
修改:淘宝镜像。
./linux-install.sh localhost 123456 ens33 true false root 3306
./linux-install.sh localhost 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH' eth0 false false tarsnode 3306
MYSQLIP: localhost
HOSTIP: 192.168.59.128
2021-11-04 13:54:08 ===>print config info >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021-11-04 13:54:08 PARAMS: localhost l@FaCHIOif5L4*OR$CZB^YsJfE5Wy4u8V!kJzj9R8HkXRFUb3QAlB2sOR39rL&H 172.17.0.4 true false root 3306 /usr/local/app false
2021-11-04 13:54:08 OS: Linux=1
2021-11-04 13:54:08 MYSQLIP: localhost
2021-11-04 13:54:08 USER: root
2021-11-04 13:54:08 PASS: l@FaCHIOif5L4*OR$CZB^YsJfE5Wy4u8V!kJzj9R8HkXRFUb3QAlB2sOR39rL&H
2021-11-04 13:54:08 PORT: 3306
2021-11-04 13:54:08 HOSTIP: 172.17.0.4
2021-11-04 13:54:08 WORKDIR: /usr/local/tars/cpp/deploy
2021-11-04 13:54:08 SLAVE: false
2021-11-04 13:54:08 REBUILD: true
2021-11-04 13:54:08 TARS_USER: tarsAdmin
2021-11-04 13:54:08 TARS_PASS: Tars@2019
2021-11-04 13:54:08 INSTALL_PATH: /usr/local/app
2021-11-04 13:54:08 TARS_PATH: /usr/local/app/tars
2021-11-04 13:54:08 UPLOAD_PATH: /usr/local/app/patchs
2021-11-04 13:54:08 WEB_PATH: /usr/local/app/web
2021-11-04 13:54:08 ===<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< print config info finish
关于 'npm audit fix --force' 后报错
https://www.jianshu.com/p/f19ba506f664
npm ERR! network If you are behind a proxy
http://thxopen.com/2020/07/08/npm-error-network-if-you-are-behind-a-proxy.html
git clone 出现fatal: unable to access ‘https://github 类错误解决方法
git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxxxxxxxx
将命令行里的http改为git重新执行。
----- 修改主模块中 ..gitmodules 中的 https ---->>> git
https://github.com/Tencent/DCache
Dcache 服务部署
0. 解决linux中执行mysql命令时出现 bash: mysql: 找不到命令
解决centos6.5出现-bash: mysql: command not found的方法
原因:因为系统默认会查找/usr/bin下的命令,由于mysql没有在这个目录下,所以出现not found。因此需要做一个软连接到/usr/bin目录下 。
执行命令: ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
其中/usr/local/mysql 为:mysql的安装路径
1. git clone git://github.com/Tencent/DCache.git
2. cd build //Users/lzymac/STP/DCache/build
//------ make 之前为避免出错修改: CMakeLists.txt
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv]+0x16):对‘pthread_key_create’未定义的引用
在 /XX/DCache/CMakeLists.txt 中天加:
cmake_minimum_required(VERSION 3.20.2)
set(CMAKE_CXX_FLAGS "-pthread -ldl")
#add_subdirectory(test) ---->> make -j2中报错,不参与编译。
3. cmake .. -DTARS_MYSQL=ON -DTARS_SSL=ON -DTARS_HTTP2=OFF
4. make -j2; make release; make tar
c++: 编译器内部错误:已杀死(程序 cc1plus) make -j4 ===> make -j2
5. 建库的方式安装
sudo ../deploy/install.sh localhost 3306 root 123 localhost 3306 root 123 true http://1.117.139.236:3000 a08032323e4b40ec28228ac98d04afd5b3400e5b 172.17.0.4
sudo ../deploy/install.sh localhost 3306 tarsnode 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH' localhost 3306 tarsnode 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH' true http://1.117.139.236:3000 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhZG1pbiIsImlhdCI6MTY3ODc1ODUyOCwiZXhwIjoxNzM1Njk2MTI4fQ._pZ5VE0HeUXIuKGK57u8AwVeFOxd_mZaSm3fo-MOnok' 172.17.0.4
---->>>>> 安装DCache 需要开启 tars
----->>>> 如果提示 “未登录” 尝试更换 token
----->>>> node_ip 需要使用内网ip.
###==== 不建库的方式安装
sudo ../deploy/install.sh localhost 3306 tarsnode 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH' localhost 3306 tarsnode 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH' false http://1.117.139.236:3000 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhZG1pbiIsImlhdCI6MTY3ODc1ODUyOCwiZXhwIjoxNzM1Njk2MTI4fQ._pZ5VE0HeUXIuKGK57u8AwVeFOxd_mZaSm3fo-MOnok' 172.17.0.4
//lzyvm
mkdir build; cd build; cmake ..; make -j4; make release; make tar
sudo ../deploy/install.sh localhost 3306 root 123456 localhost 3306 root 123456 true http://192.168.59.128:3000 77495cbb7149c8436c352ac1ace1bef3deede526 192.168.59.128
sudo ../deploy/install.sh localhost 3306 root 123456 localhost 3306 root 123456 false http://192.168.59.128:3000 77495cbb7149c8436c352ac1ace1bef3deede526 192.168.59.128
#web后台:JDHRD/HRDGame ---> 编辑 -->私有模板
<tars>
<application>
<server>
<JDHRD.HRDGame.GameServeObjAdapter>
opentls=1
verifyclient=1
ca=/etc/ssl/cer/0oto0.com/ca.pem
cert=/etc/ssl/cer/0oto0.com/0oto0.com.pem
key=/etc/ssl/cer/0oto0.com/0oto0.com.key
</JDHRD.HRDGame.GameServeObjAdapter>
</server>
<dcache>
endpoint=tcp -h 172.17.0.4 -p 12915 -t 60000
</dcache>
<cdn>
baseUrl=http://0oto0.com/MiniTest250
</cdn>
<custom>
logFlag=0
recoverTopPanic=1
</custom>
</application>
</tars>
#web后台:JDHRD/HRDWeb ---> 编辑 -->私有模板
<tars>
<application>
<server>
<JDHRD.HRDWeb.UsersObjAdapter>
opentls=1
verifyclient=1
ca=/etc/ssl/cer/0oto0.com/ca.pem
cert=/etc/ssl/cer/0oto0.com/0oto0.com.pem
key=/etc/ssl/cer/0oto0.com/0oto0.com.key
</JDHRD.HRDWeb.UsersObjAdapter>
</server>
<dcache>
endpoint=tcp -h 172.17.0.4 -p 12915 -t 60000
</dcache>
<cdn>
baseUrl=http://0oto0.com/MiniTest250
</cdn>
<custom>
logFlag=0
recoverTopPanic=1
</custom>
</application>
</tars>
gcc编译时对'xxxx'未定义的引用问题
MYSQL错误解决:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
https://developer.aliyun.com/article/44934
Tars Framework 源码解读 ---- 连载
DCache搭建测试
https://www.codercto.com/a/78819.html
Linux 安装 Golang 环境
https://www.jianshu.com/p/49588471af18
Linux下安装Golang
https://zhuanlan.zhihu.com/p/285785806
Linux下安装Go环境
https://studygolang.com/articles/13957
安装 goTars 环境
https://github.com/TarsCloud/TarsDocs/blob/master/env/tarsgo.md
CICD实战——服务自动构建与部署 Tars + Jenkins
https://cloud.tencent.com/developer/article/1707718?from=information.detail.tars%E5%AE%89%E8%A3%85
TarsBenchmark | 服务性能压测利器
https://cloud.tencent.com/developer/article/1791856?from=information.detail.tars%E5%AE%89%E8%A3%85
CICD实战——服务自动测试
https://cloud.tencent.com/developer/article/1709231
腾讯微服务框架 Tars 的 Go 性能提升之路
https://blog.csdn.net/RA681t58CJxsgCkJ31/article/details/102675344
TARS的服务自定义命令|实现高效服务管理
https://cloud.tencent.com/developer/article/1766124