技术流ken

运维拯救世界

docker部署安装zabbix–技术流ken

 安装docker

 

安装docker需要配置网络yum源,centos7自带的版本太低了

 

第一步:下载阿里云的docker安装包

在yum仓库的目录之下

[root@localhost yum.repos.d]# wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

 

还需要使用到extra和epel源

[extra]
name=centos extra
enabled=1
gpgcheck=0
baseurl=https://mirrors.aliyun.com/centos/7/extras/x86_64/
[epel]
name=epel
enabled=1
gpgcheck=0
baseurl=https://mirrors.aliyun.com/epel/7Server/x86_64/

 

第二步:使用yum即可进行安装

docker-ce是社区版,是免费的

docker-ee是企业版,是收费的

这里我们下载社区版的

[root@ken ~]# yum install docker-ce -y

 

第三步:添加加速器地址

把刚才注册得到的镜像加速地址如下步骤填写进去

[root@ken ~]# mkdir /etc/docker
[root@ken ~]# cat /etc/docker/daemon.json
{
  "registry-mirrors": ["https://XXX.mirror.aliyuncs.com"]
}

 

第四步:重启docker

[root@ken ~]# systemctl restart docker

 

安装zabbix

 

zabbix使用docker容器安装的官网地址(版本4.2)

https://www.zabbix.com/documentation/4.2/manual/installation/containers

 

第一步:启动数据库

docker run --name mysql-server -t \
      -e MYSQL_DATABASE="zabbix" \
      -e MYSQL_USER="zabbix" \
      -e MYSQL_PASSWORD="zabbix_pwd" \
      -e MYSQL_ROOT_PASSWORD="root_pwd" \
      -d mysql:5.7 \
      --character-set-server=utf8 --collation-server=utf8_bin

 

第二步:启动 Zabbix server 实例,并将其关联到已创建的 MySQL server 实例。

docker run --name zabbix-server-mysql -t \
      -e DB_SERVER_HOST="mysql-server" \
      -e MYSQL_DATABASE="zabbix" \
      -e MYSQL_USER="zabbix" \
      -e MYSQL_PASSWORD="zabbix_pwd" \
      -e MYSQL_ROOT_PASSWORD="root_pwd" \
      --link mysql-server:mysql \
      -p 10051:10051 \
      -d zabbix/zabbix-server-mysql:latest

 

第三步:启动 Zabbix Web 界面,并将其关联到已创建的 MySQL server 和 Zabbix server 实例。

docker run --name zabbix-web-nginx-mysql -t \
      -e DB_SERVER_HOST="mysql-server" \
      -e MYSQL_DATABASE="zabbix" \
      -e MYSQL_USER="zabbix" \
      -e MYSQL_PASSWORD="zabbix_pwd" \
      -e MYSQL_ROOT_PASSWORD="root_pwd" \
      --link mysql-server:mysql \
      --link zabbix-server-mysql:zabbix-server \
      -p 81:80 \
      -d zabbix/zabbix-web-nginx-mysql:latest

 

查看已经启动的端口

 

[root@ken ~]# ss -tnl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:9000 *:*
LISTEN 0 50 *:3306 *:*
LISTEN 0 50 *:139 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 50 *:445 *:*
LISTEN 0 50 :::139 :::*
LISTEN 0 128 :::80 :::*
LISTEN 0 128 :::81 :::*
LISTEN 0 50 :::445 :::*
LISTEN 0 128 :::10051 :::*

 

浏览器访问

 

 

 

部署zabbix-agent端

 

docker run –name zabbix-agent -p 10050:10050 -e ZBX_HOSTNAME=”zabbix_agent” -e ZBX_SERVER_HOST=”127.0.0.1″ -e ZBX_SERVER_PORT=10051 -d zabbix/zabbix-agent

 

主机查看

 

注意这里的IP地址改为IP地址不能使用127.0.0.1

10 thoughts on “docker部署安装zabbix–技术流ken

  1. A lot of thanks for every one of your efforts on this site. Betty take interest in carrying out investigations and it’s obvious why. A lot of people notice all concerning the dynamic medium you provide very useful tactics via this web blog and as well increase contribution from others on that idea so our own simple princess has always been studying so much. Enjoy the rest of the year. You’re the one performing a great job.

  2. My wife and i ended up being now delighted Michael could finish up his preliminary research using the ideas he discovered using your site. It’s not at all simplistic just to happen to be giving freely methods which many people have been selling. And now we remember we’ve got you to be grateful to for this. All the explanations you have made, the straightforward site navigation, the friendships you assist to promote – it is mostly sensational, and it’s leading our son in addition to our family believe that that subject matter is exciting, and that’s wonderfully serious. Thanks for all the pieces!

  3. I truly wanted to develop a simple message so as to express gratitude to you for the awesome tips you are giving on this website. My long internet search has now been rewarded with wonderful facts and strategies to go over with my colleagues. I would say that many of us website visitors are very blessed to live in a remarkable community with many awesome people with good ideas. I feel really blessed to have seen your entire webpage and look forward to many more fabulous minutes reading here. Thank you once more for all the details.

  4. I intended to post you that very small note in order to give thanks as before for all the unique advice you’ve shared at this time. It’s simply remarkably generous with you to allow extensively what exactly many of us could possibly have supplied for an e book to end up making some bucks for themselves, chiefly considering the fact that you might have done it in the event you desired. Those secrets as well acted like the easy way to comprehend other individuals have the same passion much like my personal own to understand significantly more pertaining to this problem. I am sure there are lots of more enjoyable opportunities up front for individuals that read carefully your site.

  5. I just wanted to jot down a small message in order to say thanks to you for those precious pointers you are showing on this site. My time consuming internet search has at the end of the day been recognized with beneficial facts to go over with my family and friends. I would say that most of us site visitors are really endowed to live in a notable website with so many wonderful people with very beneficial strategies. I feel quite privileged to have seen your web page and look forward to so many more exciting times reading here. Thanks once again for all the details.

  6. I wish to get across my admiration for your kindness giving support to men and women who should have assistance with this particular concern. Your real dedication to getting the message all over had been remarkably advantageous and has helped folks like me to reach their desired goals. Your helpful tutorial entails a whole lot to me and far more to my peers. Best wishes; from everyone of us.

  7. My husband and i got quite relieved Chris could finish up his inquiry through the entire precious recommendations he grabbed through your blog. It’s not at all simplistic just to find yourself giving away guidelines which often the rest have been making money from. Therefore we fully understand we have got the writer to thank for this. All of the explanations you made, the simple site menu, the relationships you will make it easier to engender – it’s all powerful, and it is helping our son in addition to us reason why that subject is pleasurable, and that’s pretty essential. Thanks for the whole lot!

  8. I am writing to make you understand of the cool discovery my friend’s child obtained using yuor web blog. She noticed a good number of things, most notably what it’s like to have a very effective teaching mindset to let men and women clearly completely grasp various specialized subject areas. You really surpassed visitors’ expected results. Thank you for coming up with those precious, trusted, edifying and fun thoughts on this topic to Sandra.

  9. I needed to send you a little remark to be able to thank you very much the moment again for your pleasing techniques you’ve shared here. It is quite unbelievably generous with you giving freely exactly what a few individuals could possibly have made available as an e book in making some cash on their own, precisely now that you could possibly have done it if you wanted. The guidelines as well worked as the good way to understand that other people online have the identical eagerness much like my own to figure out a whole lot more regarding this matter. I am sure there are numerous more pleasurable occasions in the future for those who check out your website.

发表评论

电子邮件地址不会被公开。