参考
参照以上文档部署出现一些问题
0:进入 TeamTalk/auto_setup/gcc_setup 目录, 执行 ./gcc_setup.sh,再切换到 TeamTalk/server/src ,执行 make_hiredis.sh,make_log4cxx.sh,make_mariadb.sh,make_protobuf.sh
1:make_hiredis.sh脚本中会用到unzip,提示 unzip 未安装,yum install -y unzip zip 安装即可
2:make_mariadb.sh脚本中
build_mariadb_devel(){
CENTOS_VERSION=$(less /etc/redhat-release)
#echo "$OS_VERSION, $OS_BIT bit..."
if [[ $CENTOS_VERSION =~ "7.0" ]]; then
yum -y install mariadb-devel
// 注意此次系统版本信息 不匹配的修改下就执行yum -y install mariadb-devel
若没有执行这个命令,那么认为系统是CENTOS6版本,并下载相应的版本软件
3:
./create.sh: line 7: protoc: command not found
./create.sh: line 11: protoc: command not found
./create.sh: line 15: protoc: command not found
解决:vim /etc/profile 添加到
export PATH=$PATH:/root/TeamTalk/server/src/protobuf/bin ,source /etc/profile
进入到目录 TeamTalk/pb 编译pb文件 执行 ./create.sh ./sync.sh,再切换到 TeamTalk/server/src 执行 ./build.sh
4:
cp: cannot stat ‘login_server/login_server’: No such file or directory
cp: cannot stat ‘route_server/route_server’: No such file or directory
cp: cannot stat ‘msg_server/msg_server’: No such file or directory
cp: cannot stat ‘http_msg_server/http_msg_server’: No such file or directory
cp: cannot stat ‘file_server/file_server’: No such file or directory
cp: cannot stat ‘push_server/push_server’: No such file or directory
cp: cannot stat ‘db_proxy_server/db_proxy_server’: No such file or directory
cp: cannot stat ‘msfs/msfs’: No such file or directory
cp: cannot stat ‘tools/daeml’: No such file or directory
找不到该执行文件,login_server执行文件在TeamTalk/server/src/bin目录下,所以在build.sh要修改拷贝路径,如:cp login_server/login_server
5:
/TeamTalk/auto_setup/setup.sh,根据脚本错误提示修改脚本或找到缺失文件
6:
mysql:1130 is not allowed to connect to this MariaDB server(没有远程登录权限,注:这里的MariaDB 是MySQL的延伸版)
解决:use mysql; update user set Host='%' where Host='localhost'; flush privileges;
redis设置开机启动:https://blog.csdn.net/a8240357/article/details/80367258
7:
./build.sh version 1.0出现找不到mysql.h的错误,原因:
yum -y install mariadb-server 不安装 yum -y install mariadb-devel 出现找不到mysql.h的错误,解决:
yum -y install mariadb-server yum -y install mariadb-devel
但又出现:/usr/bin/ld: cannot find -lmysqlclient_r,原因是/usr/lib64/mysql找不到libmysqlclient_r.so
解决办法:(参考)
首先你需要找到这个库的位置
一般找的话需要将lib 给加上(注意:我这里是 -lmysqlclient_r 的报错,于是我找就找 libmysqlclient_r )
find / -name libmysqlclient_r*
/usr/lib64/mysql/libmysqlclient_r.so
/usr/lib64/mysql/libmysqlclient_r.so.16
/usr/lib64/mysql/libmysqlclient_r.so.16.0.0
既然找到了 那应该是路径的问题 以及库文件名字的问题,于是做了如下的软连接
ln -sv /usr/lib64/libmysqlclient_r.so.16.0.0 /usr/lib64/mysql/libmysqlclient_r.so(db_proxy_server/CMakeLists.txt设置的路径:/usr/lib64/mysql)
名字也改了一下,然后再编译就没问题了
一般都是这样的套路
--------------------------------------------------------------------------------
/root/TeamTalk/server/src/msfs/FileManager.cpp:230:45: error: call of overloaded ‘abs(long long unsigned int)’ is ambiguous
int times = abs(MAX_FILE_IN_MAP - currSize);
解决办法:abs 改为 fabs 并添加 #include <cmath>
8:安装cmake时出现:
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
make: *** No targets specified and no makefile found. Stop.
解决:vim /etc/profile 添加:export PATH=$PATH:/usr/local/bin/
centos7 install mysql
https://blog.mrabit.com/details/29
如何在linux服务器挂载第二块磁盘图文解说
https://jingyan.baidu.com/article/fedf07377b0b3c35ac8977ca.html