Zabbixãå·¥æ¥èŠæš¡ã§äœ¿çšããããŸãã¯äœ¿çšããã€ããã®äººã¯ãZabbixãæçµçã«çªæ¯ããã³çªæ¯ããåã«ã©ãã ãã®å®éã®ããŒã¿ãããã€ãžã§ã¹ããã§ããããšãã質åãåžžã«å¿é
ããŠããŸãã ç§ã®æè¿ã®ä»äºã®äžéšã¯ãã®åé¡ãæ±ã£ãŠããŸãã å®éã32,000以äžã®ããŒããæã€å·šå€§ãªãããã¯ãŒã¯ããããZabbixã«ãã£ãŠå°æ¥çã«å®å
šã«ç£èŠãããå¯èœæ§ããããŸãã ãã©ãŒã©ã ã§ã¯ãZabbixã倧èŠæš¡ã«åäœããããã«æé©åããæ¹æ³ã«ã€ããŠé·ãéè°è«ããŠããŸããããæ®å¿µãªããããŸã å®å
šãªè§£æ±ºçãèŠã€ããããšãã§ããŸããã§ããã
ãã®èšäºã§ã¯ã倧éã®ããŒã¿ãåŠçã§ããã·ã¹ãã ã®ã»ããã¢ããæ¹æ³ã瀺ããããšæããŸãã
ããªãããããäœã§ããããç解ããããã«ãããã«ã·ã¹ãã ã®çµ±èšãå«ãåçããããŸãïŒ
æåã«ããå¿
èŠãªãµãŒããŒããã©ãŒãã³ã¹ã1ç§ãããã®æ°ããå€ïŒNVPSïŒãé
ç®ãå®éã«æå³ãããã®ã«ã€ããŠèª¬æããŸãã ãã®ããã1ç§éã«ã·ã¹ãã ã«å
¥åãããå®éã®ããŒã¿ã®éãšã¯äžèŽããŸããããããŒãªã³ã°ééãèæ
®ããããã¹ãŠã®ã¢ã¯ãã£ããªããŒã¿èŠçŽ ã®åçŽãªæ°åŠçèšç®ã§ãã ãããŠãZabbix-trapperã¯èšç®ã«é¢äžããŠããªãããšãããããŸããã ç§ãã¡ã®ãããã¯ãŒã¯ã§ã¯ããã©ãããŒãéåžžã«ç©æ¥µçã«äœ¿çšãããŠãããããåé¡ã®ç°å¢ã«å®éã®NVPSãããã€ããããèŠãŠã¿ãŸãããã
ã°ã©ãã«ç€ºãããã«ãZabbixã¯å¹³åããŠ1ç§ãããçŽ
9,260ã®ãªã¯ãšã¹ããåŠçããŸãã ããã«
ããããã¯ãŒã¯äžã«æ倧
15,000 NVPSã®çãããŒã¹ããããããµãŒããŒã¯åé¡ãªã察åŠããŸããã æ£çŽãªãšãããããã¯çŽ æŽãããã§ãïŒ
建ç¯
æåã«ç解ããããšã¯ãç£èŠã·ã¹ãã ã®ã¢ãŒããã¯ãã£ã§ãã Zabbixã¯ãã©ãŒã«ããã¬ã©ã³ãã§ããã¹ãã§ããïŒ 1æéãŸãã¯2æéã®ããŠã³ã¿ã€ã ãåé¡ã«ãªããŸããïŒ ããŒã¿ããŒã¹ãã¯ã©ãã·ã¥ããå Žåãã©ã®ãããªçµæãåŸ
ã£ãŠããŸããïŒ ããŒã¹ã«ã¯ã©ã®ãã©ã€ããå¿
èŠã§ãã©ã®RAIDãæ§æããå¿
èŠããããŸããïŒ ZabbixãµãŒããŒãšZabbixãããã·éã®åž¯åå¹
ã¯ã©ã®ãããã§ããïŒ æ倧é
延ãšã¯äœã§ããïŒ ããŒã¿ãåéããæ¹æ³ã¯ïŒ ãããã¯ãŒã¯ã«åãåãããïŒããã·ãã¢ãã¿ãªã³ã°ïŒãããããã¯ãŒã¯ããªãã¹ã³ããïŒã¢ã¯ãã£ãã¢ãã¿ãªã³ã°ïŒãïŒ
å質åã詳ããèŠãŠã¿ãŸãããã æ£çŽã«èšããšãã·ã¹ãã ãå±éãããšãã«ãããã¯ãŒã¯ã®åé¡ãèæ
®ããªãã£ããããå°æ¥çã«èšºæãå°é£ãªåé¡ãçºçããŸããã ãã®ãããããã«ç£èŠã·ã¹ãã ã¢ãŒããã¯ãã£ã®äžè¬çãªæŠèŠã瀺ããŸãã
é
é©åãªéãèŠã€ããããšã¯ç°¡åãªããã»ã¹ã§ã¯ãããŸããã ZabbixããŒã¿ããŒã¹ã¯å€§éã®I / Oãã£ã¹ã¯ã·ã¹ãã ãå¿
èŠãšãããããããã§è¡ã£ãäž»ãªããšã¯SANã䜿çšããŠããŒã¿ãä¿åããããšã§ããã ç°¡åã«èšãã°ãããŒã¿ããŒã¹ãµãŒããŒäžã®ãã£ã¹ã¯ãé«éã§ããã»ã©ãZabbixãåŠçã§ããããŒã¿ãå¢ããŸãã
ãã¡ãããCPUãšã¡ã¢ãªãMySQLã«ãšã£ãŠéåžžã«éèŠã§ãã 倧éã®RAMã«ãããZabbixã¯é »ç¹ã«èªã¿åãããããŒã¿ãã¡ã¢ãªã«ä¿åã§ããŸããããã¯åœç¶ãã·ã¹ãã ã®é床ã«è²¢ç®ããŸãã åœåã64GBã®ããŒã¿ããŒã¹ãµãŒããŒãèšç»ããŠããŸãããããããŸã§ã®ãšãããã¹ãŠã32GBã§æ£åžžã«æ©èœããŠããŸããã
zabbix_serverèªäœãã€ã³ã¹ããŒã«ãããŠãããµãŒããŒããååã«é«éãªCPUãåããŠããå¿
èŠããããŸããäœåäžãã®ããªã¬ãŒãèœã¡çããŠåŠçããå¿
èŠãããããã§ãã ãŸããZabbixãµãŒããŒèªäœã«ã¯å€ãã®ããã»ã¹ããªãããã12GBã§ååãªã¡ã¢ãªã«ãªããŸãïŒã»ãšãã©ãã¹ãŠã®ç£èŠã¯ãããã·çµç±ã§ãïŒã
DBMSãzabbix_serverãšã¯ç°ãªããZabbixãããã·ã¯æ·±å»ãªããŒããŠã§ã¢ãå¿
èŠãšããªããããä»®æ³ãã·ã³ã䜿çšããŸããã åºæ¬çã«ãã¢ã¯ãã£ããªããŒã¿èŠçŽ ãåéãããããããããã·èªäœã¯ããŒã¿åéãã€ã³ããšããŠæ©èœããŸããããããã·èªäœã¯å®éã«ã¯äœã調æ»ããŸããã
ç§ã®ã·ã¹ãã ã§äœ¿çšããèŠçŽè¡šã¯æ¬¡ã®ãšããã§ãã
ZabbixãµãŒã㌠| Zabbix DB | Zabbixãããã· | ãµã³ |
---|
HP ProLiant BL460c Gen8 12x Intel Xeon E5-2630 16GBã¡ã¢ãª 128GBãã£ã¹ã¯ CentOS 6.2 x64 Zabbix 2.0.6
| HP ProLiant BL460c Gen8 12x Intel Xeon E5-2630 32GBã®ã¡ã¢ãª 2TB SAN-backedã¹ãã¬ãŒãžïŒ4Gbps FCïŒ CentOS 6.2 x64 MySQL 5.6.12
| VMwareä»®æ³ãã·ã³ 4x vCPU 8GBã¡ã¢ãª 50GBã®ãã£ã¹ã¯ CentOS 6.2 x64 Zabbix 2.0.6 MySQL 5.5.18
| Hitachi Unified Storage VM 2TB LUN x 2 éå±€åã¹ãã¬ãŒãžïŒ2TB SSDãæèŒïŒ
|
ãã©ãŒã«ããã¬ã©ã³ã¹ZabbixãµãŒããŒ
äžã§è¿°ã¹ãã¢ãŒããã¯ãã£ã®åé¡ã«æ»ããŸãããã 倧èŠæš¡ãªãããã¯ãŒã¯ã§ã¯ãæãããªçç±ãããç£èŠãæ©èœããªãããšãå®éã®çœå®³ã§ãã ãã ããZabbixã¢ãŒããã¯ãã£ã§ã¯ãzabbixãµãŒããŒããã»ã¹ã®è€æ°ã®ã€ã³ã¹ã¿ã³ã¹ãå®è¡ã§ããŸããã
ããã§ãPacemakerãšCMANã§Linux HAã䜿çšããããšã«ããŸããã åºæ¬çãªã»ããã¢ããã«ã€ããŠã¯ã
RedHat 6.4ããã¥ã¢ã«ãã芧ãã ããã æ®å¿µãªãããåœä»€ã¯äœ¿çšããæç¹ããå€æŽãããŸããããæçµçãªçµæã¯åãã«ãªãã¯ãã§ãã åºæ¬çãªã»ããã¢ããã®åŸãããã«æ§æããŸããïŒ
- å
±æIPã¢ãã¬ã¹
- feyloverã®å ŽåãIPã¢ãã¬ã¹ã¯ãµãŒããŒã«éããããµãŒããŒãã¢ã¯ãã£ãã«ãªããŸã
- å
±æIPã¢ãã¬ã¹ã¯åžžã«ã¢ã¯ãã£ããªZabbixãµãŒããŒã«ãã£ãŠäœ¿çšãããããã次ã®3ã€ã®å©ç¹ããããŸãã
- ã©ã®ãµãŒããŒãã¢ã¯ãã£ãã§ããããåžžã«ç°¡åã«èŠã€ããããšãã§ããŸã
- ZabbixãµãŒããŒããã®ãã¹ãŠã®æ¥ç¶ã¯åžžã«åãIPããã§ãïŒzabbix_server.confã§SourceIP =ãã©ã¡ãŒã¿ãŒãèšå®ããåŸïŒ
- ãã¹ãŠã®Zabbixãããã·ããã³ZabbixãšãŒãžã§ã³ãã¯ããµãŒããŒãšããŠå
±éã®IPã䜿çšããã ãã§ã
- Zabbix_serverããã»ã¹
- feyloverã®å Žåãzabbix_serverã¯å€ããµãŒããŒã§åæ¢ãããæ°ãããµãŒããŒã§éå§ãããŸã
- cronãžã§ãã®ã·ã³ããªãã¯ãªã³ã¯
- Simlinkã¯ãã¿ã¹ã¯ãååšãããã£ã¬ã¯ããªãæããŸããããã¯ãã¢ã¯ãã£ããªZabbixãµãŒããŒã§ã®ã¿å®è¡ããå¿
èŠããããŸãã Crontabã¯ããã®ã·ã³ããªãã¯ãªã³ã¯ãä»ããŠãã¹ãŠã®ã¿ã¹ã¯ã«ã¢ã¯ã»ã¹ã§ããå¿
èŠããããŸã
- feyloverã®å Žåãã·ã³ããªãã¯ãªã³ã¯ã¯å€ããµãŒããŒã§åé€ãããæ°ãããµãŒããŒã§äœæãããŸã
- crond
- feyloverã®å Žåãcrondã¯å€ããµãŒããŒã§åæ¢ããæ°ããã¢ã¯ãã£ããµãŒããŒã§èµ·åããŸã
æ§æãã¡ã€ã«ã®äŸãšãzabbixãµãŒããŒã®LSB initã¹ã¯ãªããã¯ã
ãã¡ãããããŠã³ããŒãã§ã
ãŸã ã ã<>ãã§å²ãŸãããã©ã¡ãŒã¿ãŒãå¿ããã«ç·šéããŠãã ããã ããã«ããã¹ãŠã®Zabbixãã¡ã€ã«ãåããã©ã«ããŒïŒ/ usr / local / zabbixïŒã«ãããšããäºå®ãèæ
®ããŠãinitã¹ã¯ãªãããäœæãããŸãã ãã®ãããå¿
èŠã«å¿ããŠã¹ã¯ãªããå
ã®ãã¹ã調æŽããŸãã
DBMSã®ãã©ãŒã«ããã¬ã©ã³ã¹
ããŒã¿ããŒã¹ããã€ã§ãã¯ã©ãã·ã¥ããå¯èœæ§ãããå Žåãæããã«ZabbixãµãŒããŒãåãããµãŒããŒã®ãã©ãŒã«ããã¬ã©ã³ã¹ã®å©ç¹ã¯ãããŸããã MySQLã«ã¯ãã¯ã©ã¹ã¿ãŒãäœæããæ¹æ³ãæ°å€ããããŸãã䜿çšããæ¹æ³ã«ã€ããŠèª¬æããŸãã
ãŸããLinux HAãPacemakerãšCMANãšãšãã«ãããŒã¿ããŒã¹ã«äœ¿çšããŸããã çµå±ã®ãšãããMySQLã¬ããªã±ãŒã·ã§ã³ã管çããããã®åªããæ©èœãããã€ããããŸãã ã¢ã¯ãã£ãïŒãã¹ã¿ãŒïŒãšã¹ã¿ã³ãã€ïŒã¹ã¬ãŒãïŒMySQLã®éã§ããŒã¿ãåæããããã«ã¬ããªã±ãŒã·ã§ã³ã䜿çšããŸãïŒäœ¿çšããæªè§£æ±ºã®åé¡ãã»ã¯ã·ã§ã³ãåç
§ïŒã ãŸããZabbixãµãŒããŒãµãŒããŒãšåæ§ã«ãåºæ¬çãªã¯ã©ã¹ã¿ãŒæ§æãè¡ããŸãã 次ã«ãã¢ããªã³ã§ä»¥äžãæ§æããŸããã
- å
±æIPã¢ãã¬ã¹
- feyloverã®å ŽåãIPã¢ãã¬ã¹ã¯ãµãŒããŒã«éããããµãŒããŒãã¢ã¯ãã£ãã«ãªããŸã
- å
±æIPã¢ãã¬ã¹ã¯åžžã«ã¢ã¯ãã£ããªZabbixãµãŒããŒã«ãã£ãŠäœ¿çšãããããã次ã®2ã€ã®å©ç¹ããããŸãã
- ã©ã®ãµãŒããŒãã¢ã¯ãã£ãã§ããããèŠã€ããã®ã¯åžžã«ç°¡åã§ãã
- ãã§ã€ã«ãªãŒããŒã®å ŽåãZabbixãµãŒããŒèªäœã§æ°ããã¢ã¯ãã£ããªMySQLãµãŒããŒã®ã¢ãã¬ã¹ã瀺ãã¢ã¯ã·ã§ã³ã¯äžèŠã§ã
- å
±éã¹ã¬ãŒãIPã¢ãã¬ã¹
- ãã®IPã¢ãã¬ã¹ã¯ãããŒã¿ããŒã¹ãžã®èªã¿åãèŠæ±ãçºçãããšãã«äœ¿çšã§ããŸãã ãããã£ãŠãã¯ãšãªã¯ã䜿çšå¯èœãªå ŽåãMySQLã¹ã¬ãŒããµãŒããŒã«ãã£ãŠåŠçã§ããŸãã
- ã©ã®ãµãŒããŒã«ãè¿œå ã®ã¢ãã¬ã¹ãèšå®ã§ããŸããã次ã®æ¡ä»¶ã«äŸåããŸãã
- ã¹ã¬ãŒããµãŒããŒãå©çšå¯èœã§ãããã¯ããã¯ã60ç§ä»¥äžé
ããªãå Žåãã¢ãã¬ã¹ãæã¡ãŸãã
- ãã以å€ã®å ŽåãMySQLãã¹ã¿ãŒãµãŒããŒã®ã¢ãã¬ã¹ã¯
- mysqld
- feyloverã®å Žåãæ°ããMySQLãµãŒããŒãã¢ã¯ãã£ãã«ãªããŸãã ãã®åŸãå€ããµãŒããŒãåäœã«æ»ããšããã§ã«æ°ããäœæããããã¹ã¿ãŒã®ã¹ã¬ãŒãã®ãŸãŸã«ãªããŸãã
èšå®ãã¡ã€ã«ã®äŸã¯ã
ããã§ååŸã§ã
ãŸã ã ã<>ãã§å²ãŸããããŒã¹ã¡ãŒã«ãŒãã©ã¡ãŒã¿ãç·šéããããšãå¿ããªãã§ãã ããã ãŸããããŒã¹ã¡ãŒã«ãŒã§äœ¿çšããããã«å¥ã®MySQLãªãœãŒã¹ãšãŒãžã§ã³ããããŠã³ããŒãããå¿
èŠããããŸãã ãªã³ã¯ã¯ãPercona github
ãªããžããªã«ããŒã¹ã¡ãŒã«ãŒã䜿çšããŠMySQLã¯ã©ã¹ã¿ãŒãã€ã³ã¹ããŒã«ããããã®ããã¥ã¡ã³ãã«èšèŒãããŠã
ãŸã ã ãŸãããç«çœäºæ
ãã®å Žåã«åããŠãã³ããŒã
ããã«ãã
ãŸã ã
Zabbixãããã·
äœããã®çç±ã§Zabbixãããã·ã«ã€ããŠèããããšããªãå Žåã¯ã
ããã¥ã¡ã³ããæ©æ¥ã«ã芧ãã ããã ãããã·ã«ãããZabbixã¯è€æ°ã®ãã·ã³ã«ç£èŠè² è·ãåæ£ã§ããŸãã ãã®åŸããã¹ãŠã®Zabbixãããã·ã¯ãåéããããã¹ãŠã®ããŒã¿ãZabbixãµãŒããŒã«éä¿¡ããŸãã
Zabbixãããã·ã䜿çšããå Žåã次ã®ç¹ã«æ³šæããããšãéèŠã§ãã
- Zabbixãããã·ã¯ãé©åã«èšå®ãããŠããã°ãéåžžã«å€§éã®ããŒã¿ãåŠçã§ããŸãã ãã®ãããããšãã°ããã¹ãäžããããã·ïŒãããã·AãšåŒã³ãŸãïŒã¯1500-1750 NVPSãåé¡ãªãåŠçããŸããã ããã¯ã2ã€ã®ä»®æ³CPUã4GBã®RAMãããã³SQLite3ããŒã¿ããŒã¹ãåããä»®æ³ãã·ã³ã§ãã åæã«ããããã·ã¯ãµãŒããŒèªäœãšåããµã€ãäžã«ãã£ãããããããã¯ãŒã¯ã®é
延ãåçŽã«èæ
®ããããšã¯ã§ããŸããã§ããã ãŸããåéãããã»ãšãã©ãã¹ãŠãã¢ã¯ãã£ããªZabbixãšãŒãžã§ã³ãã®ããŒã¿èŠçŽ ã§ãã
- åã«ãç£èŠããéã®ãããã¯ãŒã¯é
延ãã©ãã»ã©éèŠããè¿°ã¹ãŸããã ãããã£ãŠãããã¯å€§èŠæš¡ã·ã¹ãã ã®å Žåã«åœãŠã¯ãŸããŸãã å®éããããã·ãé
ããããšãªãéä¿¡ã§ããããŒã¿ã®éã¯ããããã¯ãŒã¯ã«çŽæ¥äŸåããŸãã
以äžã®ã°ã©ãã¯ããããã¯ãŒã¯é
延ãèæ
®ããªãå Žåã«åé¡ãã©ã®ããã«èç©ãããããæ確ã«ç€ºããŠããŸãã æéããªããããã·ïŒ
ãããããéä¿¡çšã®ããŒã¿ããã®ãã¥ãŒãå¢å ããŠã¯ãªããªãããšã¯æããã§ãã ã°ã©ãã¯å¥ã®Zabbixãããã·ïŒãããã·BïŒãåç
§ããŸããããããã·AãšããŒããŠã§ã¢ã®éãã¯ãããŸãããããããã·Aã®ãããª1500NVPSã§ã¯ãªã500NVPSã®ã¿ãåé¡ãªãéä¿¡ã§ããŸããéãã¯ãBãã·ã³ã¬ããŒã«ãšããèªäœã«ããããšã§ããåç±³ã®ãµãŒããŒãããã³ãµã€ãéã®é
延ã¯çŽ230ããªç§ã§ãã ããŒã¿ã®éä¿¡æ¹æ³ãèãããšããã®é
延ã¯æ·±å»ãªåœ±é¿ãåãŒããŸãã ãã®å Žåããããã·Bã¯2ã3ç§ããšã«åéãããZabbixèŠçŽ ã1000åã ããµãŒããŒã«éä¿¡ã§ããŸãã ç§ã®èŠ³å¯ã«ããã°ãããã¯äœãèµ·ãããã§ãïŒ
- ãããã·ã¯ãµãŒããŒãžã®æ¥ç¶ã確ç«ããŸã
- æ倧ãããã·ã¯ãäžåºŠã«1000åã®åéãããããŒã¿é
ç®å€ãéä¿¡ããŸãã
- ãããã·ãæ¥ç¶ãéããŸã
ãã®æé ã¯ãå¿
èŠãªåæ°ã ãç¹°ãè¿ãããŸãã 倧ããªé
延ã®å Žåããã®æ¹æ³ã«ã¯ããã€ãã®é倧ãªåé¡ããããŸãã
- åææ¥ç¶ã¯éåžžã«é
ãã§ãã ç§ã®å Žåã0.25ç§ã§çºçããŸãã ãµãïŒ
- 1000åã®ããŒã¿èŠçŽ ãéä¿¡ããåŸã«æ¥ç¶ãéãããããããTCPæ¥ç¶ã¯ãã£ãã«ã®å©çšå¯èœãªãã¹ãŠã®åž¯åå¹
ã䜿çšããã®ã«ååãªã»ã©é·ãç¶ãããšã¯ãããŸããã
ããŒã¿ããŒã¹ã®ããã©ãŒãã³ã¹
åéããããã¹ãŠã®æ
å ±ã確å®ã«ããã«å°éãããããé«ãããŒã¿ããŒã¹ããã©ãŒãã³ã¹ãç£èŠã·ã¹ãã ã®éµãšãªããŸãã åæã«ãããŒã¿ããŒã¹ãžã®å€æ°ã®æžã蟌ã¿æäœãèãããšããã£ã¹ã¯ããã©ââãŒãã³ã¹ãæåã®ããã«ããã¯ã§ãã 幞éã«ãSSDãèªç±ã«äœ¿çšã§ããŸããããããã§ãããŒã¹ã®é«éåäœãä¿èšŒãããã®ã§ã¯ãããŸããã 以äžã«äŸã瀺ããŸãã
- æåã¯ãã·ã¹ãã ã§MySQL 5.5.18ã䜿çšããŸããã ãã ãã700-750 NVPS MySQLãããã»ããµã100ïŒ
ã§ããŒããå§ããã·ã¹ãã ãæåéããããªãŒãºãããåŸãæåã¯ç®ã«èŠããããã©ãŒãã³ã¹ã®åé¡ã¯èŠ³å¯ãããŸããã§ããã æ§æãã¡ã€ã«ã®ãã©ã¡ãŒã¿ãŒãå€æŽãããã倧ããªããŒãžãã¢ã¯ãã£ãã«ããããããŒãã£ã·ã§ã³ãäœæãããããŠãç¶æ³ãä¿®æ£ããããšè©Šã¿ãããäœãèµ·ãããŸããã§ããã ç§ã®åŠ»ã¯ãããè¯ã解決çãææ¡ããŸãããæåã«MySQL 5.6ã«ã¢ããã°ã¬ãŒãããŠããããããèŠã€ãåºããŸãã é©ããããšã«ãç°¡åãªæŽæ°ã§ãã¹ãŠã®ããã©ãŒãã³ã¹ã®åé¡ã解決ãããŸãããããã¯5.5.18ã§ã¯è§£æ±ºã§ããŸããã§ããã 念ã®ãããããã«my.cnfã®ã³ããŒã瀺ããŸãã
ã°ã©ãã¯ãããŒã¿ããŒã¹å
ã®1ç§ãããã®ãªã¯ãšã¹ãæ°ã瀺ããŠããŸãã
ã»ãšãã©ã®ãªã¯ãšã¹ãã¯ãCom_updateãã§ããããšã«æ³šæããŠãã ããã ãã®çç±ã¯ãåãåã£ãåå€ããã¢ã€ãã ãããŒãã«ã®æŽæ°ã«ã€ãªãããšããäºå®ã«ãããŸãã ããŒã¿ããŒã¹ã«ã¯äž»ã«æžã蟌ã¿æäœããããããMySQLã¯ãšãªãã£ãã·ã¥ã¯åœ¹ã«ç«ã¡ãŸããã å®éããªã¯ãšã¹ããåžžã«ç¡å¹ãšããŠããŒã¯ããå¿
èŠããããããããã©ãŒãã³ã¹ã«æªåœ±é¿ãäžããå¯èœæ§ãããããŸãã
å¥ã®ããã©ãŒãã³ã¹ã®åé¡ã¯ãZabbix Housekeeperã§ããå¯èœæ§ããããŸãã 倧èŠæš¡ãªãããã¯ãŒã¯ã§ã¯ããªãã«ããããšã匷ããå§ãããŸãã ãããè¡ãã«ã¯ãæ§æãã¡ã€ã«ã§DisableHousekeeping = 1ãèšå®ããŸãã ããŠã¹ããŒãã³ã°ããªããã°ãå€ãããŒã¿ïŒããŒã¿èŠçŽ ãã€ãã³ããã¢ã¯ã·ã§ã³ïŒãããŒã¿ããŒã¹ããåé€ãããªãããšã¯æããã§ãã ãã®åŸãããŒãã£ã·ã§ã³åå²ã«ãã£ãŠåé€ãæŽçã§ããŸãã
ãã ããMySQL 5.6.12ã®å¶éã®1ã€ã¯ãå€éšããŒãæã€ããŒãã«ã§ã¯ããŒãã£ã·ã§ã³åã䜿çšã§ããªãããšã§ãããZabbixããŒã¿ããŒã¹ã®ã»ãŒãã¹ãŠã®å Žæã«ååšããŸãã ããããå¿
èŠãªå±¥æŽããŒãã«ã®ã»ãã«ã ããŒãã£ã·ã§ã³åã«ã¯2ã€ã®å©ç¹ããããŸãã
- æ¥/é±/æ/ãªã©ã§åå²ããããã¹ãŠã®å±¥æŽããŒãã«ããŒã¿ ããŒã¿ããŒã¹ã«åœ±é¿ãäžããããšãªããå°æ¥çã«ããŒã¿ãåé€ã§ããå¥ã®ãã¡ã€ã«ã«ããããšãã§ããŸãã ãŸããäžå®æéã«åéãããããŒã¿éãç解ããããšãéåžžã«ç°¡åã§ãã
- ããŒãã«ãã¯ãªã¢ããåŸãInnoDBã¯ãã£ã¹ã¯å®¹éãè¿ãããæ°ããããŒã¿çšã«ããèªäœãæ®ããŸãã ãã®çµæãInnoDBã䜿çšããŠãã£ã¹ã¯é åãã¯ãªã¢ããããšã¯ã§ããŸããã ããŒãã£ã·ã§ãã³ã°ã®å Žåãããã¯åé¡ã§ã¯ãªããåã«å€ãããŒãã£ã·ã§ã³ãåé€ããã ãã§ã¹ããŒã¹ã解æŸã§ããŸãã
Zabbiksã§ã®ããŒãã£ã·ã§ã³åå²ã«ã€ããŠã¯ããã§ã«Habréã§
æžãããŠããŸãã
åéãŸãã¯èã
Zabbixã«ã¯ãã¢ã¯ãã£ããšããã·ãã®2ã€ã®ããŒã¿åéæ¹æ³ããããŸããZabbixã®ããã·ãç£èŠã®å ŽåããµãŒããŒèªäœãZabbixãšãŒãžã§ã³ããããŒãªã³ã°ããã¢ã¯ãã£ãã®å ŽåãZabbixãšãŒãžã§ã³ãããµãŒããŒèªäœã«æ¥ç¶ããã®ãåŸ
æ©ããŸãã
Zabbixãã©ãããŒãããã¹ãåŽã«éä¿¡éå§ãæ®ã£ãŠãããããã¢ã¯ãã£ããªç£èŠã®å¯Ÿè±¡ãšãªããŸãã
ããããã®æ¹æ³ãäž»ãªæ¹æ³ãšããŠéžæãããšãããã©ãŒãã³ã¹ã®éããæ·±å»ã«ãªãå¯èœæ§ããããŸãã ããã·ãã¢ãã¿ãªã³ã°ã§ã¯ãZabbixãµãŒããŒã§ããã»ã¹ãå®è¡ããå¿
èŠããããŸããZabbixãµãŒããŒã¯ãZabbixãšãŒãžã§ã³ãã«å®æçã«ãªã¯ãšã¹ããéä¿¡ããå¿çãåŸ
æ©ããŸããå Žåã«ãã£ãŠã¯ãåŸ
æ©ãæ倧æ°ç§é
ããããšããããŸãã ãã®æéã«å°ãªããšã1000å°ã®ãµãŒããŒãæãããšãããŒãªã³ã°ã«æéããããããšãæããã«ãªããŸãã
ã¢ã¯ãã£ããªç£èŠã®å ŽåãããŒãªã³ã°ããã»ã¹ã¯ãããŸãããç£èŠå¯Ÿè±¡ã®ããŒã¿é
ç®ã®ãªã¹ããååŸããããã«ãšãŒãžã§ã³ãèªäœãZabbixãµãŒããŒãžã®æ¥ç¶ãéå§ãããšããµãŒããŒã¯åŸ
æ©ç¶æ
ã«ãªããŸãã
ããã«ããšãŒãžã§ã³ãã¯ããµãŒããŒããåä¿¡ããééãèæ
®ããŠããŒã¿èŠçŽ ã®åéãéå§ããããããéä¿¡ããŸãããæ¥ç¶ã¯ããšãŒãžã§ã³ãã«éä¿¡ãããã®ãããå Žåã«ã®ã¿éãããŸãã ãããã£ãŠãããŒã¿ãåä¿¡ããåã«æ€èšŒããå¿
èŠã¯ãããŸãããããã¯ãããã·ãã¢ãã¿ãªã³ã°ã«ååšããŸãã çµè«ïŒã¢ã¯ãã£ãã¢ãã¿ãªã³ã°ã¯ã倧èŠæš¡ãããã¯ãŒã¯ã§å¿
èŠãªããŒã¿åéã®é床ãåäžãããŸãã
Zabbixèªèº«ãç£èŠãã
Zabbixèªäœãç£èŠããªããšã倧èŠæš¡ã·ã¹ãã ã®å¹æçãªéçšã¯ãŸã£ããäžå¯èœã§ããã·ã¹ãã ãæ°ããããŒã¿ã®åä¿¡ãæåŠãããšãã«ããã©ã°ããçºçããå Žæãç解ããããšã¯éåžžã«éèŠã§ãã æ¢åã®Zabbixç£èŠããŒã¿èŠçŽ ã¯ã
ããã«ãããŸã ã Zabbixã®ããŒãžã§ã³2.xã§ã¯ããç®±ããåºããŠããã«ãæäŸãããZabbixãµãŒããŒç£èŠãã³ãã¬ãŒãã«èŠªåã«çµã¿èŸŒãŸããŸããã ããã䜿çšããŠãã ããïŒ
æçšãªã¡ããªãã¯ã®1ã€ã¯ãHistory Write Cacheã®ç©ºãé åïŒãµãŒããŒæ§æãã¡ã€ã«ã®HistoryCacheSizeïŒã§ãã ãã®ãã©ã¡ãŒã¿ãŒã¯åžžã«100ïŒ
ã«è¿ãå€ã«ããå¿
èŠããããŸãã ãã£ãã·ã¥ããã£ã±ãã®å ŽåãZabbixã«çä¿¡ããŒã¿ãããŒã¿ããŒã¹ã«è¿œå ããæéããããŸããã
æ®å¿µãªããããã®ãªãã·ã§ã³ã¯Zabbixãããã·ã§ã¯ãµããŒããããŠããŸããã ããã«ãZabbixã«ã¯ãZabbixãµãŒããŒãžã®éä¿¡ãåŸ
æ©ããŠããããŒã¿éã瀺ãããŒã¿èŠçŽ ã¯ãããŸããã ãã ãããã®ããŒã¿é
ç®ã¯ããããã·ããŒã¿ããŒã¹ãžã®SQLã¯ãšãªã䜿çšããŠç°¡åã«å®è¡ã§ããŸãã
SELECT ((SELECT MAX(proxy_history.id) FROM proxy_history)-nextid) FROM ids WHERE field_name='history_lastid'
èŠæ±ã¯ãå¿
èŠãªæ°ãè¿ããŸãã Zabbixãããã·ã®ããŒã¿ããŒã¹ãšããŠSQLite3ã䜿çšããŠããå ŽåãZabbixãããã·ãå®è¡ãããŠãããã·ã³ã«ã€ã³ã¹ããŒã«ãããŠããZabbixãšãŒãžã§ã³ãã®èšå®ãã¡ã€ã«ã«UserParameterãšããŠæ¬¡ã®ã³ãã³ããè¿œå ããã ãã§ãã
UserParameter=zabbix.proxy.items.sync.remaining,/usr/bin/sqlite3 /path/to/the/sqlite/database "SELECT ((SELECT MAX(proxy_history.id) FROM proxy_history)-nextid) FROM ids WHERE field_name='history_lastid'" 2>&1
次ã«ããããã·ã察åŠããŠããªãããšãéç¥ããããªã¬ãŒãé
眮ããŸãã
{Hostname:zabbix.proxy.items.sync.remaining.min(10m)}>100000
ç·çµ±èš
æåŸã«ãã·ã¹ãã è² è·ã°ã©ããææ¡ããŸãã 7æ16æ¥ã«äœãèµ·ãã£ãã®ãããããªããšããã«èšããŸããåé¡ã解決ããããã«ããã¹ãŠã®ãããã·ããŒã¿ããŒã¹ïŒåœæã®SQLiteïŒãåäœæããå¿
èŠããããŸããã ãã以æ¥ããã¹ãŠã®ãããã·ãMySQLã«å€æããŸããããåé¡ã¯ç¹°ãè¿ãããŠããŸããã ã°ã©ãã®æ®ãã®ãäžèŠåæ§ãã¯ãè² è·ãã¹ãã®æéãšäžèŽããŸãã äžè¬ã«ãã°ã©ãã¯ã䜿çšãããéã«å€§ããªå®å
šããŒãžã³ãããããšã瀺ããŠããŸãã
次ã«ãããŒã¿ããŒã¹ãµãŒããŒããã®ã°ã©ãã瀺ããŸãã æ¯æ¥ã®ãã©ãã£ãã¯ã®å¢å ã¯ããã³ãã®æéïŒmysqldumpïŒã«å¯Ÿå¿ããŠããŸãã ãŸããã¯ãšãªã°ã©ãïŒqpsïŒã®7æ16æ¥ã®å€±æã¯ãäžèšã§èª¬æããã®ãšåãåé¡ã«é¢é£ããŠããŸãã
éå¶ç®¡ç
åèšã§ãã·ã¹ãã ã¯ãZabbixãµãŒããŒçšã«2å°ã®ãµãŒããŒãMySQLçšã«2å°ã®ãµãŒããŒãZabbixãããã·çšã«16å°ã®ä»®æ³ãµãŒããŒãZabbixãšãŒãžã§ã³ããåããæ°åã®ç£èŠå¯Ÿè±¡ãµãŒããŒã䜿çšããŸãã ãã¹ããéåžžã«å€ããããæäœæ¥ã§å€æŽãå ããããšã«çåã®äœå°ã¯ãããŸããã§ããã ãããŠããœãªã¥ãŒã·ã§ã³ã¯Gitãªããžããªã§ããããã¹ãŠã®ãµãŒããŒãã¢ã¯ã»ã¹ã§ãããã¹ãŠã®æ§æãã¡ã€ã«ãã¹ã¯ãªãããããã³é
åžããå¿
èŠã®ãããã¹ãŠã®ãã®ãé
眮ããŸããã 次ã«ããšãŒãžã§ã³ãã®UserParameterãä»ããŠåŒã³åºãããã¹ã¯ãªãããäœæããŸããã ã¹ã¯ãªããã®å®è¡åŸããµãŒããŒã¯Gitãªããžããªã«æ¥ç¶ããå¿
èŠãªãã¹ãŠã®ãã¡ã€ã«ãšæŽæ°ãããŠã³ããŒãããèšå®ãã¡ã€ã«ã«å€æŽããã£ãå Žåã¯ZabbixãšãŒãžã§ã³ã/ãããã·/ãµãŒããŒãåèµ·åããŸãã æŽæ°ã¯zabbix_getãå®è¡ããããé£ãããããŸããïŒ
Webã€ã³ã¿ãŒãã§ã€ã¹ãä»ããŠæåã§æ°ãããã¹ããäœæããããšããéåžžã«å€ãã®ãµãŒããŒã䜿çšããæ¹æ³ã§ã¯ãããŸããã åœç€Ÿã«ã¯CMDBããããããã«æäŸããããã¹ãŠã®ãµãŒããŒãšãµãŒãã¹ã«é¢ããæ
å ±ãå«ãŸããŠããŸãã ãã®ãããå¥ã®ããžãã¯ã¹ã¯ãªããã1æéããšã«CMDBããæ
å ±ãåéãããããZabbixã«ãããã®ãšæ¯èŒããŸãã ãã®æ¯èŒã®çµè«ãšããŠãã¹ã¯ãªããã¯ãã¹ããåé€/è¿œå /ãªã³/ãªãããã°ã«ãŒããã¹ããäœæãããã³ãã¬ãŒãããã¹ãã«è¿œå ããŸãã ãã®å Žåãæåã§è¡ãå¿
èŠãããã®ã¯ãæ°ããã¿ã€ãã®ããªã¬ãŒãŸãã¯ããŒã¿èŠçŽ ã®å®è£
ã ãã§ãã æ®å¿µãªããããããã®ã¹ã¯ãªããã¯ã·ã¹ãã ã«åŒ·ãçµã³ä»ããããŠãããããå
±æã§ããŸããã
æªè§£æ±ºã®åé¡
ç§ãè¡ã£ããã¹ãŠã®åªåã«ããããããããŸã 解決ããŠããªãéèŠãªåé¡ã1ã€æ®ã£ãŠããŸãã å®éãã·ã¹ãã ã8000-9000NVPSã«éãããšãããã¯ã¢ããMySQLããŒã¿ããŒã¹ã¯ã¡ã€ã³ããŒã¿ããŒã¹ã«è¿œãä»ããªããããå®éã«ã¯ãã©ãŒã«ããã¬ã©ã³ã¹ã¯ãããŸããã
ãã®åé¡ã解決ããæ¹æ³ã¯ãããŸããããŸã å®è£
ããæéããããŸããã
- ããŒã¿ããŒã¹ã®ããŒãã£ã·ã§ã³åå²ã«ã¯ãDRBDã§Linux-HAã䜿çšããŸãã
- å¥ã®LUNãžã®ã¬ããªã±ãŒã·ã§ã³ã䜿çšããSANã§ã®LUNã¬ããªã±ãŒã·ã§ã³
- Percona XtraDBã¯ã©ã¹ã¿ãŒã ããŒãžã§ã³5.6ã§ã¯ãŸã å©çšã§ããªããããåŸ
ã€å¿
èŠããããŸãïŒç§ãæžããããã«ãMySQL 5.5ã«ã¯ããã©ãŒãã³ã¹ã®åé¡ããããŸããïŒ
åç
§è³æ