全部博文(150)
分类: 云计算
2017-04-01 16:58:21
docker pull 官方zabbix image
docker pull zabbix/zabbix-server-mysql ## server+mysql docker pull zabbix/zabbix-java-gateway ## java jmx监控网关 docker pull zabbix/zabbix-web-nginx-mysql ## zabbix webui+mysq支持
push到私有仓库
docker tag docker.io/zabbix/zabbix-java-gateway reg.goluk.cn/base/zabbix-java-gateway docker push reg.goluk.cn/base/zabbix-java-gateway docker tag zabbix/zabbix-server-mysql reg.goluk.cn/base/zabbix-server-mysql docker push reg.goluk.cn/base/zabbix-server-mysql docker tag docker.io/zabbix/zabbix-web-nginx-mysql reg.goluk.cn/base/zabbix-web-nginx-mysql:latest docker push reg.goluk.cn/base/zabbix-web-nginx-mysql:latest
docker pull mysql的官方映像并推送到私有仓库
略
创建zabbix目录
mkdir /mnt/cephfs/app/zabbix
在zabbix目录内继续创建如下目录alertscripts certs enc externalscripts keys mibs modules mysql nginx snmptraps ssh_keys ssl_ca
[root@swarm3 zabbix]# cat zabbix-server.yml version: '3' services: web-ui: image: reg.goluk.cn/base/zabbix-web-nginx-mysql environment: - DB_SERVER_HOST=mysql - ZBX_SERVER_HOST=server - MYSQL_USER=root - MYSQL_PASSWORD=goluk - MYSQL_DATABASE=zabbix - TZ=Asia/Shanghai volumes: - /mnt/cephfs/app/zabbix/nginx:/etc/ssl/nginx ports: - 4088:80 depends_on: - server - mysql deploy: replicas: 1 restart_policy: condition: on-failure server: image: reg.goluk.cn/base/zabbix-server-mysql environment: - MYSQL_ROOT_PASSWORD=goluk - DB_SERVER_HOST=mysql - DB_SERVER_PORT=3306 - MYSQL_USER=root - MYSQL_PASSWORD=goluk - MYSQL_DATABASE=zabbix - ZBX_JAVAGATEWAY_ENABLE=true - ZBX_JAVAGATEWAY=java-gateway volumes: - /mnt/cephfs/app/zabbix/alertscripts/:/usr/lib/zabbix/alertscripts - /mnt/cephfs/app/zabbix/externalscripts:/usr/lib/zabbix/externalscripts - /mnt/cephfs/app/zabbix/enc:/var/lib/zabbix/enc - /mnt/cephfs/app/zabbix/modules:/var/lib/zabbix/modules - /mnt/cephfs/app/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys - /mnt/cephfs/app/zabbix/certs:/var/lib/zabbix/ssl/certs - /mnt/cephfs/app/zabbix/keys:/var/lib/zabbix/ssl/keys - /mnt/cephfs/app/zabbix/ssl_ca:/var/lib/zabbix/ssl/ssl_ca - /mnt/cephfs/app/zabbix/snmptraps:/var/lib/zabbix/snmptraps - /mnt/cephfs/app/zabbix/mibs:/var/lib/zabbix/mibs ports: - 10051:10051 depends_on: - mysql deploy: resources: limits: cpus: '0.1' replicas: 1 restart_policy: condition: on-failure java-gateway: image: reg.goluk.cn/base/zabbix-java-gateway environment: - ZABBIX_SERVER=server ports: - 10052:10052 depends_on: - server - mysql deploy: replicas: 1 restart_policy: condition: on-failure mysql: image: reg.goluk.cn/base/mysql:latest environment: - MYSQL_ROOT_PASSWORD=goluk - MYSQL_DATABASE=zabbix - MYSQL_USER=root - MYSQL_PASSWORD=goluk volumes: - /mnt/cephfs/app/zabbix/mysql:/var/lib/mysql deploy: replicas: 1 restart_policy: condition: on-failure
docker stack deploy zabbix -c zabbix-server.yml
[root@swarm2 zabbix]# docker stack ps zabbix ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS k8cvfwpxcol2 zabbix_mysql.1 reg.goluk.cn/base/mysql:latest swarm3 Running Running 4 days ago gzttcxhjptu4 zabbix_web-ui.1 reg.goluk.cn/base/zabbix-web-nginx-mysql:latest swarm1 Running Running 12 days ago ujx4lu5yv3y3 zabbix_java-gateway.1 reg.goluk.cn/base/zabbix-java-gateway:latest swarm1 Running Running 12 days ago 7rb8xsf1op3s zabbix_server.1 reg.goluk.cn/base/zabbix-server-mysql:latest swarm1 Running Running 12 days ago