playbook搭建rsync全网备份服务、nfs服务、sersync实时同步服务_ansible playbook rsync

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上运维知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip1024b (备注运维)
img

正文

※二、批量部署nfs服务(服务端 客户端)

1.书写分发秘钥脚本保证SSH远程连接服务
5.本地创建剧本执行nfs网络文件系统服务

1.本地创建分发秘钥脚本并执行

如果已经批量分发过秘钥,此步不需要执行

[03:00 root@m01 /etc/ansible]# vim /server/scripts/fenfa\_pub.sh 
#!/bin/bash
#make key pair
ssh-keygen -t dsa -f ~/.ssh/id_dsa -P ''
#fenfa public key
for ip in 7 8 41 31
do
 sshpass -p123456   ssh-copy-id -o StrictHostKeyChecking=no 172.16.1.$ip
done
#ansible
ansible all -m shell -a "hostname"

playbook-剧本一键批量部署—NFS存储服务流程图.jpg

2.本地创建剧本文件nfs.yml进行全网配置
[03:02 root@m01 /etc/ansible]# vim nfs.yml 
  1 #nfs服务端配置-安装软件-配置/etc/exports权限-创建共享目录-重启服务
  2 ---
  3 #安装软件
  4   - hosts: nfs web
  5     tasks:
  6 
  7     - name: yum rpcbind nfs-utils
  8       yum:
  9         name: rpcbind
 10         name: nfs-utils
 11         state: present
 12 
 13 #nfs服务端
 14 
 15   - hosts: nfs
 16     tasks:
 17 
 18     - name: configure nfs
 19       shell: echo '/nfs 172.16.1.0/24(rw,all\_squash)' >>/etc/exports
 20 
 21     - name: mkdir chown /nfs
 22       file:
 23         path: /nfs
 24         owner: nfsnobody
 25         group: nfsnobody
 26         state: directory
 27 
 28     - name: start && enable rpcbind
 29       service:
 30         name: rpcbind
 31         state: restarted
 32         enabled: yes
 33 
 34     - name: reloaded nfs
 35       service:
 36         name: nfs.service
 37         state: reloaded
 38         enabled: yes
 39 
 40 
 41 #web客户端配置-创建挂载目录-安装nfs-挂载nfs共享目录到/upload 
 42   - hosts: web
 43     tasks:
 44 
 45     - name: mkdir /upload
 46       file:
 47         path: /upload
 48         state: directory
 49 
 50     - name: mount
 51       mount:
 52         fstype: nfs
 53         src: 172.16.1.31:/nfs
 54         path: /upload
 55         state: mounted

3.7.先检查剧本后再完成推送
ansible-playbook -C nfs.yml 检查剧本


※三、批量部署sersync

ansible-playbook -C sersync.yml 检查剧本
剧本可能会有很多瑕疵,欢迎补充。

playbook-剧本一键批量部署—sersync实时同步思路图 .jpg

[03:05 root@m01 /etc/ansible]# vim sersync.yml 
  1 ##sersync实时同步服务
  2 ---
  3 #服务端配置:
  4 
  5   - hosts: backup
  6     tasks:
  7 
  8     - name: gourpadd rsync
  9       group:
 10         name: rsync
 11         state: present
 12 
 13     - name: useradd rsync
 14       user:
 15         name: rsync
 16         shell: /sbin/nologin
 17         create_home: no
 18 
 19     - name: copy rsyncd.conf
 20       copy:
 21         src: /etc/ansible/file/rsyncd.conf
 22         dest: /etc/rsyncd.conf
 23 
 24     - name: mkdir nfsbackup
 25       file:
 26         path: /nfsbackup
 27         state: directory
 28         owner: rsync
 29         group: rsync
 30 
 31     - name: mkdir password chmod 600
 32       file:
 33         path: /etc/rsync.password
 34         state: touch
 35         mode: 600
 36 
 37     - name: content password
 38       copy:
 39         dest: /etc/rsync.password
 40         content: rsync_backup:123456
 41 
 42 #客户端配置:
 43 
 44   - hosts: nfs
 45     tasks:
 46 
 47     - name: rsyncd restart && enable
 48       service:
 49         name: rsyncd
 50         state: restarted
 51         enabled: yes
 52 
 53     - name: mkdir server/scripts && tools &&
 54       file:
 55         path: '{{ item }}'
 56         state: directory
 57       with_items:
 58         - /server/scripts
 59         - /server/tools
 60 
 61     - name: copy sercync.zip
 62       copy:
 63         src: /server/tools/sersync_installdir_64bit.zip
 64         dest: /server/tools/
 65 
 66     - name: unzip
 67       unarchive:
 68         src: /server/tools/sersync_installdir_64bit.zip
 69         copy: no
 70         dest: /server/tools/
 71     - name: mkdir app
 72       file:
 73         path: /app
 74         state: directory
 75 
 76     - name: cp  sersync /app/
 77       shell: cp -a /server/tools/sersync_installdir_64bit/sersync /app/
 78 
 79     - name: chmod +x
 80       file:
 81         path: /app/sersync/bin/sersync
 82         mode: 755
 83 
 84     - name: link sersync
 85       file:
 86         src: /app/sersync/bin/sersync
 87         path: /sbin/sersync
 88         state: link
 89         force: yes
 90 
 91     - name: copy confxml.xml
 92       copy:
 93         src: /etc/ansible/file/confxml.xml
 94         dest: /app/sersync/conf/
 95         backup: yes
 96 
 97     - name: touch password chmod 600
 98       file:
 99         path: /etc/rsync.password
100         state: touch
101         mode: 600
102 
103     - name: content password
104       copy:
105         dest: /etc/rsync.password
106         content: 123456
107 
108     - name: mkdir /upload
109       file:
110         path: /upload
111         state: directory
112         owner: nfsnobody
113         group: nfsnobody
114 
115     - name: shell sersync
116       shell: sersync -rd -o /app/sersync/conf/confxml.xml
117 
118     - name: /etc/rc.d/rc.local
119       shell: echo "sersync -rd -o /app/sersync/conf/confxml.xml" >>/etc/rc.d/rc.local

检查一下

客户端

[03:06 root@nfs01 ~]# touch /upload/lcx{01..5}.txt
[03:06 root@nfs01 ~]# ll /upload/
total 0
-rw-r--r-- 1 root root 0 Jun  1 03:06 
lcx01.txt
-rw-r--r-- 1 root root 0 Jun  1 03:06 lcx02.txt
-rw-r--r-- 1 root root 0 Jun  1 03:06  lcx03.txt
-rw-r--r-- 1 root root 0 Jun  1 03:06  lcx04.txt
-rw-r--r-- 1 root root 0 Jun  1 03:06  lcx05.txt

服务端

[03:06 root@backup ~]# ll /nfsbackup/
total 0
-rw-r--r-- 1 rsync rsync 0 Jun  1 03:06  lcx01.txt
-rw-r--r-- 1 rsync rsync 0 Jun  1 03:06  lcx02.txt
-rw-r--r-- 1 rsync rsync 0 Jun  1 03:06  lcx03.txt
-rw-r--r-- 1 rsync rsync 0 Jun  1 03:06  lcx04.txt
-rw-r--r-- 1 rsync rsync 0 Jun  1 03:06  lcx05.txt

大功告成

把rsync全网备份服务 nfs网络文件共享服务 sersync实时同步服务都放到一个脚本中执行
把SSH远程分发秘钥写到脚本中

[03:07 root@m01 /etc/ansible]# vim /server/scripts/one.sh 
#!/bin/bash
. /etc/profile

sh /server/scripts/fenfa_pub.sh
ansible-playbook /etc/ansible/rsync_backup.yml
ansible-playbook /etc/ansible/nfs.yml
ansible-playbook /etc/ansible/sersync.yml


克隆四台全新的虚拟机测试一下吧:

web01 web02 nfs01 backup
修改主机名 IP地址 做基础优化 关闭防火墙

这种一条走到头的感觉非常爽,有种上厕所的通畅感,终于搞定了!
[03:17 root@m01 /etc/ansible]# sh /server/scripts/one.sh 
Generating public/private dsa key pair.
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
SHA256:Jl7LZ3tPlY2k/WnwjPpaRQcjFwoBecUGCAtiynKARCU root@m01
The key's randomart image is:
+---[DSA 1024]----+
|=E+.. ...++=o =. |
|o+.. . .o ..o+ o |
|o.. . . .. ...|
|.. +..+|
| . S ..ooo|
| . = . \*o.|
| . o o o.=.|
| o .+.. |
| .+oo. |
+----[SHA256]-----+
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_dsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -o 'StrictHostKeyChecking=no' '172.16.1.7'"
and check to make sure that only the key(s) you wanted were added.

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_dsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -o 'StrictHostKeyChecking=no' '172.16.1.8'"
and check to make sure that only the key(s) you wanted were added.

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_dsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -o 'StrictHostKeyChecking=no' '172.16.1.41'"
and check to make sure that only the key(s) you wanted were added.

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_dsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -o 'StrictHostKeyChecking=no' '172.16.1.31'"
and check to make sure that only the key(s) you wanted were added.

172.16.1.7 | CHANGED | rc=0 >>
web01

172.16.1.31 | CHANGED | rc=0 >>
nfs01

172.16.1.41 | CHANGED | rc=0 >>
backup

172.16.1.8 | CHANGED | rc=0 >>
web02


PLAY [backup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [rsync.conf] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [useradd rsync] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [mkdir /backup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [touch password chmod 600] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.41]

TASK [content password] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [restart rsyncd] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.41]

PLAY [oldboy] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.7]
ok: [172.16.1.31]
ok: [172.16.1.8]

TASK [touch password chmod 600] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.7]
changed: [172.16.1.8]
changed: [172.16.1.31]

TASK [content password] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.7]
ok: [172.16.1.8]
ok: [172.16.1.31]

TASK [copy rsync\_backup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.7]
ok: [172.16.1.8]
ok: [172.16.1.31]

TASK [cron backup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
 [WARNING]: The value 0 (type int) in a string field was converted to u'0' (type
string). If this does not look like what you expect, quote the entire value to ensure
it does not change.

ok: [172.16.1.31]
ok: [172.16.1.8]
ok: [172.16.1.7]

PLAY [backup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [yum mailx] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [copy rsync\_backup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [copy mail.rc] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [mail-cron] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
 [WARNING]: The value 1 (type int) in a string field was converted to u'1' (type
string). If this does not look like what you expect, quote the entire value to ensure
it does not change.

ok: [172.16.1.41]

TASK [crontab] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.41]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
172.16.1.31                : ok=5    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
172.16.1.41                : ok=13   changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
172.16.1.7                 : ok=5    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
172.16.1.8                 : ok=5    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

 [WARNING]: While constructing a mapping from /etc/ansible/nfs.yml, line 9, column 9,
found a duplicate dict key (name). Using last defined value only.


PLAY [nfs web] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.7]
ok: [172.16.1.31]
ok: [172.16.1.8]

TASK [yum rpcbind nfs-utils] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.8]
ok: [172.16.1.31]
ok: [172.16.1.7]

PLAY [nfs] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.31]

TASK [configure nfs] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.31]

TASK [mkdir chown /nfs] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.31]

TASK [start && enable rpcbind] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.31]

TASK [reloaded nfs] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.31]

PLAY [web] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.7]
ok: [172.16.1.8]

TASK [mkdir /upload] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.7]
ok: [172.16.1.8]

TASK [mount] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.8]
ok: [172.16.1.7]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
172.16.1.31                : ok=7    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
172.16.1.7                 : ok=5    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
172.16.1.8                 : ok=5    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


PLAY [backup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [gourpadd rsync] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [useradd rsync] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [copy rsyncd.conf] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [mkdir nfsbackup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
ok: [172.16.1.41]

TASK [mkdir password chmod 600] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
changed: [172.16.1.41]

TASK [content password] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
![](https://img-blog.csdnimg.cn/img_convert/9a8cb5f8c0ec69e6499adead0da6e95b.png)



最全的Linux教程,Linux从入门到精通

======================

1.  **linux从入门到精通(第2版)**

2.  **Linux系统移植**

3.  **Linux驱动开发入门与实战**

4.  **LINUX 系统移植 第2版**

5.  **Linux开源网络全栈详解 从DPDK到OpenFlow**



![华为18级工程师呕心沥血撰写3000页Linux学习笔记教程](https://img-blog.csdnimg.cn/img_convert/59742364bb1338737fe2d315a9e2ec54.png)



第一份《Linux从入门到精通》466页

====================

内容简介

====

本书是获得了很多读者好评的Linux经典畅销书**《Linux从入门到精通》的第2版**。本书第1版出版后曾经多次印刷,并被51CTO读书频道评为“最受读者喜爱的原创IT技术图书奖”。本书第﹖版以最新的Ubuntu 12.04为版本,循序渐进地向读者介绍了Linux 的基础应用、系统管理、网络应用、娱乐和办公、程序开发、服务器配置、系统安全等。本书附带1张光盘,内容为本书配套多媒体教学视频。另外,本书还为读者提供了大量的Linux学习资料和Ubuntu安装镜像文件,供读者免费下载。



![华为18级工程师呕心沥血撰写3000页Linux学习笔记教程](https://img-blog.csdnimg.cn/img_convert/9d4aefb6a92edea27b825e59aa1f2c54.png)



**本书适合广大Linux初中级用户、开源软件爱好者和大专院校的学生阅读,同时也非常适合准备从事Linux平台开发的各类人员。**

> 需要《Linux入门到精通》、《linux系统移植》、《Linux驱动开发入门实战》、《Linux开源网络全栈》电子书籍及教程的工程师朋友们劳烦您转发+评论




**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注运维)**
![img](https://img-blog.csdnimg.cn/img_convert/9c4b331e453070ae1035652db5da94a0.jpeg)

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
版本,循序渐进地向读者介绍了Linux 的基础应用、系统管理、网络应用、娱乐和办公、程序开发、服务器配置、系统安全等。本书附带1张光盘,内容为本书配套多媒体教学视频。另外,本书还为读者提供了大量的Linux学习资料和Ubuntu安装镜像文件,供读者免费下载。



![华为18级工程师呕心沥血撰写3000页Linux学习笔记教程](https://img-blog.csdnimg.cn/img_convert/9d4aefb6a92edea27b825e59aa1f2c54.png)



**本书适合广大Linux初中级用户、开源软件爱好者和大专院校的学生阅读,同时也非常适合准备从事Linux平台开发的各类人员。**

> 需要《Linux入门到精通》、《linux系统移植》、《Linux驱动开发入门实战》、《Linux开源网络全栈》电子书籍及教程的工程师朋友们劳烦您转发+评论




**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注运维)**
[外链图片转存中...(img-mxJOlw76-1713391566923)]

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值