playbook-一键批量部署—sersync实时同步思路图
2019-06-01 19:07:43 0 举报
playbook-剧本一键批量部署—sersync实时同步思路图 linux批量管理服务
作者其他创作
大纲/内容
将sersync软件包移动到/app目录下
1
7
3
backup服务端
本地修改rsync.conf配置文件添加nfsbackup模块,推送到服务端backup
创建nfsbackup目录,修改属主属组为rsync
5
2
推送sersync压缩包后 并解压
1 ##sersync实时同步服务 2 --- 3 #服务端配置: 4 5 - hosts: backup 6 tasks: 7 8 - name: gourpadd rsync 9 group:10 name: rsync11 state: present12 13 - name: useradd rsync14 user:15 name: rsync16 shell: /sbin/nologin17 create_home: no18 19 - name: copy rsyncd.conf20 copy:21 src: /etc/ansible/file/rsyncd.conf22 dest: /etc/rsyncd.conf23 24 - name: mkdir nfsbackup25 file:26 path: /nfsbackup27 state: directory28 owner: rsync29 group: rsync30 - name: mkdir password chmod 60031 file:32 path: /etc/rsync.password33 state: touch34 mode: 60035 36 - name: content password37 copy:38 dest: /etc/rsync.password39 content: rsync_backup:12345640 41 #客户端配置:42 43 - hosts: nfs44 tasks:45 46 - name: rsyncd restart && enable47 service:48 name: rsyncd49 state: restarted50 enabled: yes51 52 - name: mkdir server/scripts && tools && /app53 file:54 path: '{{ item }}'55 state: directory56 with_items:57 - /server/scripts58 - /server/tools59 - /app60 61 - name: copy sercync.zip62 copy:63 src: /server/tools/sersync_installdir_64bit.zip64 dest: /server/tools/65 66 - name: unzip67 unarchive:68 src: /server/tools/sersync_installdir_64bit.zip69 copy: no70 dest: /server/tools/71 72 - name: mv sersync /app/73 shell: mv /server/tools/sersync_installdir_64bit/sersync /app/74 75 - name: chmod +x76 file:77 path: /app/sersync/bin/sersync78 mode: 75579 80 - name: link sersync81 file:82 src: /app/sersync/bin/sersync83 dest: /sbin/84 state: hard85 86 - name: copy confxml.xml87 copy:88 src: /etc/ansible/file/confxml.xml89 dest: /app/sersync/conf/90 backup: yes91 92 - name: touch password chmod 60093 file:94 path: /etc/rsync.password95 state: touch96 mode: 60097 98 - name: content password99 copy:100 dest: /etc/rsync.password101 content: 123456102 103 - name: mkdir /upload104 file:105 path: /upload106 state: directory107 owner: nfsnobody108 group: nfsnobody109 110 - name: shell sersync111 shell: sersync -rd -o /app/sersync/conf/confxml.xml112 113 - name: /etc/rc.d/rc.local114 shell: echo \"sersync -rd -o /app/sersync/conf/confxml.xml\" >>/etc/rc.d/rc.local
创建密码文件并修改权限为600 添加密码123456
4
hosts:
开启rsync服务
为/app/sercync/bin/sersync添加执行权限并创软链接
把实时同步命令放到 /etc/rc.d/rc.local 开机自启动里
8
9
本地修改confxml.xml配置文件,推送到/app/sersync/conf/下,并备份源文件
playbook-剧本一键批量部署—sersync实时同步思路图
10
客户端执行实时同步客户端执行此命令 完成实时同步服务命令 完成实时同步服务
创建权限为600的密码文件,并添加密码rsync_backup:123456
6
nfs01客户端
0 条评论
下一页
为你推荐
查看更多