{"id":647,"date":"2020-03-16T17:11:17","date_gmt":"2020-03-16T09:11:17","guid":{"rendered":"https:\/\/www.linuxdevops.cn\/?p=647"},"modified":"2020-03-16T17:27:37","modified_gmt":"2020-03-16T09:27:37","slug":"647","status":"publish","type":"post","link":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/","title":{"rendered":"Docker \u90e8\u7f72Zabbix \u76d1\u63a7"},"content":{"rendered":"\n

\u53c2\u8003\u535a\u5ba2\uff1ahttps:\/\/www.cnblogs.com\/root0\/p\/9812789.html<\/a> <\/p>\u5728\u5b9e\u9645\u90e8\u7f72\u4e2d\u7a0d\u505a\u6539\u52a8\uff0c\u505a\u8bb0\u5f55<\/cite><\/blockquote>\n\n\n\n

1 \u5b98\u65b9\u5730\u5740<\/h2>\n\n\n\n

\u5b98\u65b9\u5199\u7684\u5f88\u8be6\u7ec6\u5e76\u4e14\u662f\u4e2d\u6587\u7684,\u4e00\u6b65\u6b65\u6309\u7167\u64cd\u4f5c\u5c31\u53ef\u4ee5<\/p>\n\n\n\n

https:\/\/www.zabbix.com\/documentation\/3.4\/zh\/manual\/installation\/containers<\/code><\/pre>\n\n\n\n

2 \u542f\u52a8\u4e00\u4e2a\u7a7a\u7684Mysql\u670d\u52a1\u5668\u5b9e\u4f8b<\/h2>\n\n\n\n
docker run --name mysql-server -t \\\n -e MYSQL_DATABASE=\"zabbix\" \\\n -e MYSQL_USER=\"zabbix\" \\\n -e MYSQL_PASSWORD=\"zabbix_111\" \\\n -e MYSQL_ROOT_PASSWORD=\"root_111\" \\\n -v \/data\/mysql:\/var\/lib\/mysql \\\n -p 3306:3306 \\\n -d mysql<\/pre>\n\n\n\n

3 \u542f\u52a8Zabbix server\u5b9e\u4f8b\uff0c\u5e76\u5173\u8054\u8fd9\u4e2a\u5b9e\u4f8b\u5230\u5df2\u521b\u5efa\u7684MySQL\u670d\u52a1\u5668\u5b9e\u4f8b<\/h2>\n\n\n\n
docker run --name  zabbix-server-mysql  -t \\\n       -e DB_SERVER_HOST=\"192.168.0.30\" \\\n       -e MYSQL_DATABASE=\"zabbix\" \\\n       -e MYSQL_USER=\"zabbix\" \\\n       -e MYSQL_PASSWORD=\"zabbix_111\" \\\n       -e MYSQL_ROOT_PASSWORD=\"root_111\" \\\n       --link mysql-server:mysql \\\n       -p 10051:10051 \\\n       -d zabbix\/zabbix-server-mysql:latest      <\/pre>\n\n\n\n

4 \u542f\u52a8Zabbix web \u63a5\u53e3\uff0c\u5e76\u5c06\u5b83\u4e0eMySQL\u670d\u52a1\u5668\u5b9e\u4f8b\u548cZabbix server\u5b9e\u4f8b\u5173\u8054<\/h2>\n\n\n\n

\u52a0\u4e86\u4e00\u4e2a\u914d\u7f6e\u6587\u6863\u7684\u6302\u8f7d\uff0c -v \/etc\/php\/99-zabbix.ini:\/etc\/php7\/conf.d\/99-zabbix.ini \u7528\u6765\u4fee\u6539\u65f6\u533a\u8bbe\u7f6e\uff0c<\/p><\/blockquote>\n\n\n\n

vim \/etc\/php\/99-zabbix.ini\n max_execution_time=600\n memory_limit=128M\n post_max_size=16M\n upload_max_filesize=2M\n max_input_time=300\n ; always_populate_raw_post_data=-1\n max_input_vars=10000\n ; date.timezone=Europe\/Riga\n date.timezone=Asia\/Shanghai<\/strong>\n ; session.save_path=\/var\/lib\/php7<\/pre>\n\n\n\n
docker run --name zabbix-nginx -t \\\n       -e DB_SERVER_HOST=\"192.168.0.30\" \\\n       -e MYSQL_DATABASE=\"zabbix\" \\\n       -e MYSQL_USER=\"zabbix\" \\\n       -e MYSQL_PASSWORD=\"zabbix_111\" \\\n       -e MYSQL_ROOT_PASSWORD=\"root_111\" \\\n       --link mysql-server:mysql \\\n       --link zabbix-server-mysql:zabbix-server \\\n       -v \/etc\/php\/99-zabbix.ini:\/etc\/php7\/conf.d\/99-zabbix.ini \\\n       -p 80:80 \\\n       -d zabbix\/zabbix-web-nginx-mysql:latest<\/pre>\n\n\n\n

5 \u67e5\u770b\u5bb9\u5668\u542f\u52a8\u60c5\u51b5 <\/h2>\n\n\n\n
[root@zabbix_server ~]# docker ps\nCONTAINER ID        IMAGE                                  COMMAND                  CREATED              STATUS              PORTS                           NAMES\n98cbe8d8a6bd        zabbix\/zabbix-web-nginx-mysql:latest   \"docker-entrypoint.sh\"   6 seconds ago        Up 5 seconds        443\/tcp, 0.0.0.0:8080->80\/tcp   zabbix-web-nginx-mysql\nde040d43d60f        zabbix\/zabbix-server-mysql:latest      \"docker-entrypoint.sh\"   59 seconds ago       Up 59 seconds       0.0.0.0:10051->10051\/tcp        zabbix-server-mysql\n3276f18def8d        mysql:5.7                              \"docker-entrypoint.s\u2026\"   About a minute ago   Up About a minute   3306\/tcp                        mysql-server<\/pre>\n\n\n\n
[root@zabbix_server ~]# docker images\nREPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE\nzabbix\/zabbix-web-nginx-mysql   latest              4db891b4393a        10 hours ago        177MB\nzabbix\/zabbix-server-mysql      latest              f5e58dafe9ac        10 hours ago        62.2MB\nmysql                           5.7                 f0f3956a9dd8        7 days ago          409MB<\/pre>\n\n\n\n

6 \u4fee\u6539\u9632\u706b\u5899<\/h2>\n\n\n\n

iptables -P FORWARD ACCEPT<\/p>\n\n\n\n

7 \u8bbf\u95eeweb\u754c\u9762<\/h2>\n\n\n\n

http:\/192.168.0.30:80<\/a><\/p>\n\n\n\n

\u5e10\u53f7\u5bc6\u7801:
Admin
zabbix<\/p>\n\n\n\n

\"\"\/<\/figure>\n","protected":false},"excerpt":{"rendered":"

\u53c2\u8003\u535a\u5ba2\uff1ahttps:\/\/www.cnblogs.com\/root0\/p\/9812789.html \u5728\u5b9e\u9645\u90e8\u7f72<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18,33],"tags":[],"yoast_head":"\nDocker \u90e8\u7f72Zabbix \u76d1\u63a7 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker \u90e8\u7f72Zabbix \u76d1\u63a7 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"og:description\" content=\"\u53c2\u8003\u535a\u5ba2\uff1ahttps:\/\/www.cnblogs.com\/root0\/p\/9812789.html \u5728\u5b9e\u9645\u90e8\u7f72\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-16T09:11:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-16T09:27:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/img2018.cnblogs.com\/blog\/1323575\/201810\/1323575-20181018195623539-755926575.png\" \/>\n<meta name=\"author\" content=\"\u7ba1\u7406\u5458\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/\"},\"author\":{\"name\":\"\u7ba1\u7406\u5458\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"headline\":\"Docker \u90e8\u7f72Zabbix \u76d1\u63a7\",\"datePublished\":\"2020-03-16T09:11:17+00:00\",\"dateModified\":\"2020-03-16T09:27:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/\"},\"wordCount\":36,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"articleSection\":[\"Linux\",\"Linux\u670d\u52a1\",\"zabbix\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/\",\"name\":\"Docker \u90e8\u7f72Zabbix \u76d1\u63a7 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\"},\"datePublished\":\"2020-03-16T09:11:17+00:00\",\"dateModified\":\"2020-03-16T09:27:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.linuxdevops.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\/\/www.linuxdevops.cn\/linux\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Docker \u90e8\u7f72Zabbix \u76d1\u63a7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\",\"url\":\"https:\/\/www.linuxdevops.cn\/\",\"name\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"description\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0\",\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"alternateName\":\"linuxdevops\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.linuxdevops.cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\",\"name\":\"\u7ba1\u7406\u5458\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"contentUrl\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"width\":512,\"height\":512,\"caption\":\"\u7ba1\u7406\u5458\"},\"logo\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\"},\"description\":\"\u7ba1\u7406\u5458\",\"url\":\"https:\/\/www.linuxdevops.cn\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Docker \u90e8\u7f72Zabbix \u76d1\u63a7 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/","og_locale":"zh_CN","og_type":"article","og_title":"Docker \u90e8\u7f72Zabbix \u76d1\u63a7 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","og_description":"\u53c2\u8003\u535a\u5ba2\uff1ahttps:\/\/www.cnblogs.com\/root0\/p\/9812789.html \u5728\u5b9e\u9645\u90e8\u7f72","og_url":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/","og_site_name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","article_published_time":"2020-03-16T09:11:17+00:00","article_modified_time":"2020-03-16T09:27:37+00:00","og_image":[{"url":"https:\/\/img2018.cnblogs.com\/blog\/1323575\/201810\/1323575-20181018195623539-755926575.png"}],"author":"\u7ba1\u7406\u5458","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#article","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/"},"author":{"name":"\u7ba1\u7406\u5458","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"headline":"Docker \u90e8\u7f72Zabbix \u76d1\u63a7","datePublished":"2020-03-16T09:11:17+00:00","dateModified":"2020-03-16T09:27:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/"},"wordCount":36,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"articleSection":["Linux","Linux\u670d\u52a1","zabbix"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/","url":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/","name":"Docker \u90e8\u7f72Zabbix \u76d1\u63a7 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/#website"},"datePublished":"2020-03-16T09:11:17+00:00","dateModified":"2020-03-16T09:27:37+00:00","breadcrumb":{"@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxdevops.cn\/2020\/03\/647\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/647\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.linuxdevops.cn\/"},{"@type":"ListItem","position":2,"name":"Linux","item":"https:\/\/www.linuxdevops.cn\/linux\/"},{"@type":"ListItem","position":3,"name":"Docker \u90e8\u7f72Zabbix \u76d1\u63a7"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxdevops.cn\/#website","url":"https:\/\/www.linuxdevops.cn\/","name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","description":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0","publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"alternateName":"linuxdevops","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxdevops.cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":["Person","Organization"],"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1","name":"\u7ba1\u7406\u5458","image":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/","url":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","contentUrl":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","width":512,"height":512,"caption":"\u7ba1\u7406\u5458"},"logo":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/"},"description":"\u7ba1\u7406\u5458","url":"https:\/\/www.linuxdevops.cn\/author\/root\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/647"}],"collection":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/comments?post=647"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/647\/revisions"}],"predecessor-version":[{"id":650,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/647\/revisions\/650"}],"wp:attachment":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/media?parent=647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/categories?post=647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/tags?post=647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}