- 博客(15)
- 收藏
- 关注
原创 mysql排序、分组、多表查询
1.mysql排序1.1.从大到小排序,不加desc默认情况下是升序MariaDB [fei1]> select * from student order by age desc;+----+-------------+------+| id | name | age |+----+-------------+------+| 7 | lisi | 50 || 4 | sean | 28 || 5 | zhangshan |
2020-10-23 00:56:20
234
原创 Mysql
1.mysql安装与配置[root@client ~]# yum -y install mariadb mariadb-common mariadb-devel mariadb-serverInstalled: keyutils-libs-devel-1.5.10-6.el8.x86_64 krb5-devel-1.17-18.el8.x86_64 libcom_err-de
2020-10-21 03:46:50
355
原创 Rsync
1.准备两台服务器,一个客户端一个服务端,关闭服务端上的防火墙与Selinux(rsync已安装跳过)[root@server ~]# systemctl stop firewalld[root@server ~]# systemctl disable firewalld[root@server ~]# setenforce 02.在服务端安装rsync-deamon守护进程[root@server ~]# yum -y install rsync-daemonInstalled: rs
2020-10-19 01:14:16
206
原创 ftp、rsync
1.安装vsftpd[root@server ~]# yum -y install vsftpdInstalled: vsftpd-3.0.3-31.el8.x86_64 Co
2020-10-16 00:51:27
645
原创 samba
1.服务端安装samba下面所有的包[root@server ~]# yum -y install samba*nstalled: libldb-devel-2.0.7-3.el8.x86_64 libtalloc-devel-2.2.0-7.el8.x86_64 libtdb-devel-1.4.2-2.el8.x86_64 libtevent-devel-0.10.0-2.el8.x86_64
2020-10-14 01:11:29
337
原创 手动搭建nfs服务器
1.准备两台服务器,一台客户端,一台服务端[root@afei ~]# hostnamectl set-hostname client[root@afei ~]# bash[root@client ~]# [root@clocalhost ~]# hostnamectl set-hostname server[root@client ~]# bash[root@server ~]# 2.两台主机安装NFS[root@client ~]# yum -y install nfs-utilsU
2020-10-13 00:41:00
237
原创 角色的创建、编写以及管理
1.创建角色[root@afei opt]# touch playbook.yml[root@afei opt]# mkdir roles[root@afei opt]# lsplaybook.yml roles2.如果在roles子目录中找不到角色会去ansible配置文件中设置的roles_path指定的目录中找[root@afei opt]# vim /etc/ansible/ansible.cfg #roles_path = /etc/ansible/roles# un
2020-09-21 12:43:56
386
原创 条件判断
1.条件任务语法1.1 这里以安装卸载httpd为例[root@localhost ~]# rpm -qa|grep httpd[root@localhost ~]# [root@afei weixin]# vim playbook.yml ---- hosts: all vars: my_condition: True tasks: - name: Ensure the httpd is installed yum: name: httpd
2020-09-14 14:18:26
146
原创 任务处理与文件管理模块
1.处理任务失败,用ignore_errors忽略,使任务继续执行[root@afei weixin]# vim playbook.yml ---- hosts: all tasks: - name: feige yum: name: feige state: present - name: feige command: echo "nihao"注:上述命令行任务中第一个是错误的,第二个是正确的,但不会执行第
2020-09-14 14:18:09
266
原创 清单管理、serial、forks
1.制作清单模板[root@afei weixin]# tree.├── files│ └── httpd.conf├── group_vars│ └── wbservers├── host_vars│ └── 192.168.240.134├── inventory├── password└── playbook.yml2.使用forks在ansible中配置并行[root@afei weixin]# vim /etc/ansible/ansible.cfg
2020-09-14 14:17:49
437
原创 2020-09-04
Linux高级运维-事实、变量、循环1.事实指的是受控主机自动检测到的变量[root@afei weixin]# ansible webservers -i inventory -m setup |less192.168.240.134 | SUCCESS => { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.240.134", "192.168.1
2020-09-04 12:47:44
217
原创 Linux高级运维-变量与机密
Linux高级运维-变量与机密1.使用目录填充主机和组变量[root@afei ~]# mkdir /opt/weixin[root@afei ~]# cd /opt/weixin/[root@afei weixin]# touch playbook.yml[root@afei weixin]# touch inventory[root@afei weixin]# lsinventory playbook.yml[root@afei weixin]# mkdir files[root@a
2020-09-02 13:53:21
1080
原创 Linux高级运维-playbook-httpd
Linux高级运维-playbook-httpd1.查看控制机和受控机是否ping通[root@afei ~]# ansible all -m ping192.168.240.134 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": false, "ping": "pong"
2020-09-01 12:16:39
185
原创 Lnux高级运维-ansible
Lnux高级运维-ansible1.ansible常用模块ping[root@afei ~]# ansible 192.168.240.134 -m ping192.168.240.134 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": false, "ping": "pon
2020-08-31 14:51:15
212
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人