docker zabbix 安装连接非 docker mysql

sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

sudo yum makecache fast

sudo yum -y install docker-ce

sudo service docker start

sudo docker run hello-world

docker run --name zabbix-java-gateway -t -d zabbix/zabbix-java-gateway:centos-3.0.14

docker run --name zabbix-server-mysql -t -e DB_SERVER_HOST="10.253.114.xxx" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="passok" -e MYSQL_ROOT_PASSWORD="passok" -e DB_SERVER_PORT="3309" -e ZBX_JAVAGATEWAY="zabbix-java-gateway" --link zabbix-java-gateway:zabbix-java-gateway  -p 10051:10051 -d zabbix/zabbix-server-mysql:centos-3.0.14

docker run --name zabbix-web-nginx-mysql -t -e DB_SERVER_HOST="10.253.114.xxx" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="passok" -e MYSQL_ROOT_PASSWORD="passok" --link zabbix-server-mysql:zabbix-server -e DB_SERVER_PORT="3309" -p 81:80 -d zabbix/zabbix-web-nginx-mysql:centos-3.0.14

docker run --name some-zabbix-agent -p 10050:10050 -e ZBX_HOSTNAME="zabbix-server" -e ZBX_SERVER_HOST="192.168.100.39" -e ZBX_SERVER_PORT=10051 -d zabbix/zabbix-agent:centos-3.0.14

进入 docker 容器命令:sudo docker exec -it 775c7c9ee1e1 /bin/bash 

你可能感兴趣的:(docker,环境搭建)