rsync error:error starting client-server protocol(code 5) at main.c(1503)
2017-10-29 11:55
435 查看
执行rsync同步命令时,报错如下:
![](http://img.blog.csdn.net/20171029105012003?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHVvaHVhbnl1MQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
执行的rsync命令(rsync_forum.sh)为:
day=
/usr/bin/rsync -avP –port=3189 -C –exclude=.svn/ –exclude=xdebug_log/ –exclude=logs/ /www/web/forum/ 192.168.1.111::forum >> /opt/rsynclog/$day.log 2>&1
即,将当前服务器的/www/web/forum/文件同步到远程服务器192.168.1.111上的forum模块。
因此,报错是因为rsync在执行同步时,未找到192.168.1.111配置的forum模块,该模块是在配置文件rsyncd.conf中配置的。
找到配置文件(我服务器是/etc/rsyncd.conf ),添加forum模块配置:
然后,重新启动rsync:
查找已开启的rsync:
webuser@wn01v etc]$ ps -ef|grep rsync
root 4821 1 0 08:36 ? 00:00:00 /usr/bin/rsync –daemon –port=31777
杀死进程:
[webuser@wn01v etc]$ kill -9 4821
-bash: kill: (4821) - Operation not permitted
重新开启进程,报错rsyncd.pid文件已存在,创建失败:
[webuser@wn01v etc]$/usr/bin/rsync –daemon –port=3189
failed to create pid file /var/run/rsyncd.pid: File exists
删除rsyncd.pid文件:
[webuser@wn01v etc]$ rm -f /var/run/rsyncd.pid
重新启动:
[webuser@wn01v etc]$ /usr/bin/rsync –daemon –port=3189
rsync传输方式至少可以通过三种模式来工作:
① 本地shell模式:
rsync -av /etc /tmp (将/etc/的数据备份到/tmp/etc内)
rsync -av /etc/ /tmp (将/etc/的数据备份到/tmp内,并不复制目录本身)
② 远程shell模式:
rsync -av license 192.168.12.251:test 若以root身份执行此命令,会提示输入密码,完成密码验证后,在远程主机的root用户根目录下创建test目录,然后将license目录及该目录下的内容复制过来。
③ rsync 列表模式:
rsync -a 192.168.12.251:test 以root用户身份查看远程主机192.168.12.251的test目录下的内容
④ 服务器模式:
基于C/S模式,启动守护进程。
rsync error:error starting client-server protocol(code 5) at main.c(1503)[sender=3.0.6]
执行的rsync命令(rsync_forum.sh)为:
day=
date -d today +%Y%m%d_%H
/usr/bin/rsync -avP –port=3189 -C –exclude=.svn/ –exclude=xdebug_log/ –exclude=logs/ /www/web/forum/ 192.168.1.111::forum >> /opt/rsynclog/$day.log 2>&1
即,将当前服务器的/www/web/forum/文件同步到远程服务器192.168.1.111上的forum模块。
因此,报错是因为rsync在执行同步时,未找到192.168.1.111配置的forum模块,该模块是在配置文件rsyncd.conf中配置的。
找到配置文件(我服务器是/etc/rsyncd.conf ),添加forum模块配置:
[forum] path = /www/web/forum comment = web ignore errors read only = no list = no transfer logging = no
然后,重新启动rsync:
查找已开启的rsync:
webuser@wn01v etc]$ ps -ef|grep rsync
root 4821 1 0 08:36 ? 00:00:00 /usr/bin/rsync –daemon –port=31777
杀死进程:
[webuser@wn01v etc]$ kill -9 4821
-bash: kill: (4821) - Operation not permitted
重新开启进程,报错rsyncd.pid文件已存在,创建失败:
[webuser@wn01v etc]$/usr/bin/rsync –daemon –port=3189
failed to create pid file /var/run/rsyncd.pid: File exists
删除rsyncd.pid文件:
[webuser@wn01v etc]$ rm -f /var/run/rsyncd.pid
重新启动:
[webuser@wn01v etc]$ /usr/bin/rsync –daemon –port=3189
rsync进行同步镜像备份:
rsync是linux/UNIX 系统下的文件同步和数据传输工具,不但传输速度快,而且在传输时,可以比对本地端与远程主机欲复制的文件内容,而仅复制两端有差异的文件而已,所以传输时间相对降低很多。rsync传输方式至少可以通过三种模式来工作:
① 本地shell模式:
rsync -av /etc /tmp (将/etc/的数据备份到/tmp/etc内)
rsync -av /etc/ /tmp (将/etc/的数据备份到/tmp内,并不复制目录本身)
② 远程shell模式:
rsync -av license 192.168.12.251:test 若以root身份执行此命令,会提示输入密码,完成密码验证后,在远程主机的root用户根目录下创建test目录,然后将license目录及该目录下的内容复制过来。
③ rsync 列表模式:
rsync -a 192.168.12.251:test 以root用户身份查看远程主机192.168.12.251的test目录下的内容
④ 服务器模式:
基于C/S模式,启动守护进程。
相关文章推荐
- rsync error: error starting client-server protocol (code 5) at main.c(1530) [receiver=3.0.6]
- rsync @ERROR: chdir failed rsync error: error starting client-server protocol (code 1503)
- rsync error: error starting client-server protocol (code 5) at main.c(1296) [receiver=2.6.8]
- @ERROR: auth failed on module daiv rsync error: error starting client-server protocol (code 5) at ma
- @ERROR: Unknown module 'cookie.com' rsync error: error starting client-server protocol (code 5) at m
- rsync error(1503)分析:@ERROR: auth failed on module xxxx rsync error: error starting client-server
- 双台服务器rsync同步报错(code 5) at main.c(1503) [sender=3.0.6]
- rsync error: error in rsync protocol data stream (code 12) at io.c(463) [receiver=2.6.8] 解决
- 解决方法:rsync error: some files could not be transferred (code 23) at main.c(702)
- 如何解决 Unexpected remote arg || syntax or usage error (code 1) at main.c(1232)
- Ambari界面Presto重启报错ERROR:presto_client:Error connecting to presto server at: localhost:8285
- emerge --sync时出现rsync error:received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(503)
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error:
- Error: Could not find or load main class org.apache.hadoop.hdfs.server.namenode.NameNode
- Lost connection to MySQL server at 'reading initial communication packet et system error:0
- log4j:ERROR Could not connect to remote log4j server at [localhost]. We will try again later.
- SQL Error: setEnabled failed for server Protocol 'tcp'
- 【iOS】Error: Error Domain=PBErrorDomain Code=7 "Cannot connect to pasteboard server
- Microsoft.ApplicationServer.Caching.DataCacheException 之 ErrorCode<ERRCA0017>:SubStatus<ES0006>
- Io exception: Connection refused(DESCRIPTION=(ERR=1153)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(ADDRESS=(PROTOCOL=TCP)(POR