In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the detailed process of installing zabbix service in Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the detailed process of installing zabbix service on Linux system".
First, prepare the environment
System: CentOS 65.
LNMP:1.7
Zabbix:4.4
1. Install the LNMP environment before installing zabbix this time, and install the LNMP environment with one click.
Download address of LNMP:
Address: http://soft.vpser.net/lnmp/lnmp1.7-full.tar.gz (directly copy link paste Xunlei or other downloader can download)
File size: 869MB
MD5:a1d5d3e9b5c0c8bbfb99c33fd10dc7f1
Download the offline version of the installed LNMP1.7, upload it to the Linux server, and decompress it:
[root@local ~] # tar-xvf lnmp1.7-full.tar.gz [root@local ~] # cd lnmp1.7-full
Because it is an offline version, the parameters are specified separately during installation:
[root@local ~] # CheckMirror=n. / install.sh lnmp
For more information on what to do after executing the command, please see: https://lnmp.org/install.html
LNMP one-click installation Learning reference website: https://lnmp.org/
Note:
In the process of installation, it is easy to install NGINX successfully because of differences in the system environment, and other servers such as MySQL and PHP will fail. Please refer to the installation log (location: / root/lnmp-install.log) to deal with separately according to the error reason of each dark conversion phase. Generally, there are relevant reference methods on the Internet, mostly due to the lack of dependency packages. You can configure the dependent packages required for yun source installation. If it is a private network environment, you can configure the local yum source to install the dependency package. For more information on how to configure local yum, please see https://blog.csdn.net/qq_32838955/article/details/104285779
MySQL database problems sometimes occur when you modify the configuration and execute the installation command many times. After installation, MySQL cannot be installed and PHP cannot be installed. After solving the MySQL installation, once again execute the one-click installation command because MySQL has already been installed, so the start and stop command during the installation of MySQL will not be successful, which does not affect the installation of PHP. However, it will cause my local MySQL library root to be unable to log in after the LNMP installation is successful. After skipping user authentication and logging in to MySQL, I found that the user table in the default library mysql (the table in which the database system stores database login users) does not match the MySQL version. I do not know if it is an individual case, because I installed the MySQL5.7 version, there is no data in the user table, and the user table segment is different from MySQL5.7. So it's normal after I delete and reinitialize the directory executed by data where the MySQL stores the data.
two。 Download the zabbix source package from the zabbix official website, version 4.4.
Second, install zabbix
1. To create a zabbix user:
[root@local] # groupadd zabbix-g 201 [root@local] # useradd-g zabbix-u 201-m zabbix
two。 Decompress the zabbix source code package and compile it. Because it is not clear what the source code package lacks in the LNMP environment, compile first, and then solve the compilation problems one by one (most of the compilation problems are caused by the failure to install all the required dependency packages):
[root@local] # tar zxf zabbix-4.4.tar.gz [root@local ~] # cd zabbix-4.4 [root@local zabbix-4.4] #. / configure-- prefix=/data/zabbix-- enable-server-- enable-proxy-- enable-agent-- with-mysql=/usr/local/mysql/bin/mysql_config-- with-net-snmp-- with-libcurl-- with-unixodbc-- with-ssh3-- enable-java
Note: when executing the parameter-with-mysql, you need to add the specific configuration file under the mysql installation path. The following parameters are as far as possible to configure relatively complete zabbix functional components and parameters in the intranet environment.
Installation:
[root@local zabbix-4.4] # make & & make install
Prepare the MySQL database environment used by zabbix:
Note:
If you do not deal with the MySQL database separately after one-click installation of LNMP, there will be an error when creating a user and authorizing it. The reason for the error is that you cannot execute the command and log in with the root user in the user table space and time. (this is the case in my environment. I don't know if it is an isolated case. If you have no problem with the installation, just execute the following command directly.)
[root@local zabbix-4.4] # mysql-uroot-proot123mysql > create database zabbix character set utf8;mysql > grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';mysql > flush privileges
Execute the database environment script included in the zabbix source code package, and follow these steps to import the database:
[root@local zabbix-4.4] # cd / usr/local/src/zabbix-2.4.5/database/mysql/ [root@local mysql] # mysql-uzabbix-p123456 zabbix < schema.sql [root@local mysql] # mysql-uzabbix-p123456 zabbix < images.sql [root@local mysql] # mysql-uzabbix-p123456 zabbix < data.sql
3. Configure zabbix
Create the zabbix log directory, and I put the log directory with the zabbix installation directory:
[root@local ~] # cd / data/zabbix [root@local zabbix] # mkdir log [root@local zabbix] # chown zabbix:zabbix log
Copy and configure the startup script that comes with the zabbix source package:
[root@local ~] # cd / root/zabbix-4.4 [root@local zabbix-4.4] # cp misc/init.d/fedora/core/zabbix_* / etc/init.d/ [root@local zabbix-4.4] # chmod 755 / etc/init.d/zabbix_* [root@local zabbix-4.4] # vi / etc/init.d/zabbix_serverBASEDIR=/data/ Zabix [root @ local zabbix-4.4] # vi / etc/init.d/zabbix_agentdBASEDIR=/data/zabbix
Configure the zabbix_server.conf server profile:
[root@local zabbix-4.4] # vi / data/zabbix/etc/zabbix_server.confLogFile=/data/zabbix/log/zabbix_server.logDBName=zabbixDBUser=zabbixDBPassword=zabbixDBSocket=/tmp/mysql.sockDBPort=3306LogSlowQueries=1000
Copy the zabbix web page file to the nginx directory and rename it to zabbix:
[root@local ~] # cd / root/zabbix-4.4 [root@local zabbix-4.4] # cp-r frontends/php/ / home/wwwroot/zabbix [root@zabbix zabbix-2.4.5] # chown-R www:www/var/www/html/zabbix/
Note: NGINX is installed with one click of LNMP, and the default web page access path is / home/wwwroot/default. After copying and renaming the zabbix web page file, you need to modify the nginx configuration file to change the default access path to / home/wwwroot/zabbix. Configuration file location: / usr/local/nginx/conf/nginx.conf, modify the path specified in server, and then restart the NGINX service.
Enable the zabbix service:
[root@local ~] # / etc/init.d/zabbix_server start
Direct access: http://ip
You can see the initialization configuration interface of zabbix (since the private network cannot take screenshots, you can only find a screenshot reference-_ -):
Follow the prompts to click step by step. The next step is as follows. In this step, because you install the PHP environment installed by LNMP with one click, the PHP parameters may not meet the requirements. You can modify the parameters in the parameters file (/ usr/local/php/etc/php.ini) to adjust them:
Configure the zabbix user of the MySQL database in this step (fill in the port 0 for the latter database port 3306)
But the following error may occur when you click on the next step when you configure the mysql database (it would be better if you didn't! ):
If the above error occurs, and the error prompt is an error like Unsupported cahrset or collcation for tables, which is impossible to start, it is mostly due to an error in create database when you configure the mysql database. You can fix it by using the method:
1. Delete the original database. Drop database zabbix
two。 Create a new zabbix database, command: create database zabbix character set utf8 collate utf8_bin
3. Re-enter the database table contents of zabbix
Mysql-uroot-p123456 zabbix < schema.sql
Mysql-uroot-p123456 zabbix < images.sql
Mysql-uroot-p123456 zabbix < data.sql
Then refresh the web interface and see that the data connection is working. Then you can configure the next step, enter the IP address and port of the server where the zabbix server resides (by default), and the name option can be left empty or defined by yourself:
Click on the preview and then the completion will take you to the login screen, as follows, enter the default user and password Admin/zabbix. You can log on to the main page:
At this point, I believe you have a deeper understanding of "the detailed process of installing zabbix services on Linux systems". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.