Zabbix監(jiān)控平臺高可用架構(gòu)_第1頁
Zabbix監(jiān)控平臺高可用架構(gòu)_第2頁
Zabbix監(jiān)控平臺高可用架構(gòu)_第3頁
Zabbix監(jiān)控平臺高可用架構(gòu)_第4頁
Zabbix監(jiān)控平臺高可用架構(gòu)_第5頁
免費預(yù)覽已結(jié)束,剩余1頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、Zabbix監(jiān)控平臺高可用架構(gòu)Mysql存儲分表技術(shù)zabbix總體設(shè)計原則路1 .讀寫分離2 .冷熱雙備3 .DB存儲兩個副本zabbix平臺軟件版本系統(tǒng) Centos 7.2Mysql 5.6Haproxy 1.5.19Oneproxy v5.8.5搭建zabbix的過程可以參照zabbix單間手冊這里只介紹haproxy做主備,和 oneproxy做讀寫分離。Mysql master-slave (主從)1、修改主服務(wù)器master:#vi /etc/fmysqldlog-bin=mysql-binserver-id=12、修改從服務(wù)器slave:#vi /etc/fmysqldlog-

2、bin=mysql-binserver-id=23、在主服務(wù)器上建立帳戶并授權(quán)slave:mysql>GRANT REPLICATION SLAVE ON *.* to 'slave''%' identified by 'slave4、登錄主服務(wù)器的 mysql ,查詢 master的狀態(tài) mysql>show master status; +| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |+| mysql-bin.000002 |308 |+1 row in set (0.00 se

3、c)5、配置從服務(wù)器Slave :mysql>changemastertomaster_host='ip',master_user='slave',master_password='slave ',master_log_file='mysql-bin.000002',master_log_pos=308;Mysql>start slave;6.查看主從狀態(tài)查看兩個線程是否是 yesSlave_IO_Running: Yes / 此狀態(tài)必須 YESSlave_SQL_Running: Yes / 止匕狀態(tài)必須 YESOn

4、eproxy讀寫分離tar zxvf oneproxy-rhel5-linux64-v5.8.5-ga.tar.gzmv oneproxy /usr/local/主庫備庫都需要建立用戶連接用戶:$>grant all privileges on zabbix.* to 'zabbix''%' identified by 'zabbix'酉已置oneproxyoneproxykeepalive = 1log-file= /var/log/oneproxy.logpid-file = /var/log/oneproxy.pid lck-file

5、 = /var/log/oneproxy.lckadmin-address= 0.0.0.0:4041proxy-address= 0.0.0.0:3307proxy-master-addresses =ipserver1proxy-user-listproxy-slave-addresses =ipserver1=zabbix/EA533C0350026E84DC33CF61D1BFE29A1E9F66CDzabbixproxy-group-security proxy-group-policy=server1:0=server1:read-slave注意proxy-user-list項中的

6、密碼,是按照如下方法生成的,直接填寫數(shù)據(jù)庫密碼zabbix是不行的:/usr/local/oneproxy/bin/oneproxy -defaults-file=/usr/local/oneproxy/conf/proxy.conf $>mysql -uadmin -pOneProxy -h127.0.0.1 -port=4041 Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 1Server version: 5.6.27 OneProxy-Admin-5.8.0 (

7、OneXSoft)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or 'h' for help. Type 'c' to clear the curr

8、ent input statement.mysql> passwd zabbix; +| TEXT | PASSWORD|+| zabbix | EA533C0350026E84DC33CF61D1BFE29A1E9F66CD | +1 row in set (0.00 sec)mysql>#啟動oneproxy ,并測試是否滿足需要#啟動,看日志正常,正常連接zabbix主庫、從庫Zabbix配置文件:修改配置文件:vim /etc/zabbix/zabbix_server.conf DBPort=3307 LogSlowQueries=3000 StartProxyPoller

9、s=10 DBHost=oneproxy 的 ip DBName=zabbix DBUser=zabbix DBPassword=zabbixHAPROXY寸 zabbix server坐主備:可以yum安裝,也可以下載包:配置文件 haproxyhaproxy: globallog 127.0.0.1local。log 127.0.0.1locall notice#log loghostlocal0 infomaxconn 4096 chroot /usr/share/haproxy uid 99 gid 99 daemondefaultslogglobalmode tcp retries

10、3maxconn 2000contimeout5000clitimeout 50000srvtimeout50000listen zabbix_proxybind 0.0.0.0:10051 #haproxy 監(jiān)聽 8080 端口mode tcp#tcp轉(zhuǎn)發(fā)模式cookie SRV insert indirect nocache #會話保持,避免 cookie 失效,登出balance roundrobin#采用輪詢模式#此處 weight#此處 weightserver db1 192.168.136.129:10051 check inter 2000 rise 2 fall 5 weig

11、ht 100 權(quán)重可以根據(jù)需求更改server db2 192.168.136.130:10051 check inter 2000 rise 2 fall 5 weight 1 權(quán)重可以根據(jù)需求更改listen zabbix_webbind 0.0.0.0:8080 #haproxy 監(jiān)聽 8080 端口mode tcp#tcp轉(zhuǎn)發(fā)模式#采用輪詢模式cookie SRV insert indirect nocache #會話保持,避免 cookie 失效,登出balance roundrobinserver db1 192.168.136.129:80 check inter 2000 rise 2 fall 5 weight 100#此處 weight 權(quán)重可以根據(jù)需求更改server db2 192.168.136.

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論