BT宝塔是国内的一个非常易用的一个面板系统,是用Pyhon写的,对于一些小白也能非常容易的管理LINUX服务器。我自己也要玩这个面板,有兴趣的朋友可以去玩一下。
这周自己也找了两台服务器进行对BT宝塔面板的一些内测的功能,自己喜欢一些新鲜的东西,也给BT宝塔做一个测试和完善吧。先说说一下两台服务器的环境情况。
云主机的安全端口全开放。
京东云:有数据
配置:CPU:1G 内存:2G 硬盘:30G 宽带:1M
腾讯云:没有数据
配置:CPU:1G 内存:2G 硬盘:50G 宽带:1M
同步的情况,是从京东云到腾讯云的。
在这个过程中发生了两个问题,向官方提交问题也得到解决,日志都是在发送端有的。
问题一 无法开始同步:
实时同步日志-[1]
/usr/bin/rsync - --password-file=/www/server/panel/plugin/rsync/client/193.112.7.247_1.db --port= @193.xx.xx47::1
@ERROR: auth failed on module 1
rsync error: error starting client-server protocol (code 5) at main.c(1516) [sender=3.0.9]
-------------★[2018-03-24 12:41:45] Successful
-------------No files specified to watch!
官方解决方法:
在发送端服务器上执行:rpm -e bt-pcre && yum reinstall pcre -y
问题二 同步不了数据:
/usr/bin/rsync -alWv --password-file=/www/server/panel/plugin/rsync/client/193.x.xxx.7_mxlog.db --port=873 /www/wwwroot/z.mxlog.com/ mxlog@193.xxx.xxx..247::mxlog
sending incremental file list
./
rsync: failed to set times on "/." (in mxlog): Operation not permitted (1)
........................
rsync: recv_generator: mkdir "/zb_install" (in mxlog) failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
zb_system/
rsync: recv_generator: mkdir "/zb_system" (in mxlog) failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
zb_users/
rsync: recv_generator: mkdir "/zb_users" (in mxlog) failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: mkstemp "/..htaccess.LLSvRV" (in mxlog) failed: Permission denied (13)
rsync: mkstemp "/..user.ini.Txcy20" (in mxlog) failed: Permission denied (13)
rsync: mkstemp "/.feed.php.yRGAd6" (in mxlog) failed: Permission denied (13)
rsync: mkstemp "/.index.php.tl5Cob" (in mxlog) failed: Permission denied (13)
rsync: mkstemp "/.readme.txt.nYCFzg" (in mxlog) failed: Permission denied (13)
rsync: mkstemp "/.search.php.LdnXKl" (in mxlog) failed: Permission denied (13)
sent 21014 bytes received 240 bytes 42508.00 bytes/sec
total size is 4731087 speedup is 222.60
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]
----------------------------------------------------------------------------
★[2018-03-24 19:55:22] Successful
----------------------------------------------------------------------------
解决方法和分析的思路:
开始时,我习惯性的按我以前用命令同步方式去了解BT宝塔的同步机制了,原来他们的机制和我以前使用rsync同步数据是不大一样的。
如把有数据A服务器:/www/wwwroot/zblog (zblog是数据) --->同步到 没有数据的B服务器上 /www/wwwroot/ (不建立zblog空目录)
在终端用命令执行是可以直接在B服务器上新建zblog,后把A服务器zblog的数据再同步过去。
这两次,我在BT面板用的方式是:
A服务器的发送配置中的同步目录选择/www/wwwroot/zblog B服务器接收配置的同步目录选择为:/www/wwwroot/
这样的话,是无法同步数据,也会有错误,正确的是也要在B服务器里新建一个zblog的目录。
如果BT宝塔修改一下rsync的命令参数,这个问题,已经不会存在。