1. 程式人生 > >teamtalk部署

teamtalk部署

參考

teamtalk部署文件

參照以上文件部署出現一些問題

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/