Linux下Rsync+Inotify-tools实现数据实时同步

服务器环境:Linux CentOS 7 服务器A:192.168.0.101(客户端) 服务器B:192.168.0.100(服务端) 在服务器A和服务器B上通过yum命令安装软件包: [root@192 ~]# yum -y install rsync inotify-tools 一、在服务器A(客户端)的配置rsync 配置conf文件: [root@192 ~]# vim /etc/rsyncd.conf transfer logging = yes pid file = /var/ru…

Linux系统下快速建立IPIP隧道脚本

测试系统环境:CentOS 7.3 服务器A:1.1.1.1 服务器B:2.2.2.2 在服务器A和服务器B建立一个shell脚本,具体内容如下: [root@1 ~]vim tunadd.sh #!/bin/bash modprobe ipip sip=${SIP} dip=”” tun=${TUN:-tun} net=${NET:-172.16} mode=”n” vp=0; ks=0; while getopts ‘s:d:t:n:x:v’ opt ;do case $opt in x) …

Linux环境中安装部署Redis

系统环境:CentOS 7.3.1611 1、将redis-2.4.17.tar.gz上传到/usr/local目录 2、make编译安装 [root@192 local]#cd /usr/local/redis-2.4.17/ [root@192 local]# make   3、编译完成后,在Src目录下,有四个可执行文件redis-server、redis-benchmark、redis-cli和redis.conf。然后拷贝到一个目录下 [root@192 local]#cd …

Linux系统中部署JDK环境

1、查看jdk是否安装 使用命令rpm -qa|grep jdk或java -version 2、下载到/usr/local目录 [root@192 local]# wget –no-check-certificate –no-cookie –header “Cookie: oraclelicense=accept-securebackup-cookie;” http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be…

通过ipset+iptables封堵异常连接IP

如果同一个IP异常连接超过某个值,就将该IP加入黑名单,180S后释放该IP #!/bin/bash ipset create blacklist hash:ip timeout 180 iplist=`netstat -ntu | awk ‘{print $5}’| cut -d’:’ -f1| sort |uniq -c | sed ‘N;$d;P;D’ | awk ‘{if($1>30)print $2}’` for ip in $iplist do # iptables -I IN…