中文字幕理论片,69视频免费在线观看,亚洲成人app,国产1级毛片,刘涛最大尺度戏视频,欧美亚洲美女视频,2021韩国美女仙女屋vip视频

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開(kāi)通VIP
docker部署zabbix ansile批量部署自動(dòng)發(fā)現(xiàn)

1. docker部署zabbix

1.1 上傳并解壓zabbix鏡像包

[root@localhost ~]# tar xzf zabbix_image.tar.gz [root@localhost ~]# cd zabbix/[root@localhost zabbix]# lszabbix-agent.tar  zabbix-server.tar  zabbix-web.tar

1.2 導(dǎo)入zabbix鏡像

[root@localhost zabbix]# docker load -i zabbix-agent.tar [root@localhost zabbix]# docker load -i zabbix-server.tar [root@localhost zabbix]# docker load -i zabbix-web.tar 

1.3 查看導(dǎo)入的zabbix鏡像

[root@localhost ~]# docker images |grep zabbix zabbix/zabbix-web-nginx-mysql   latest              116855eaede2        2 weeks ago         164MBzabbix/zabbix-server-mysql      latest              8ca9fbc31571        2 weeks ago         67.7MBzabbix/zabbix-agent             latest              9084e5d9908f        2 weeks ago         16.4MB

1.4 mysql鏡像

上傳導(dǎo)入

[root@localhost ~]# tar xzf mysql5.7_utf8.tar.gz [root@localhost ~]# docker load -i mysql5.7_utf8.tar

1.5 編寫compose文件

[root@localhost zabbix]# vim docker-compose.yml [root@localhost zabbix]# cat docker-compose.yml version: "3"services:  mysql:    image: mysql:5.7    environment:      MYSQL_ROOT_PASSWORD: 123      MYSQL_DATABASE: zabbix      MYSQL_USER: zabbix      MYSQL_PASSWORD: 123  zabbix-server:    image: zabbix/zabbix-server-mysql    ports:      - "10051:10051"    environment:      DB_SERVER_HOST: mysql      MYSQL_DATABASE: zabbix      MYSQL_USER: zabbix      MYSQL_PASSWORD: 123    depends_on:       - mysql  zabbix-web:    image: zabbix/zabbix-web-nginx-mysql    ports:      - "80:8080"    environment:      DB_SERVER_HOST: mysql      MYSQL_DATABASE: zabbix      MYSQL_USER: zabbix      MYSQL_PASSWORD: 123      PHP_TZ: Asia/Shanghai      ZBX_SERVER_HOST: zabbix-server    depends_on:       - zabbix-server      - mysql

1.6 基于compose文件運(yùn)行容器

1.6.1 運(yùn)行

[root@localhost zabbix]# docker-compose up -dCreating network "zabbix_default" with the default driverCreating zabbix_mysql_1 ... doneCreating zabbix_zabbix-server_1 ... doneCreating zabbix_zabbix-web_1    ... done

1.6.2 查看

[root@localhost zabbix]# docker-compose ps         Name                       Command               State               Ports             ------------------------------------------------------------------------------------------------zabbix_mysql_1           docker-entrypoint.sh mysqld      Up      3306/tcp, 33060/tcp           zabbix_zabbix-server_1   /sbin/tini -- /usr/bin/doc ...   Up      0.0.0.0:10051->10051/tcp      zabbix_zabbix-web_1      docker-entrypoint.sh             Up      0.0.0.0:80->8080/tcp, 8443/tcp[root@localhost zabbix]# 

1.7 瀏覽器驗(yàn)證

1.7.1 登錄

用戶名:Admin
密碼: zabbix

1.7.2 成功訪問(wèn)zabbix主頁(yè)

1.7.3 設(shè)置中文

1.7.4 配置自動(dòng)發(fā)現(xiàn)

1.7.4.1 添加自動(dòng)發(fā)現(xiàn)規(guī)則

1.7.4.2 定義發(fā)現(xiàn)規(guī)則

1.7.4.3 配置動(dòng)作



1.7.4.4 查看自動(dòng)發(fā)現(xiàn)

2.ansible批量部署

2.1 安裝ansible

[root@localhost ~]# yum search ansible[root@localhost ~]# yum -y install centos-release-ansible-29[root@localhost ~]# yum -y insatll ansible

2.2 配置免密登錄

2.2.1 生成秘鑰對(duì)

[root@localhost ~]# ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'.Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:SHA256:4VR DrKshFAcKdb3Ax/ d46b4wQZsMGhCp6EKXbqGjA root@localhost.localdomainThe key's randomart image is: ---[RSA 2048]---- |   ooo . ..      || oo.  o.o*       || o o ..==.  .    ||ooo  o  =  *     ||E.o o . Soo .    ||o.   . .  ... .  ||..    .    ..    ||..         .o..  ||.          . o   | ----[SHA256]----- 

2.2.2 復(fù)制 公鑰到遠(yuǎn)程主機(jī)

[root@localhost ~]# ssh-copy-id root@192.168.153.184[root@localhost ~]# ssh-copy-id root@192.168.153.185

2.3 配置主機(jī)清單

[root@localhost ~]# vim /etc/ansible/hosts [webservers]192.168.153.184192.168.153.185

2.4 驗(yàn)證主機(jī)的連通性

[root@localhost ~]# ansible all -m ping192.168.153.185 | SUCCESS => {    "ansible_facts": {        "discovered_interpreter_python": "/usr/bin/python"    },     "changed": false,     "ping": "pong"}192.168.153.184 | SUCCESS => {    "ansible_facts": {        "discovered_interpreter_python": "/usr/bin/python"    },     "changed": false,     "ping": "pong"}[root@localhost ~]# 

2.5 編寫playbook文件

[root@localhost agent]# vim agent.yml ---- hosts: webservers  tasks:    - name: "推送zabbix源"      copy: src=zabbix_Aliyun.repo  dest=/etc/yum.repos.d/    - name: "安裝zabbix-agent"      yum: name=zabbix-agent  state=latest    - name: "修改agent配置文件"      script: agent.sh    - name: "啟動(dòng)agent"      systemd: name=zabbix-agent state=started enabled=yes    - name: "關(guān)閉防火墻"      systemd: name=firewalld state=stopped    - name: "關(guān)閉selinux"      shell: "setenforce 0"[root@localhost agent]# 

2.6 依據(jù)playbook文件執(zhí)行批量部署

[root@localhost agent]# ansible-playbook agent.yml PLAY [webservers] ***************************************************************************************************************TASK [Gathering Facts] **********************************************************************************************************ok: [192.168.153.185]ok: [192.168.153.184]TASK [推送zabbix源] ****************************************************************************************************************changed: [192.168.153.185]changed: [192.168.153.184]TASK [安裝zabbix-agent] ***********************************************************************************************************changed: [192.168.153.184]changed: [192.168.153.185]TASK [修改agent配置文件] **************************************************************************************************************changed: [192.168.153.184]changed: [192.168.153.185]TASK [啟動(dòng)agent] ******************************************************************************************************************changed: [192.168.153.185]changed: [192.168.153.184]TASK [關(guān)閉防火墻] ********************************************************************************************************************changed: [192.168.153.184]changed: [192.168.153.185]TASK [關(guān)閉selinux] ****************************************************************************************************************changed: [192.168.153.185]changed: [192.168.153.184]PLAY RECAP **********************************************************************************************************************192.168.153.184            : ok=7    changed=6    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   192.168.153.185            : ok=7    changed=6    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

2.7 連接zabbix-server測(cè)試

[root@localhost agent]# cd ../zabbix/[root@localhost zabbix]# docker-compose exec zabbix-server bashbash-5.0$ zabbix_get -s 192.168.153.184 -k agent.ping1bash-5.0$ zabbix_get -s 192.168.153.185 -k agent.ping1bash-5.0$ 

返回值為1則配置成功

來(lái)源:https://www.icode9.com/content-4-792801.html
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
zabbix--5.0.2部署手冊(cè)
dom4j讀取xml文件的一個(gè)小例子
zabbix常見(jiàn)問(wèn)題處理整理
CentOS6.9部署zabbix3.0監(jiān)控系統(tǒng)
Zabbix3.4使用詳解
# 【Zabbix】Zabbix 分布式監(jiān)控
更多類似文章 >>
生活服務(wù)
熱點(diǎn)新聞
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服