Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix installation tutorial under docker-compose

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the "zabbix installation tutorial under docker-compose" related knowledge, in the actual case operation process, many people will encounter such a dilemma, and then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

Premise

Use docker-compose to install zabbix, as long as both docker and docker-compose are successfully installed, can be used properly, or can be connected to the Internet.

Define 2 installation files

Docker-based zabbix is easy to install

To sum up, "prepare 2 files", and then "execute 2 commands"

The above two files are placed in the same directory

The two files are

Envdocker-compose.yml

When you are ready, execute two commands in turn

Source envdocker-compose up-d definition env file

These parameters need to be used when installing zabbix. They are first defined in an env file, and the following contents are modified according to the actual situation.

# cat envailments bind zabbix env# # zabbix env# define the library name of the zabbix database export Z_database_name=zabbix# the user of the new database export Z_database_user=zabbix# the password of the above user export Z_database_user_password=zabbix_pwd# root user's password, it is recommended to change the password of the port export Z_port=80export Z_name=MyZabbixexport Z_tz=Asia/Shanghai definition docker-compose.yml file of the export Z_database_root_password=root_pwd# zabbix web page

The following files have been completed and do not need to be modified. Copy them directly and wait for use.

# cat docker-compose.ymlversion: "3" services: mysql-server-for-z: image: mysql:5.7 container_name: mysql-server-for-z environment:-MYSQL_DATABASE=$ {Z_database_name}-MYSQL_USER=$ {Z_database_user}-MYSQL_PASSWORD=$ {Z_database_user_password}-MYSQL_ROOT_PASSWORD=$ {Z_database_root_password} volumes:-"$ {PWD} / mysql:/var/lib/mysql "zabbix-server-mysql: image: zabbix/zabbix-server-mysql:latest container_name: zabbix-server-mysql environment:-DB_SERVER_HOST=mysql-server-for-z-MYSQL_DATABASE=$ {Z_database_name}-MYSQL_USER=$ {Z_database_user}-MYSQL_PASSWORD=$ {Z_database_user_password}-MYSQL_ROOT_PASSWORD=$ {Z_database_root _ password} ports:-"10051 mysql-server-for-z:mysql depends_on 10051" links:-mysql-server-for-z:mysql depends_on:-mysql-server-for-z zabbix-web-nginx-mysql: image: zabbix/zabbix-web-nginx-mysql:latest container_name: zabbix-web-nginx-mysql environment:-DB_SERVER_HOST=mysql-server-for-z-MYSQL_DATABASE=$ {Z_database_name} -MYSQL_USER=$ {Z_database_user}-MYSQL_PASSWORD=$ {Z_database_user_password}-MYSQL_ROOT_PASSWORD=$ {Z_database_root_password}-ZBX_SERVER_NAME=$ {Z_name}-TZ=$ {Z_tz} ports:-"${Z_port}: 80" links:-mysql-server-for-z:mysql-zabbix-server-mysql:zabbix-server depends _ on:-zabbix-server-mysql executes the installation command

When you are ready, execute two commands in turn

Source envdocker-compose up-d wait, not so fast

The first installation will automatically download dependent files such as database and zabbix, which will be slow.

If you have already downloaded it, you will try to start it directly.

After startup, although done has been prompted, it takes some time for docker to start app and so on.

If you view it through the web page immediately, you will not be able to see it, because it is still starting, and you need to wait 2-3 minutes to view it from the web page, and the zabbix login page will appear.

The login address is your local address. If the port (Z_port) is changed, add the changed port account password to admin/zabbix in the browser.

This is the end of the "zabbix installation tutorial under docker-compose". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report