当前位置:网站首页>zabbix自动化监控脚本
zabbix自动化监控脚本
2022-08-02 12:11:00 【沐辰晨兮】
#!/bin/bash
#docker安装
touch /etc/yum.repos.d/aliyun.docker.repo
cat > /etc/yum.repos.d/aliyun.docker.repo
[docker]
name=docker
baseurl=docker-ce-linux-centos-7-x86_64-stable安装包下载_开源镜像站-阿里云
enabled=1
gpgcheck=0
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
EOF
yum -y install docker-ce
docker -v
mkdir -p /etc/docker
tee /etc/docker/daemon.json
{
"registry-mirrors": ["https://2teyhdx3.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
systemctl enable docker
docker info
#安全配置
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
#docker私有仓库搭建
docker pull registry:2
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p
mkdir -p /opt/data/registry
yum -y install net-tools
docker run -itd -p 5000:5000 --restart always -v /opt/data/registry/:/var/lib/registry --name registry registry:2
curl 172.17.10.32:5000/v2/_catalog
sed -i '13c ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry 172.20.10.32:5000' /usr/lib/systemd/system/docker.service
#下载镜像
docker pull nginx
docker pull busybox
docker pull httpd
docker pull centos:7
#镜像改名
docker tag centos:7 172.20.10.32:5000/centos
docker rmi centos:7
docker tag nginx:latest 172.20.10.31:5000/nginx
docker tag httpd:latest 172.20.10.31:5000/httpd
docker tag busybox:latest 172.20.10.31:5000/busybox
边栏推荐
猜你喜欢
随机推荐
npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
MyCat2 introduction and installation and basic use
NVIDIA NeMo Metrics 轻量性能采集系统
看我如何用多线程,帮助运营小姐姐解决数据校对系统变慢!
Create an application operation process using the kubesphere GUI
simulink PID auto-tuning
记录代码
LeetCode笔记:Weekly Contest 304
企业级数据治理工作怎么开展?Datahub这样做
商业流程服务BPass你真的了解吗?
Create your own app applet ecosystem with applet containers
List排序 ,取最大值最小值
前男友买辣椒水威胁要抢女儿,女方能否申请人身安全保护令?
ABAP-OOAVL模板程序
如何在 UE4 中制作一扇自动开启的大门
QListView的使用
Golang map数组按字段分类
Process finished with exit code 1
服务器间传输文件
AQS-AbstractQueuedSynchronizer