目录

1. 检查linux/mac的依赖环境

2. 下载TarsFrame源码

3 编译源码

4 你可能遇到的情况

4.1 无法从git上成功克隆

4.2 centos7上的cmake版本较低(若无跳过)

4.3 cmake中没有创建gcc和g++的链接

4.4  protocol文件夹下面没有内容

4.5 gcc/g++版本过低导致编译g++的时候无法成功编译,升级版本

4.6 可以提前安装npm和pm2

5. 下载TarsWeb源码

6.启动服务并登陆验证

7.启停脚本


1. 检查linux/mac的依赖环境

centos7 devtoolset 升级gcc版本到7或9的大版本

在你编译源码之前,你必须保证你的机器上有以下工具:gcc, glibc-devel, bison, flex, cmake, which, psmisc, ncurses-devel和zlib-devel.
这些是框架正常运行必备的依赖库,你可以按照下面的提示对它们进行安装:这里给出 CentOS, Ubuntu和 macOS的例子.
CentOS运行:
yum install glibc-devel gcc bison flex cmake which psmisc ncurses-devel zlib-develUbuntu运行:
sudo apt-get install build-essential bison flex cmake psmisc libncurses5-dev zlib1g-dev对于macOS:
先安装brew,然后执行brew install bison flex cmake nvm node,有一些包没有被列入是因为MAC默认已经将它们安装上了(比如说gcc).要注意的是linux的发行版本上一些工具的包名字可能不太一样,比如说zlib-devel vs zlib1g-dev,但大部分是一样的.

2. 下载TarsFrame源码

我在下载源码的时候tarscpp目录总是下载失败,用了转接码云的方法:
如果能直接从git上下载,那么用这个命令:
cd ${source_folder}
git clone https://github.com/TarsCloud/TarsFramework.git --recursive
cd TarsFramework
git submodule update --remote --recursive我自己的环境上git失败了一部分,所以我用码云转接了,而且我转接的时候tarscpp还丢失了,
于是我采用了:
git clone https://github.com/TarsCloud/TarsFramework.git --recursive----巨慢
然后将https://github.com/TarsCloud/TarsFramework.git转到码云上,
git clone https://gitee.com/muten/TarsFramework.git
https://github.com/TarsCloud/TarsCpp.git---也是巨慢,然后将其转到码云上,
git clone https://gitee.com/muten/TarsCpp.gitcd /home/muten/module/TARS/TarsFramework/tarscpp/servant/protocol
git clone https://gitee.com/muten/TarsProtocol.git
cd TarsProtocol/tup/
mv * /home/muten/module/TARS/TarsFramework/tarscpp/servant/protocol/

3 编译源码

1. cd /home/muten/module/TARS/TarsFramework/build
2. cmake ..
3. make -j4(如果重新全量编译,先make clean一下)
4.cd /usr/localsudo mkdir tarssudo mkdir app
5.cd /home/muten/module/TARS/TarsFramework/build
6.make install

What is cmake? --Thank 原作者.

4 你可能遇到的情况

4.1 无法从git上成功克隆

git clone的时候失败的加速方法, 感谢羊哥哈:加速你的git clone,防止失败

4.2 centos7上的cmake版本较低(若无跳过)

下面是centos7下升级cmake版本的步骤:
获取高版本cmake安装包:
wget https://cmake.org/files/v3.17/cmake-3.17.0.tar.gz解压:
tar -zxvf cmake-3.17.0.tar.gz
cd cmake-3.17.0编译:
./bootstrap
gmake
sudo make install

4.3 cmake中没有创建gcc和g++的链接

[root@node1 mysql-5.7.31]# cd /home/muten/module/TARS/TarsFramework/build
[root@node1 build]# cmake ..
CMake Error at CMakeLists.txt:3 (project):The CMAKE_C_COMPILER:/opt/rh/devtoolset-9/root/usr/bin/ccis not a full path to an existing compiler tool.Tell CMake where to find the compiler by setting either the environmentvariable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path tothe compiler, or to the compiler name if it is in the PATH.CMake Error at CMakeLists.txt:3 (project):The CMAKE_CXX_COMPILER:/opt/rh/devtoolset-9/root/usr/bin/c++is not a full path to an existing compiler tool.Tell CMake where to find the compiler by setting either the environmentvariable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full pathto the compiler, or to the compiler name if it is in the PATH.-- Configuring incomplete, errors occurred!
See also "/home/muten/module/TARS/TarsFramework/build/CMakeFiles/CMakeOutput.log".
[root@node1 build]# ls -lrt /opt/rh/devtoolset-9/root/usr/bin/cc
ls: 无法访问/opt/rh/devtoolset-9/root/usr/bin/cc: 没有那个文件或目录
[root@node1 build]# ln -s /usr/bin/gcc /opt/rh/devtoolset-9/root/usr/bin/cc
ln: 无法创建符号链接"/opt/rh/devtoolset-9/root/usr/bin/cc": 没有那个文件或目录
[root@node1 build]# mkdir -p /opt/rh/devtoolset-9/root/usr/bin/
[root@node1 build]# ln -s /usr/bin/gcc /opt/rh/devtoolset-9/root/usr/bin/cc
[root@node1 build]# ln -s /usr/bin/g++ /opt/rh/devtoolset-9/root/usr/bin/c++

4.4  protocol文件夹下面没有内容

做了修改,单独下载protocol文件夹:
cd /home/muten/module/TARS/TarsFramework/tarscpp/servant/protocol
git clone https://gitee.com/muten/TarsProtocol.git
cd TarsProtocol/tup/
mv * /home/muten/module/TARS/TarsFramework/tarscpp/servant/protocol/

4.5 gcc/g++版本过低导致编译g++的时候无法成功编译,升级版本

(1)安装 centos-release-scl
yum install centos-release-scl(2)安装 devtoolset
//安装gcc 9 的版本
yum -y install devtoolset-9-gcc*
//安装gcc 7 的版本
yum -y install devtoolset-7-gcc*(3)激活
//激活gcc 9
scl enable devtoolset-9 bash
//激活gcc 7
scl enable devtoolset-7 bash(4)永久激活scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本,如果要长期使用的话执行:
echo "source /opt/rh/devtoolset-7/enable" >>/etc/profile 。
gcc版本9 执行:echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

4.6 可以提前安装npm和pm2

Centos下安装npm和pm2

4.7 我的环境中make install生成框架程序的路径和脚本中的不一致


利用一下语句手工将文件拷入对应目录:
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsAdminRegistry/bin/tarsAdminRegistry /usr/local/app/tars/tarsAdminRegistry/bin/tarsAdminRegistry
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsconfig/bin/tarsconfig /usr/local/app/tars/tarsconfig/bin/tarsconfig
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsregistry/bin/tarsregistry /usr/local/app/tars/tarsregistry/bin/tarsregistry
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsnode/bin/tarsnode  /usr/local/app/tars/tarsnode/bin/tarsnode
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsnotify/bin/tarsnotify /usr/local/app/tars/tarsnotify/bin/tarsnotify
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsproperty/bin/tarsproperty  /usr/local/app/tars/tarsproperty/bin/tarsproperty
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsqueryproperty/bin/tarsqueryproperty  /usr/local/app/tars/tarsqueryproperty/bin/tarsqueryproperty
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsquerystat/bin/tarsquerystat /usr/local/app/tars/tarsquerystat/bin/tarsquerystat
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarsstat/bin/tarsstat  /usr/local/app/tars/tarsstat/bin/tarsstat
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarslog/bin/tarslog /usr/local/app/tars/tarslog/bin/tarslog
cp -p /usr/local/tars/cpp/deploy/framework/servers/tarspatch/bin/tarspatch  /usr/local/app/tars/tarspatch/bin/tarspatch

5. 下载TarsWeb源码

git clone https://github.com/TarsCloud/TarsWeb.git---慢我的方法:
git clone https://gitee.com/muten/TarsWeb.git
cp -rp /home/muten/module/TARS/TarsWeb /usr/local/tars/cpp/deploy/web
cp -rp /home/muten/module/TARS/TarsWeb /home/muten/module/TARS/TarsFramework/deploy/web

6.启动服务并登陆验证

cd /home/muten/module/TARS/TarsFramework/deploy
./linux-install.sh 【数据库IP地址】 【password】 【网卡名】 false false 【root--填写数据库用户名字】 【数据库端口号-mysql默认是3306】如:
./linux-install.sh 192.168.118.138 123456 ens160 false false root 3306
./linux-install.sh 192.168.118.180 123456 ens33 false false root 3306登录界面的时候试试用amdin/123456
我的IP改了,需要重新install.
现在我的muten-1的mysql的root密码是123456,不要再忘了.--20210124

7.启停脚本

cd /home/muten/module/TARS/TarsFramework/deploy
./linux-install.sh 192.168.118.138 123456 ens160 false false root 3306总控启动:/usr/local/app/tars/tars-start.sh
总控停止:/usr/local/app/tars/tars-stop.sh
11个服务的检查脚本:/usr/local/app/tars/Muten-check.sh单个脚本启停:
- /usr/local/app/tars/xxxx/util/start.sh
- /usr/local/app/tars/xxxx/util/stop.sh
*xxxx: fill in the directory where you locate your servers.Note:
In the core servers of the framework, TarsNode must be alive as it will monitor other servers. If a server
crashes, it will be automatically rebooted.
Pm2 monitors TarsWeb.
After the machine that has deployed the framework restarts, it can
execute /usr/local/app/tars/tars-start.sh to restart all servers.
TarsNode monitoring can be performed regularly
in crontab: /usr/local/app/tars/tarsnode/util/check.sh
The application node with TarsNode deployed needs to monitor only the TarsNode.

8.查看编译选项

cd /home/muten/module/TARS/TarsFramework/build
cmake .. -LH

【TARS】源码方式部署TARS相关推荐

  1. 抖音seo源码 短视频seo源码二次开发,怎么使用抖音seo源码,视频seo源码私有化部署?

    抖音seo源码 短视频seo源码二次开发,怎么使用抖音seo源码,短视频seo源码私有化部署? 抖音seo源码 短视频seo源码二次开发,怎么使用抖音seo源码,短视频seo源码私有化部署到本地.首先 ...

  2. [YOLOv7]基于YOLO&Deepsort的交通车流量统计系统(源码&部署教程)

    1.图片识别 2.视频识别 3.Deepsort目标追踪 (1)获取原始视频帧 (2)利用目标检测器对视频帧中的目标进行检测 (3)将检测到的目标的框中的特征提取出来,该特征包括表观特征(方便特征对比 ...

  3. YOLO&Deepsort的车速&车流量检测系统(源码&部署教程)

    1.研究内容: 基于车辆行驶异常事件检测研究主要包括检测检测车辆的行驶速度异常.检测到流量异常行为的处理两个部分. 2.研究目标: 检测车辆违规变道:熟练运用图像处理的相关工具,可对车辆的异常变道行为 ...

  4. [YOLOv7]基于YOLO&Deepsort的车速&车流量检测系统(源码&部署教程)

    1.研究内容: 基于车辆行驶异常事件检测研究主要包括检测检测车辆的行驶速度异常.检测到流量异常行为的处理两个部分. 2.研究目标: 检测车辆违规变道:熟练运用图像处理的相关工具,可对车辆的异常变道行为 ...

  5. Python基于OpenCV的智能交通灯系统(南北车流量比例)[源码&部署教程]

    1.研究背景: 在传统城市道路交通信号灯的应用过程中,存在专业技术人员较缺乏.项目投入资金少.信号灯故障抢修较困难等问题,为城市居民生活与出行带来极大不便.对此,文章进行深入研究,分析了城市道路智慧交 ...

  6. 筷子SaaS,爱获客,牛视,树品,短视频营销源码独立部署,一站式服务

    抖音短视频营销是通过A I大数据人工智能技术,研发出以企业号运营.矩阵助推.A I智能助手.A I智能运营.能量充电站五大功能为核心的企业短视频融媒体行业解决方案,从根本上为企业在短视频领取解决曝光, ...

  7. [YOLOv7]基于YOLOv7的食物卡路里检测系统(源码&部署教程&数据集)

    1.识别效果展示 2.视频演示 [YOLOv7]基于YOLOv7的食物卡路里检测系统(源码&部署教程&数据集)_哔哩哔哩_bilibili 3.YOLOv7算法简介 YOLOv7 在 ...

  8. YOLOv7的食物卡路里检测系统(源码&部署教程&数据集)

    1.识别效果展示 2.视频演示 [YOLOv7]基于YOLOv7的食物卡路里检测系统(源码&部署教程&数据集)_哔哩哔哩_bilibili 3.YOLOv7算法简介 YOLOv7 在 ...

  9. 【YOLOv7】Python基于YOLOv7的人员跌倒检测系统(源码&部署教程&数据集)

    1.项目背景: 世界老龄化趋势日益严重,现代化的生活习惯又使得大多数老人独居,统计数据表明,跌倒是老年人的主要致伤原因.利用先进的计算机技术.传感器技术和图像信息处理技术实现人体跌倒自动检测,不仅可以 ...

最新文章

  1. 2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest
  2. 大工18秋c c 语言程序设计,大工19秋《可编程控制器》在线作业3【满分答案】
  3. 算法 深度优先,广度优先
  4. 家用使用计算机组装,不能再简单了!家用电脑DIY组装实操
  5. zxing 如何识别反转二维码
  6. Android Studio 导入OpenCV 并调试运行face-detection例子
  7. 如何从我的eclipse项目中删除javascript验证?
  8. 内置对象session与httpSession对象是同一个东西么?
  9. oracle11g远程命令执行漏洞,漏洞应急|Oracle Weblogic Server远程代码执行漏洞(CVE-2021-2109)...
  10. 最快的Java序列化框架Protostuff简介
  11. java通讯录管理系统答辩_java版通讯录管理系统
  12. WAV声音档转PCM
  13. 颜色模型与颜色应用---标准基色和色度图
  14. python电话簿_python 联系簿
  15. 工商阿里忙互殴 苏宁高调打假争做主角?
  16. Citrix实现桌面虚拟化
  17. Win系统 - 系统双击文件总弹出属性窗口如何解决?
  18. AI人脸识别的实现SDK
  19. 研究人员利用黑猩猩改进动物模拟技术 效果显著!
  20. python库——未完待续,紫薯布丁

热门文章

  1. 数据库中存储图片等文件的小探讨
  2. [MICCAI2019] Conv2Warp: An unsupervised deformable image registration with continuous convolution an
  3. fink sql 读取 kafka 的数据写到 kafka
  4. POI-5.2.2 操作Word【段落】
  5. Skia深入分析10——Skia库的性能与优化潜力
  6. Thin Plate Spline薄板样条
  7. 75亿“迎娶”ZeniMax,钟情游戏的微软在坚持什么?
  8. rimraf删除node_modules
  9. 《银行法律法规》一、经济金融基础知识——1、经济基础知识
  10. [面试 ] js 前序中序 后序