Compare commits

...

8 Commits

Author SHA1 Message Date
5070a3c139 添加简介 2022-12-07 23:20:52 +08:00
2c21d2ac74 添加简介 2022-12-07 23:19:58 +08:00
c9c96e73cc modify yungao git 2022-12-07 22:40:21 +08:00
LoveesYe
7bdd4f8054 Update README 2022-08-10 23:21:12 +02:00
LoveesYe
66acb9392b Add files via upload 2022-07-29 15:18:36 +02:00
LoveesYe
b8a0fa535e Update master.sh 2022-07-29 14:13:47 +02:00
LoveesYe
13249045dd Update agent.sh 2022-07-29 14:12:02 +02:00
LoveesYe
34f2a5bde6 Create FAQ 2022-07-28 20:14:39 +02:00
25 changed files with 206 additions and 296 deletions

122
FAQ Normal file
View File

@@ -0,0 +1,122 @@
如何搬迁主控
注意下面的迁移步骤不包括迁移elasticsearch的数据
1 备份旧主控数据
在旧主控执行如下命令开始备份(注意:备份前会停止旧主控的进程)
cd /root
curl http://us.centos.bz/cdnfly/backup_master.sh -o backup_master.sh
chmod +x backup_master.sh
./backup_master.sh
这时候将在目录/root下打包生成cdn.sql.gz文件请把这个文件传输到新主控的/root/目录下可以使用scp命令命令如下
cd /root
scp cdn.sql.gz root@新主控IP:/root/
2 在新机器安装好主控程序
首先登录cdnfly.cn更新授权为新主控ip并清空机器码
登录旧主控机器,执行如下命令查看版本:
grep VERSION_NAME /opt/cdnfly/master/conf/config.py
如下图版本为v4.1.6
登录新机器,执行如下命令安装:
curl http://dl.cdnfly.cn/cdnfly/master.sh -o master.sh
chmod +x master.sh
./master.sh --ver v4.1.60
其中v4.1.60替换成自己的主控版本号
3 登录新主控,恢复备份
执行如下命令恢复
cd /root
curl http://us.centos.bz/cdnfly/restore_master.sh -o restore_master.sh
chmod +x restore_master.sh
./restore_master.sh
从旧主控下载/opt/cdnfly/master/conf/config.py上传到新主控覆盖
然后在新主控初始化es,重启新主控
执行如下命令初始化:
cd /tmp
wget us.centos.bz/cdnfly/int_es.sh -O int_es.sh
chmod +x int_es.sh
./int_es.sh /home/es
supervisorctl restart all
其中/var/lib/elasticsearch为es的数据目录可以更改成其它的比如/home/es
4 替换节点里的主控IP
一个个登录节点,执行如下命令替换
new_master_ip="这里替换为新主控IP"
sed -i "s/ES_IP =.*/ES_IP = \"$new_master_ip\"/" /opt/cdnfly/agent/conf/config.py
sed -i "s/MASTER_IP.*/MASTER_IP = \"$new_master_ip\"/g" /opt/cdnfly/agent/conf/config.py
sed -i "s/hosts:.*/hosts: [\"$new_master_ip:9200\"]/" /opt/cdnfly/agent/conf/filebeat.yml
logs_path=`awk '/error_log/{print $2}' /usr/local/openresty/nginx/conf/nginx.conf | sed 's/error.log//'`
if [[ `echo $logs_path | grep ^/ ` != "" ]];then
sed -i "s#.*access.log# - $logs_path/access.log#" /opt/cdnfly/agent/conf/filebeat.yml
sed -i "s#.*stream.log# - $logs_path/stream.log#" /opt/cdnfly/agent/conf/filebeat.yml
fi
sed -i "s#http://.*:88#http://$new_master_ip:88#" /usr/local/openresty/nginx/conf/listen_80.conf /usr/local/openresty/nginx/conf/listen_other.conf
ps aux | grep [/]usr/local/openresty/nginx/sbin/nginx | awk '{print $2}' | xargs kill -HUP || true
supervisorctl restart filebeat
supervisorctl restart agent
supervisorctl restart task
5 迁移完成
登录新主控后台在首页点击检查agent如果没有错误表示主控迁移完成。
如何获取授权
如何授权到期,或者在授权前安装程序,可以登录主控,执行如下命令获取授权:
# 获取授权
source /opt/venv/bin/activate
cd /opt/cdnfly/master/view
ret=`python -c "import util;print util.get_auth_code()" || true`
[[ $ret == "(True, None)" ]] && echo "已获取到授权" || echo "未授权,原因:"$ret
deactivate
如何取消管理端域名绑定
在主控上执行如下命令
mysql -uroot -p@cdnflypass cdn -e "update config set value='' where name='admin_domain';"
mysql -uroot -p@cdnflypass cdn -e "update config set value='' where name='user_domain';"
如何重置主控密码
执行如下命令重置密码为cdnfly用户名不变
mysql -uroot -p@cdnflypass cdn -e 'update user set password="$2b$12$UV5ttpNQizMfO.tiBk9ereZ53hDBW0.kak3qa/GRP6aVBfNMB1NsK" where id=1'
如何初始化elasticsearch
当elasticsearch出现无法解决的异常或者elasticsearch数据占满了硬盘可以执行此操作来初始化elasticsearch注意初始化elasticsearch会清空其所有的数据。
执行如下命令初始化:
cd /tmp
wget http://us.centos.bz/cdnfly/int_es.sh -O int_es.sh
chmod +x int_es.sh
./int_es.sh /home/es
其中/home/es为es的数据目录也可以更改成其它的。
如何更换主控IP
首先登录官网修改授权的主控 IP然后登录每个节点执行下面的命令:
new_master_ip="这里替换为主控IP"
es_pwd="这里替换为es密码"
sed -i "s/ES_IP =.*/ES_IP = \"$new_master_ip\"/" /opt/cdnfly/agent/conf/config.py
sed -i "s/MASTER_IP.*/MASTER_IP = \"$new_master_ip\"/g" /opt/cdnfly/agent/conf/config.py
sed -i "s/hosts:.*/hosts: [\"$new_master_ip:9200\"]/" /opt/cdnfly/agent/conf/filebeat.yml
sed -i "s#http://.*:88#http://$new_master_ip:88#" /usr/local/openresty/nginx/conf/listen_80.conf /usr/local/openresty/nginx/conf/listen_other.conf
sed -i "s/ES_PWD =.*/ES_PWD = \"$es_pwd\"/" /opt/cdnfly/agent/conf/config.py
sed -i "s/password:.*/password: \"$es_pwd\"/" /opt/cdnfly/agent/conf/filebeat.yml
sed -i "s/agent-pwd:.*/agent-pwd: \"$es_pwd\"/" /opt/cdnfly/agent/conf/filebeat.yml
ps aux | grep [/]usr/local/openresty/nginx/sbin/nginx | awk '{print $2}' | xargs kill -HUP || true
supervisorctl restart filebeat
supervisorctl restart agent
supervisorctl restart task
es密码在主控的/opt/cdnfly/master/conf/config.py里的LOG_PWD
安装代理软件
当主控无法直接与节点连接时可以通过代理来连接这里介绍安装代理软件的方法目前只支持centos系统安装命令如下
cd /tmp
wget http://us.centos.bz/cdnfly/install_proxy.sh
chmod +x install_proxy.sh
./install_proxy.sh
安装完成后,会显示代理的端口,用户名和密码。
手动备份数据库
eval `grep "MYSQL_PASS" /opt/cdnfly/master/conf/config.py` && mysqldump -uroot -p$MYSQL_PASS cdn | gzip > /root/

73
README
View File

@@ -13,23 +13,23 @@ vi /etc/hosts
0.0.0.0 auth.cdnfly.cn monitor.cdnfly.cn
2.主控
v5.1.11版本安装脚本:
curl -fsSL https://github.com/LoveesYe/cdnflydadao/raw/main/master.sh -o master.sh && chmod +x master.sh && ./master.sh --es-dir /home/es
curl -fsSL https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master.sh -o master.sh && chmod +x master.sh && ./master.sh --es-dir /home/es
新v5.1.13版本安装脚本:
curl -fsSL https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/master/master.sh -o master.sh && chmod +x master.sh && ./master.sh --es-dir /home/es
curl -fsSL https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/master/master.sh -o master.sh && chmod +x master.sh && ./master.sh --es-dir /home/es
3.被控
v5.1.15版本安装脚本:
curl -fsSL -m 5 https://github.com/LoveesYe/cdnflydadao/raw/main/agent/agent.sh -o agent.sh || curl -m 5 https://github.com/LoveesYe/cdnflydadao/raw/main/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master-ip ip --es-ip ip --es-pwd passwd
curl -fsSL -m 5 https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/agent/agent.sh -o agent.sh || curl -m 5 https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master-ip ip --es-ip ip --es-pwd passwd
新v5.1.16版本安装脚本:
curl -fsSL -m 5 https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh || curl -m 5 https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master-ip ip --es-ip ip --es-pwd passwd
curl -fsSL -m 5 https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh || curl -m 5 https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master-ip ip --es-ip ip --es-pwd passwd
4.
已安装过官方版的开心方法:
执行以下命令完成开心:
wget https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
wget https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
supervisorctl -c /opt/cdnfly/master/conf/supervisord.conf reload
如果旧版本要升级,可以先更新自建云端的文件,然后执行“已安装过官方版的开心方法”这一部分的命令,最后在主控后台升级。
@@ -70,3 +70,66 @@ supervisorctl -c /opt/cdnfly/master/conf/supervisord.conf reload
尊敬的cdnfly用户:
目前发现登录安全漏洞,需要及时按照如下方法来临时修复。找-个只有你知道的域名,这个域名用于管理员登录。
如的域名不用带http://,路径为:系统管理--->系统设置--->用户相关,限制管理员只能从此域名登录
搬迁主控
注意下面的迁移步骤不包括迁移elasticsearch的数据
1 备份旧主控数据
在旧主控执行如下命令开始备份(注意:备份前会停止旧主控的进程)
cd /root
curl http://us.centos.bz/cdnfly/backup_master.sh -o backup_master.sh
chmod +x backup_master.sh
./backup_master.sh
这时候将在目录/root下打包生成cdn.sql.gz文件请把这个文件传输到新主控的/root/目录下可以使用scp命令命令如下
cd /root
scp cdn.sql.gz root@新主控IP:/root/
2 在新机器安装好主控程序
首先登录cdnfly.cn更新授权为新主控ip并清空机器码
登录旧主控机器,执行如下命令查看版本:
grep VERSION_NAME /opt/cdnfly/master/conf/config.py
如下图版本为v4.1.6
登录新机器,执行如下命令安装:
curl http://dl.cdnfly.cn/cdnfly/master.sh -o master.sh
chmod +x master.sh
./master.sh --ver v4.1.60
其中v4.1.60替换成自己的主控版本号
3 登录新主控,恢复备份
执行如下命令恢复
cd /root
curl http://us.centos.bz/cdnfly/restore_master.sh -o restore_master.sh
chmod +x restore_master.sh
./restore_master.sh
从旧主控下载/opt/cdnfly/master/conf/config.py上传到新主控覆盖
然后在新主控初始化es,重启新主控
执行如下命令初始化:
cd /tmp
wget us.centos.bz/cdnfly/int_es.sh -O int_es.sh
chmod +x int_es.sh
./int_es.sh /home/es
supervisorctl restart all
其中/var/lib/elasticsearch为es的数据目录可以更改成其它的比如/home/es
4 替换节点里的主控IP
一个个登录节点,执行如下命令替换
new_master_ip="这里替换为新主控IP"
sed -i "s/ES_IP =.*/ES_IP = \"$new_master_ip\"/" /opt/cdnfly/agent/conf/config.py
sed -i "s/MASTER_IP.*/MASTER_IP = \"$new_master_ip\"/g" /opt/cdnfly/agent/conf/config.py
sed -i "s/hosts:.*/hosts: [\"$new_master_ip:9200\"]/" /opt/cdnfly/agent/conf/filebeat.yml
logs_path=`awk '/error_log/{print $2}' /usr/local/openresty/nginx/conf/nginx.conf | sed 's/error.log//'`
if [[ `echo $logs_path | grep ^/ ` != "" ]];then
sed -i "s#.*access.log# - $logs_path/access.log#" /opt/cdnfly/agent/conf/filebeat.yml
sed -i "s#.*stream.log# - $logs_path/stream.log#" /opt/cdnfly/agent/conf/filebeat.yml
fi
sed -i "s#http://.*:88#http://$new_master_ip:88#" /usr/local/openresty/nginx/conf/listen_80.conf /usr/local/openresty/nginx/conf/listen_other.conf
ps aux | grep [/]usr/local/openresty/nginx/sbin/nginx | awk '{print $2}' | xargs kill -HUP || true
supervisorctl restart filebeat
supervisorctl restart agent
supervisorctl restart task

View File

@@ -14,23 +14,23 @@ vi /etc/hosts
0.0.0.0 auth.cdnfly.cn monitor.cdnfly.cn
2. Master control
v5.1.11 version installation script:
curl -fsSL https://github.com/LoveesYe/cdnflydadao/raw/main/master.sh -o master.sh && chmod +x master.sh && ./master.sh --es-dir /home/es
curl -fsSL https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master.sh -o master.sh && chmod +x master.sh && ./master.sh --es-dir /home/es
New v5.1.13 version installation script:
curl -fsSL https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/master/master.sh -o master.sh && chmod +x master.sh && ./master.sh -- es-dir /home/es
curl -fsSL https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/master/master.sh -o master.sh && chmod +x master.sh && ./master.sh -- es-dir /home/es
3. Charged
v5.1.15 version installation script:
curl -fsSL -m 5 https://github.com/LoveesYe/cdnflydadao/raw/main/agent/agent.sh -o agent.sh || curl -m 5 https://github.com/LoveesYe/cdnflydadao/ raw/main/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master-ip ip --es-ip ip --es -pwd passwd
curl -fsSL -m 5 https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/agent/agent.sh -o agent.sh || curl -m 5 https://git.yungao-tech.com/shadow/cdnflydadao/ raw/main/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master-ip ip --es-ip ip --es -pwd passwd
New v5.1.16 version installation script:
curl -fsSL -m 5 https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh || curl -m 5 https://github. com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master -ip ip --es-ip ip --es-pwd passwd
curl -fsSL -m 5 https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh || curl -m 5 https://github. com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/agent.sh -o agent.sh && chmod +x agent.sh && ./agent.sh --master-ver v5.1.11 --master -ip ip --es-ip ip --es-pwd passwd
4.
The happy method that has installed the official version:
Execute the following command to finish happy:
wget https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
wget https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
supervisorctl -c /opt/cdnfly/master/conf/supervisord.conf reload
If you want to upgrade the old version, you can first update the files in the self-built cloud, and then execute the command in the section "Happy Ways that have already installed the official version", and finally upgrade in the main control background.

Binary file not shown.

View File

@@ -1,249 +0,0 @@
#!/bin/bash -x
set -o errexit
#判断系统版本
check_sys(){
local checkType=$1
local value=$2
local release=''
local systemPackage=''
local packageSupport=''
if [[ "$release" == "" ]] || [[ "$systemPackage" == "" ]] || [[ "$packageSupport" == "" ]];then
if [[ -f /etc/redhat-release ]];then
release="centos"
systemPackage="yum"
packageSupport=true
elif cat /etc/issue | grep -q -E -i "debian";then
release="debian"
systemPackage="apt"
packageSupport=true
elif cat /etc/issue | grep -q -E -i "ubuntu";then
release="ubuntu"
systemPackage="apt"
packageSupport=true
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat";then
release="centos"
systemPackage="yum"
packageSupport=true
elif cat /proc/version | grep -q -E -i "debian";then
release="debian"
systemPackage="apt"
packageSupport=true
elif cat /proc/version | grep -q -E -i "ubuntu";then
release="ubuntu"
systemPackage="apt"
packageSupport=true
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat";then
release="centos"
systemPackage="yum"
packageSupport=true
else
release="other"
systemPackage="other"
packageSupport=false
fi
fi
echo -e "release=$release\nsystemPackage=$systemPackage\npackageSupport=$packageSupport\n" > /tmp/ezhttp_sys_check_result
if [[ $checkType == "sysRelease" ]]; then
if [ "$value" == "$release" ];then
return 0
else
return 1
fi
elif [[ $checkType == "packageManager" ]]; then
if [ "$value" == "$systemPackage" ];then
return 0
else
return 1
fi
elif [[ $checkType == "packageSupport" ]]; then
if $packageSupport;then
return 0
else
return 1
fi
fi
}
# 安装依赖
install_depend() {
if check_sys sysRelease ubuntu;then
apt-get update
apt-get -y install wget python-minimal
elif check_sys sysRelease centos;then
yum install -y wget python
fi
}
download(){
local url1=$1
local url2=$2
local filename=$3
# 检查文件是否存在
# if [[ -f $filename ]]; then
# echo "$filename 文件已经存在,忽略"
# return
# fi
speed1=`curl -m 5 -L -s -w '%{speed_download}' "$url1" -o /dev/null || true`
speed1=${speed1%%.*}
speed2=`curl -m 5 -L -s -w '%{speed_download}' "$url2" -o /dev/null || true`
speed2=${speed2%%.*}
echo "speed1:"$speed1
echo "speed2:"$speed2
url="$url1\n$url2"
if [[ $speed2 -gt $speed1 ]]; then
url="$url2\n$url1"
fi
echo -e $url | while read l;do
echo "using url:"$l
wget --dns-timeout=5 --connect-timeout=5 --read-timeout=10 --tries=2 "$l" -O $filename && break
done
}
get_sys_ver() {
cat > /tmp/sys_ver.py <<EOF
import platform
import re
sys_ver = platform.platform()
sys_ver = re.sub(r'.*-with-(.*)-.*',"\g<1>",sys_ver)
if sys_ver.startswith("centos-7"):
sys_ver = "centos-7"
if sys_ver.startswith("centos-6"):
sys_ver = "centos-6"
print sys_ver
EOF
echo `python /tmp/sys_ver.py`
}
sync_time(){
echo "start to sync time and add sync command to cronjob..."
if check_sys sysRelease ubuntu || check_sys sysRelease debian;then
apt-get -y update
apt-get -y install ntpdate wget
/usr/sbin/ntpdate -u pool.ntp.org || true
! grep -q "/usr/sbin/ntpdate -u pool.ntp.org" /var/spool/cron/crontabs/root > /dev/null 2>&1 && echo '*/10 * * * * /usr/sbin/ntpdate -u pool.ntp.org > /dev/null 2>&1 || (date_str=`curl update.cdnfly.cn/common/datetime` && timedatectl set-ntp false && echo $date_str && timedatectl set-time "$date_str" )' >> /var/spool/cron/crontabs/root
service cron restart
elif check_sys sysRelease centos; then
yum -y install ntpdate wget
/usr/sbin/ntpdate -u pool.ntp.org || true
! grep -q "/usr/sbin/ntpdate -u pool.ntp.org" /var/spool/cron/root > /dev/null 2>&1 && echo '*/10 * * * * /usr/sbin/ntpdate -u pool.ntp.org > /dev/null 2>&1 || (date_str=`curl update.cdnfly.cn/common/datetime` && timedatectl set-ntp false && echo $date_str && timedatectl set-time "$date_str" )' >> /var/spool/cron/root
service crond restart
fi
# 时区
rm -f /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
if /sbin/hwclock -w;then
return
fi
}
need_sys() {
SYS_VER=`python -c "import platform;import re;sys_ver = platform.platform();sys_ver = re.sub(r'.*-with-(.*)-.*','\g<1>',sys_ver);print sys_ver;"`
if [[ $SYS_VER =~ "Ubuntu-16.04" ]];then
echo "$sys_ver"
elif [[ $SYS_VER =~ "centos-7" ]]; then
SYS_VER="centos-7"
echo $SYS_VER
else
echo "目前只支持ubuntu-16.04和Centos-7"
exit 1
fi
}
install_depend
need_sys
sync_time
# 解析命令行参数
TEMP=`getopt -o h --long help,master-ver:,agent-ver:,master-ip:,es-ip:,es-pwd:,ignore-ntp -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while true ; do
case "$1" in
-h|--help) help ; exit 1 ;;
--master-ver) MASTER_VER=$2 ; shift 2 ;;
--agent-ver) AGENT_VER=$2 ; shift 2 ;;
--) shift ; break ;;
*) break ;;
esac
done
if [[ $MASTER_VER == "" ]]; then
if [[ $AGENT_VER == "" ]]; then
echo "--master-ver或--agent-ver至少提供一个"
exit 1
fi
# 指定了agent版本
if [[ ! `echo "$AGENT_VER" | grep -P "^v\d+\.\d+\.\d+$"` ]]; then
echo "指定的版本格式不正确应该类似为v3.0.1"
exit 1
fi
dir_name="cdnfly-agent-$AGENT_VER"
tar_gz_name="$dir_name-$(get_sys_ver).tar.gz"
else
# 指定了主控版本
# 根据master安装指定agent
# 由version_name转换成version_num
first_part=${MASTER_VER:1:1}
second_part=$(printf "%02d\n" `echo $MASTER_VER | awk -F'.' '{print $2}'`)
third_part=$(printf "%02d\n" `echo $MASTER_VER | awk -F'.' '{print $3}'`)
version_num="$first_part$second_part$third_part"
agent_ver=`(curl -s -m 5 "http://auth.fikkey.com/master/upgrades?version_num=$version_num" || curl -s -m 5 "https://github.com/LoveesYe/cdnflydadao/raw/main/web/upgrades?version_num=$version_num") | grep -Po '"agent_ver":"\d+"' | grep -Po "\d+" || true`
if [[ "$agent_ver" == "" ]]; then
echo "无法获取agent版本"
exit 1
fi
first_part=${agent_ver:0:1}
let second_part=10#${agent_ver:1:2} || true
let third_part=10#${agent_ver:3:2} || true
agent_version_name="v$first_part.$second_part.$third_part"
echo "根据主控版本$MASTER_VER得到agent需要安装的版本为$agent_version_name"
dir_name="cdnfly-agent-$agent_version_name"
tar_gz_name="$dir_name-$(get_sys_ver).tar.gz"
fi
cd /opt
download "https://github.com/LoveesYe/cdnflydadao/raw/main/agent/$tar_gz_name" "https://github.com/LoveesYe/cdnflydadao/raw/main/agent/$tar_gz_name" "$tar_gz_name"
rm -rf $dir_name
tar xf $tar_gz_name
rm -rf cdnfly
mv $dir_name cdnfly
# 开始安装
cd /opt/cdnfly/agent
chmod +x install.sh
./install.sh $@

View File

@@ -1,26 +0,0 @@
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
#metalink=http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
#metalink=http://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
#metalink=http://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
{"360spider":["180.153.232","180.153.234","180.153.236","180.163.220","42.236.101","42.236.102","42.236.103","42.236.10","42.236.12","42.236.13","42.236.14","42.236.15","42.236.16","42.236.17","42.236.46","42.236.48","42.236.49","42.236.50","42.236.51","42.236.52","42.236.53","42.236.54","42.236.55","42.236.99"], "baidu":["124.166.232","116.179.32","180.76.15","180.76.5","220.181.108","123.125.71","123.125.66","111.206.198","111.206.221","180.149.133","61.135.186","220.181.32","61.135.168","23.88.208","61.135.165","61.135.169","104.245.36","149.28.84","158.247.209","23.89.152","45.66.156","65.49.194","8.9.8"],"google":["103.28.15","109.228.12","109.238.6","129.143.3","142.147.250","144.76.92","162.221.189","173.212.206","173.212.237","173.249.20","173.249.22","173.249.31","174.34.149","175.45.118","178.20.236","194.48.168","194.67.218","195.201.22","202.222.13","202.222.14","203.208.60","209.141.43","209.141.60","212.162.12","213.136.87","213.136.91","217.156.87","217.20.115","23.105.51","45.77.110","45.77.142","45.77.69","5.189.166","64.68.88","64.68.90","64.68.91","64.68.92","66.249.64","66.249.65","66.249.66","66.249.68","66.249.69","66.249.70","66.249.71","66.249.72","66.249.73","66.249.74","66.249.75","66.249.76","66.249.79","79.143.185","79.174.79","89.46.100","91.144.154","93.104.213","95.211.225","108.177.64","108.177.65","108.177.66","108.177.67","108.177.68","108.177.69","108.177.70","108.177.71","108.177.72","108.177.73","108.177.74","108.177.75","108.177.76","108.177.77","108.177.78","203.208.38","209.85.238","66.249.87","66.249.89","66.249.90","66.249.91","66.249.92","72.14.199","74.125.148","74.125.149","74.125.150","74.125.151","74.125.216","74.125.217"],"sm":["106.11.152","106.11.153","106.11.154","106.11.155","106.11.156","106.11.157","106.11.158","106.11.159","42.120.160","42.120.161","42.120.234","42.120.235","42.120.236","42.156.136","42.156.137","42.156.138","42.156.139","42.156.254","42.156.255"],"bing":["103.25.156","103.255.141","104.44.253","104.44.91","104.44.92","104.44.93","104.47.224","111.221.28","111.221.31","131.253.24","131.253.25","131.253.26","131.253.27","131.253.35","131.253.36","131.253.38","131.253.46","131.253.47","13.66.139","13.66.144","157.245.205","157.55.10","157.55.103","157.55.106","157.55.107","157.55.12","157.55.13","157.55.154","157.55.2","157.55.21","157.55.22","157.55.23","157.55.34","157.55.39","157.55.50","157.55.7","157.56.0","157.56.1","157.56.2","157.56.3","157.56.71","157.56.92","157.56.93","185.209.30","191.232.136","199.30.17","199.30.18","199.30.19","199.30.20","199.30.21","199.30.22","199.30.23","199.30.24","199.30.25","199.30.26","199.30.27","199.30.28","199.30.29","199.30.30","199.30.31","202.222.14","202.89.235","207.46.12","207.46.126","207.46.13","207.46.199","207.68.155","23.103.64","40.66.1","40.66.4","40.73.148","40.77.160","40.77.161","40.77.162","40.77.163","40.77.164","40.77.165","40.77.166","40.77.167","40.77.168","40.77.169","40.77.170","40.77.171","40.77.172","40.77.173","40.77.174","40.77.175","40.77.176","40.77.177","40.77.178","40.77.179","40.77.180","40.77.181","40.77.182","40.77.183","40.77.184","40.77.185","40.77.186","40.77.187","40.77.188","40.77.189","40.77.190","40.77.191","40.77.192","40.77.193","40.77.194","40.77.195","40.77.208","40.77.209","40.77.210","40.77.211","40.77.212","40.77.213","40.77.214","40.77.215","40.77.216","40.77.217","40.77.218","40.77.219","40.77.220","40.77.221","40.77.222","40.77.223","40.77.248","40.77.250","40.77.251","40.77.252","40.77.253","40.77.254","40.77.255","40.90.11","40.90.144","40.90.145","40.90.146","40.90.147","40.90.148","40.90.149","40.90.150","40.90.151","40.90.152","40.90.153","40.90.154","40.90.155","40.90.156","40.90.157","40.90.158","40.90.159","40.90.8","42.159.176","42.159.48","51.4.84","51.5.84","52.167.144","62.109.1","64.4.22","65.52.109","65.52.110","65.54.164","65.54.247","65.55.107","65.55.146","65.55.189","65.55.208","65.55.209","65.55.210","65.55.211","65.55.212","65.55.213","65.55.214","65.55.215","65.55.216","65.55.217","65.55.218","65.55.219","65.55.25","65.55.54"],"sogou":["106.120.173","106.120.188","106.38.241","111.202.100","111.202.101","111.202.103","123.125.125","123.126.113","123.126.68","123.183.224","173.82.95","218.30.103","220.181.124","220.181.125","36.110.147","43.231.99","49.7.116","49.7.117","49.7.20","49.7.21","58.250.125","61.135.189"],"toutiao":["110.249.201","110.249.202","111.225.148","111.225.149","220.243.135","220.243.136","220.243.188","220.243.189","60.8.123","60.8.151"]}

View File

@@ -154,7 +154,7 @@ tar_gz_name="$dir_name-$(get_sys_ver).tar.gz"
# 下载安装包
cd /opt
echo "开始下载$tar_gz_name..."
download "https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "$tar_gz_name"
download "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "$tar_gz_name"
echo "下载完成"
echo "开始解压..."

View File

@@ -236,7 +236,7 @@ fi
cd /opt
download "https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/$tar_gz_name" "https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/$tar_gz_name" "$tar_gz_name"
download "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/$tar_gz_name" "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/agent/$tar_gz_name" "$tar_gz_name"
rm -rf $dir_name
tar xf $tar_gz_name

View File

@@ -219,7 +219,7 @@ else
fi
cd /opt/
download "https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "$tar_gz_name"
download "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/v5.1.13/master/$tar_gz_name" "$tar_gz_name"
tar xf $tar_gz_name
rm -rf cdnfly
@@ -235,7 +235,7 @@ chmod +x install.sh
./install.sh $@
if [ -f /opt/cdnfly/master/view/upgrade.so ]; then
wget https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
wget https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
supervisorctl -c /opt/cdnfly/master/conf/supervisord.conf reload
source /opt/venv/bin/activate

View File

@@ -213,13 +213,14 @@ else
exit 1
fi
dir_name="cdnfly-master-$VER"
#dir_name="cdnfly-master-$VER"
dir_name="cdnfly-master-v5.1.11"
tar_gz_name="$dir_name-$(get_sys_ver).tar.gz"
echo "安装指定版本$VER"
fi
cd /opt/
download "https://github.com/LoveesYe/cdnflydadao/raw/main/master/$tar_gz_name" "https://github.com/LoveesYe/cdnflydadao/raw/main/master/$tar_gz_name" "$tar_gz_name"
download "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master/$tar_gz_name" "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master/$tar_gz_name" "$tar_gz_name"
tar xf $tar_gz_name
rm -rf cdnfly

Binary file not shown.

View File

@@ -219,7 +219,7 @@ else
fi
cd /opt/
download "https://github.com/LoveesYe/cdnflydadao/raw/main/master/$tar_gz_name" "https://github.com/LoveesYe/cdnflydadao/raw/main/master/$tar_gz_name" "$tar_gz_name"
download "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master/$tar_gz_name" "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master/$tar_gz_name" "$tar_gz_name"
tar xf $tar_gz_name
rm -rf cdnfly

View File

@@ -6,5 +6,5 @@ cdnfly通过改hosts破解授权方法
然后在需要搭建主控的节点上修改hosts将 auth.cdnfly.cn、monitor.cdnfly.cn 这2个域名指向刚才的服务器IP
执行以下命令完成开心:
wget https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
wget https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
supervisorctl -c /opt/cdnfly/master/conf/supervisord.conf reload

View File

@@ -219,7 +219,7 @@ else
fi
cd /opt/
download "https://github.com/LoveesYe/cdnflydadao/raw/main/master/$tar_gz_name" "https://github.com/LoveesYe/cdnflydadao/raw/main/master/$tar_gz_name" "$tar_gz_name"
download "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master/$tar_gz_name" "https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/master/$tar_gz_name" "$tar_gz_name"
tar xf $tar_gz_name
rm -rf cdnfly
@@ -235,7 +235,7 @@ chmod +x install.sh
./install.sh $@
if [ -f /opt/cdnfly/master/view/upgrade.so ]; then
wget https://github.com/LoveesYe/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
wget https://git.yungao-tech.com/shadow/cdnflydadao/raw/main/cdnfly/api.py -O /opt/venv/lib/python2.7/site-packages/requests/api.py
supervisorctl -c /opt/cdnfly/master/conf/supervisord.conf reload
source /opt/venv/bin/activate