ATS简单安装配置+syncd同步

定义yum源

cat>/etc/yum.repos.d/ats.repo<<EOF
[ats]
name=ats
baseurl=https://copr-be.cloud.fedoraproject.org/results/hnakamur/apache-traffic-server-7/epel-7-\$basearch/
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/hnakamur/apache-traffic-server-7/pubkey.gpg
enabled=1
EOF

安装软件包

yum -y install trafficserver
mkdir /home/{cache,certs}
chown -R ats.ats /home/cache
chown -R ats.ats /etc/trafficserver

跳转样例

redirect http://1.com                 https://1.com
redirect http://www.1.com             https://www.1.com
map      https://1.com                http://1.1.1.1
map      https://www.1.com            http://1.1.1.1

 

rsync端简单配置,只需修改hosts allow为允许的lsync服务端ip,多个ip可在后面加,隔开

cat>/etc/rsyncd.conf<<EOF
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
uid = root
gid = root
hosts allow= 1.1.1.1,2.2.2.2
max connections = 10
hosts  deny=*

[ats]
path = /etc/trafficserver
list=ture
read only = false
[certs]
path = /home/certs
list=ture
read only = false
EOF
systemctl enable rsyncd
systemctl restart rsyncd


lsync端简单配置,只需修改对应的target处ip为rsync端ip

settings {
  logfile = "/var/log/lsyncd.log",
  statusFile = "/tmp/lsyncd.stat",
  statusInterval = 1,
  insist=true,
  inotifyMode  = "CloseWrite",
  maxProcesses = 30,
  maxDelays =1,
         }

sync {
    default.rsync,
    source="/home/certs",
    target="1.1.1.1::certs",
    delete = true,
    delay=15,

    rsync  = {
     binary   = "/usr/bin/rsync",
     archive  = true,
     compress = true,
     verbose =true,
     perms =  true
         }
    }
sync {
    default.rsync,
    source="/etc/trafficserver",
    target="1.1.1.1::ats",
    delete = true,
    delay=15,

    rsync  = {
     binary   = "/usr/bin/rsync",
     archive  = true,
     compress = true,
     verbose =true,
     perms =  true
         }
    }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值