摘要: 1、首先准备两台服务器、三台也可以我这里是两台 IP:192.168.52.33 IP:192.168.52.34 VIP:192.168.52.100 2、关闭防火墙 systemctl stop firewalld setenforce 0 3、安装keepalived,两台机器都需要安装 yu 阅读全文
posted @ 2019-12-19 14:00 Zsecret 阅读(464) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash systemctl stop firewalld setenforce 0 user="tom" password="123" slave_ipaddr="192.168.52.34" #这里写自己从的IP地址 master_ipaddr="192.168.52.33" #这 阅读全文
posted @ 2019-12-06 15:06 Zsecret 阅读(651) 评论(0) 推荐(0) 编辑
摘要: AWK 1 AWK 2 3 linux取IP地址 4 5 ifconfig | grep -w inet | sed -n '1p' | awk '{print $2}' 6 7 eg: 8 9 awk -F ':' '{print $1}' /etc/passwd 10 11 awk -F ':' 阅读全文
posted @ 2019-12-06 10:04 Zsecret 阅读(635) 评论(0) 推荐(0) 编辑
摘要: 变量分为普通变量可只读变量 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 4 阅读全文
posted @ 2019-12-06 09:51 Zsecret 阅读(136) 评论(0) 推荐(0) 编辑
摘要: sed 我们首先准备了一个测试文件 1. s 替换 将文件中的This替换cyy 在替换的时候如果加入了 -i 选项就会真的替换,但是只会替换每一行的第一个 -n 和 -p 一起使用表示的是打印那些发生替换的行 加入-g的参数是指全部替换,全局的一个参数 当需要从第N处替换的时候,可以加入Ng:这里 阅读全文
posted @ 2019-12-06 09:50 Zsecret 阅读(660) 评论(0) 推荐(0) 编辑
摘要: grep 1.-i 不区分大写小写 2.-n 区分大小写 3.-E 查找多个条件 4.-c 查找到的结果的行数 5.-w 精确查找 6.取反 7.-q 静默输出 阅读全文
posted @ 2019-12-06 09:47 Zsecret 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 1、打开VMware,查看ifconfig 2、进入网卡编辑 [root@localhost ~]# cd /etc/sysconfig/network-scripts/ [root@localhost network-scripts]# ls ifcfg-ens192 ifdown-ippp if 阅读全文
posted @ 2019-12-04 15:32 Zsecret 阅读(613) 评论(0) 推荐(1) 编辑
摘要: 1、安装vsftpd yum -y install vsftpd yum -y install ftp 客户端 2、编写配置文件 vim /etc/vsftpd/vsftpd.conf anonymous_enable=YES anon_upload_enable=YES anon_other_wr 阅读全文
posted @ 2019-12-04 15:11 Zsecret 阅读(908) 评论(0) 推荐(1) 编辑
摘要: 1 #!/bin/bash 2 a=$(expr $RANDOM % 100) #生成一到一百的随机数 3 echo $a #打印随机数 4 b=0 5 while true 6 do 7 let b++ 8 echo "比较了第$b次!" 9 read -p "请输入一个1-100的随机数数: " 阅读全文
posted @ 2019-11-30 10:43 Zsecret 阅读(292) 评论(0) 推荐(1) 编辑