小白都能看懂的Linux系统下安装配置Zabbix

 

实验环境:

操作系统:Centos 7.6

服务器ip:192.168.10.100

运行用户:root

网络环境:Internet

Zabbix是一个基于web界面的提供分布式系统监控及网络功能的企业级的开源监控工具,做为一个企业运维人员来说,zabbix可以给企业和运维人员带来很大的帮助,zabbix是一个功能非常强大、跨平台、开源的企业级运维管理系统,由2部分构成:zabbix服务端和客户端(agentd),也可以通过系统自带的SNMP来采集数据。

Zabbix可以部署在Windows、Linux、unix、MAC OS等平台上,可以监控任何网络设备、操作系统、中间件、数据库等,做为一个企业的运维技术人来说,监控是非常重要的,确保线上业务能够稳定运行,企业线上运行的和服务器网络设备等多不少,所以,我们可以通过监控发现服务器故障,方便运维人员技术发现问题和解决问题,并且可以通过企业微信、企业QQ、企业钉钉、短信实现报警功能,有故障可以及时的通过管理员;开源的监控系统还有nagios、cacti、ganglia,我们在这里只详细的介绍zabbix监控,不过要想搭建zabbix监控系统还是需要有Linux技术,要有对Linux有所了解并且熟悉一些常见的命令及配置,现在企业运维也是必不可少的,如果想往运维方向发展的可以去了解下《Linux就该这么学》这边教程,里面的内容非常详细,比较适合初学者,如果觉得自己有Linux基础可以参考下面的安装步骤,通过源码来编译部署并配置zabbix企业运维监控系统。

 

1、install php      //通过yum源安装php及一些与php相关的库

# yum install php.x86_64 php-cli.x86_64 php-fpm php-gd php-json php-ldap php-mbstring php-mysqlnd php-xml php-xmlrpc php-opcache php-simplexml php-bcmath.x86_64 -y

2、install database      //yum源安装MySQL(Mariadb)数据库服务端和客户端

# yum install mariadb.x86_64 mariadb-devel.x86_64 mariadb-server.x86_64 -y

# systemctl start mariadb.service            //启动数据库

3、初始化数据库

[root@localhost ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

 

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 ... Success!

 

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n

 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] n

 ... skipping.

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

3、install apache        //yum源安装apache

# yum install httpd.x86_64 -y

4、install zabbix_server      //源码安装zabbix服务端和客户端

# tar -zxvf zabbix-3.4.9.tar.gz && cd zabbix-3.4.9

# groupadd zabbix && useradd -g zabbix Zabbix          //创建zabbix用户及组

#./configure --prefix=/usr/local/zabbix user=zabbix group=zabbix --enable-server --enable-agent --enable-proxy --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2        //配置编译

# make install           //编译通过后安装zabbix server

5、创建zabbix数据库及zabbix数据库用户并授权

[root@zabbix ~]# mysql -u root -p Enter password:  Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.47-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

Query OK, 1 row affected (0.00 sec) 

MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY "password";

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;Q

uery OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit Bye

6、导入zabbix默认数据库:

#cd /root/zabbix-3.4.9/database/mysql

# mysql -uroot -p zabbix < schema.sql && mysql -uroot -p zabbix < images.sql && mysql -uroot -p zabbix < data.sql

7、编辑默认安装配置文件

# vim /usr/local/etc/zabbix_server.conf  

# vim /usr/local/zabbix/etc/zabbix_server.conf

ListenPort=10051              //监听端口

DBHost=localhost              //数据库服务器

DBName=Zabbix            //数据库名

DBUser=Zabbix            //数据库用户名

DBPassword=password      //数据库密码

8、编辑并配置zabbix启动脚本,并设置开机自动启动

#cd /root/zabbix-3.4.9/misc/init.d/tru64

# cp -r /root/zabbix-3.4.9/misc/init.d/tru64/zabbix_* /etc/init.d/

# chmod +x /etc/init.d/zabbix* 

#chown -R zabbix:zabbix /usr/local/zabbix

# cp -r /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/

#/etc/init.d/zabbix_server restart

#/etc/init.d/zabbix_agentd restart

9、拷贝zabbix web端文件到apache根目录下面

#cd /root/zabbix-3.4.9/frontends/

# mkdir -p /var/www/html/zabbix/

#cp -ra php/* /var/www/html/zabbix/

10、访问web端

http://ip/zabbix

错误如下:

  1. Minimum required size of PHP post is 16M (configuration option "post_max_size").
  2. Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time").
  3. Minimum required limit on input parse time for PHP scripts is 300 (configuration option "max_input_time").
  4. Time zone for PHP is not set (configuration parameter "date.timezone").
  5. At least one of MySQL, PostgreSQL, Oracle or IBM DB2 should be supported.
  6. PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).
  7. PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).
  8. PHP gd extension missing (PHP configuration parameter --with-gd).
  9. PHP gd PNG image support missing.
  10. PHP gd JPEG image support missing.
  11. PHP gd FreeType support missing.
  12. PHP xmlwriter extension missing.
  13. PHP xmlreader extension missing.

解决步骤:

#vim /etc/php.ini

post_max_size8M16M

max_execution_time30300

max_input_time60300

date.timezone = Asia/Shanghai

#systemctl restart httpd.service

先下载zabbix.conf.php配置文件,再把下载的zabbix.conf.php配置的配置文件上传到/var/www/html/zabbix/conf/目录下。

#systemctl restart httpd.service            //重启apache 服务

11、管理员信息

user/password:Admin/Zabbix         //Zabbix 前端默认用户名和密码,如果是企业使用搭建成功后一定要修改密码,也可以把用户名修改这样安全些。

12、client install zabbix_agentd             //源码编译安装zabbix_agentd客户端

#./configure --prefix=/usr/local/zabbix --enable-agent

# make install

13、修改agentd配置文件

# vim /usr/local/zabbix/etc/zabbix_agentd.conf

LogFile=/usr/local/zabbix/log/zabbix_agentd.log

EnableRemoteCommands=0

Server=192.168.10.100

ServerActive=192.168.10.100

Hostname=192.168.10.100

Timeout=30

小白都能看懂的Linux系统下安装配置Zabbix

实验环境:

操作系统:Centos 7.6

服务器ip:192.168.10.100

运行用户:root

网络环境:Internet

Zabbix是一个基于web界面的提供分布式系统监控及网络功能的企业级的开源监控工具,做为一个企业运维人员来说,zabbix可以给企业和运维人员带来很大的帮助,zabbix是一个功能非常强大、跨平台、开源的企业级运维管理系统,由2部分构成:zabbix服务端和客户端(agentd),也可以通过系统自带的SNMP来采集数据。

Zabbix可以部署在Windows、Linux、unix、MAC OS等平台上,可以监控任何网络设备、操作系统、中间件、数据库等,做为一个企业的运维技术人来说,监控是非常重要的,确保线上业务能够稳定运行,企业线上运行的和服务器网络设备等多不少,所以,我们可以通过监控发现服务器故障,方便运维人员技术发现问题和解决问题,并且可以通过企业微信、企业QQ、企业钉钉、短信实现报警功能,有故障可以及时的通过管理员;开源的监控系统还有nagios、cacti、ganglia,我们在这里只详细的介绍zabbix监控,不过要想搭建zabbix监控系统还是需要有Linux技术,要有对Linux有所了解并且熟悉一些常见的命令及配置,现在企业运维也是必不可少的,如果想往运维方向发展的可以去了解下《Linux就该这么学》这边教程,里面的内容非常详细,比较适合初学者,如果觉得自己有Linux基础可以参考下面的安装步骤,通过源码来编译部署并配置zabbix企业运维监控系统。

 

1、install php      //通过yum源安装php及一些与php相关的库

# yum install php.x86_64 php-cli.x86_64 php-fpm php-gd php-json php-ldap php-mbstring php-mysqlnd php-xml php-xmlrpc php-opcache php-simplexml php-bcmath.x86_64 -y

2、install database      //yum源安装MySQL(Mariadb)数据库服务端和客户端

# yum install mariadb.x86_64 mariadb-devel.x86_64 mariadb-server.x86_64 -y

# systemctl start mariadb.service            //启动数据库

3、初始化数据库

[root@localhost ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

 

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 ... Success!

 

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n

 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] n

 ... skipping.

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

3、install apache        //yum源安装apache

# yum install httpd.x86_64 -y

4、install zabbix_server      //源码安装zabbix服务端和客户端

# tar -zxvf zabbix-3.4.9.tar.gz && cd zabbix-3.4.9

# groupadd zabbix && useradd -g zabbix Zabbix          //创建zabbix用户及组

#./configure --prefix=/usr/local/zabbix user=zabbix group=zabbix --enable-server --enable-agent --enable-proxy --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2        //配置编译

# make install           //编译通过后安装zabbix server

5、创建zabbix数据库及zabbix数据库用户并授权

[root@zabbix ~]# mysql -u root -p Enter password:  Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.47-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

Query OK, 1 row affected (0.00 sec) 

MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY "password";

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;Q

uery OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit Bye

6、导入zabbix默认数据库:

#cd /root/zabbix-3.4.9/database/mysql

# mysql -uroot -p zabbix < schema.sql && mysql -uroot -p zabbix < images.sql && mysql -uroot -p zabbix < data.sql

7、编辑默认安装配置文件

# vim /usr/local/etc/zabbix_server.conf  

# vim /usr/local/zabbix/etc/zabbix_server.conf

ListenPort=10051              //监听端口

DBHost=localhost              //数据库服务器

DBName=Zabbix            //数据库名

DBUser=Zabbix            //数据库用户名

DBPassword=password      //数据库密码

8、编辑并配置zabbix启动脚本,并设置开机自动启动

#cd /root/zabbix-3.4.9/misc/init.d/tru64

# cp -r /root/zabbix-3.4.9/misc/init.d/tru64/zabbix_* /etc/init.d/

# chmod +x /etc/init.d/zabbix* 

#chown -R zabbix:zabbix /usr/local/zabbix

# cp -r /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/

#/etc/init.d/zabbix_server restart

#/etc/init.d/zabbix_agentd restart

9、拷贝zabbix web端文件到apache根目录下面

#cd /root/zabbix-3.4.9/frontends/

# mkdir -p /var/www/html/zabbix/

#cp -ra php/* /var/www/html/zabbix/

10、访问web端

http://ip/zabbix

错误如下:

  1. Minimum required size of PHP post is 16M (configuration option "post_max_size").
  2. Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time").
  3. Minimum required limit on input parse time for PHP scripts is 300 (configuration option "max_input_time").
  4. Time zone for PHP is not set (configuration parameter "date.timezone").
  5. At least one of MySQL, PostgreSQL, Oracle or IBM DB2 should be supported.
  6. PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).
  7. PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).
  8. PHP gd extension missing (PHP configuration parameter --with-gd).
  9. PHP gd PNG image support missing.
  10. PHP gd JPEG image support missing.
  11. PHP gd FreeType support missing.
  12. PHP xmlwriter extension missing.
  13. PHP xmlreader extension missing.

解决步骤:

#vim /etc/php.ini

post_max_size8M16M

max_execution_time30300

max_input_time60300

date.timezone = Asia/Shanghai

#systemctl restart httpd.service

先下载zabbix.conf.php配置文件,再把下载的zabbix.conf.php配置的配置文件上传到/var/www/html/zabbix/conf/目录下。

#systemctl restart httpd.service            //重启apache 服务

11、管理员信息

user/password:Admin/Zabbix         //Zabbix 前端默认用户名和密码,如果是企业使用搭建成功后一定要修改密码,也可以把用户名修改这样安全些。

12、client install zabbix_agentd             //源码编译安装zabbix_agentd客户端

#./configure --prefix=/usr/local/zabbix --enable-agent

# make install

13、修改agentd配置文件

# vim /usr/local/zabbix/etc/zabbix_agentd.conf

LogFile=/usr/local/zabbix/log/zabbix_agentd.log

EnableRemoteCommands=0

Server=192.168.10.100

ServerActive=192.168.10.100

Hostname=192.168.10.100

Timeout=30

原文地址:https://blog.csdn.net/LaoMeng2019/article/details/90691164

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


安装开始...1.打开“https://dev.mysql.com/downloadsepo/yum/”下载Mysql源      将下载好的mysql源上传linux服务器 2.yumlocalinstallmysql80*#安装源 centos7中默认安装的是mariadb数据库,如果想要安装mysql,首先要移除mariadb;
安装Helm3#官网下载慢#wgethttps://get.helm.sh/helm-v3.5.4-linux-amd64.tar.gzwgethttp://qiniu.dev-share.top/helm-v3.5.4-linux-amd64.tar.gztar-zxvfhelm-v3.5.4-linux-amd64.tar.gzcplinux-amd64/helm/usr/local/bin#查看helmclient版本helmversion
通过Linux命令行启动用的指令:systemctlstartmariadb.service反馈:Failedtostartmariadb.service:Unitmariadb.servicenotfound.MariaDB简介MariaDB是MySQL的一个分支,MariaDB打算保持与MySQL的高度兼容性,确保具有库二进制奇偶校验的直接替换功能,以及与MySQLAPI和命令
InstallingMariaDBServer10.4TodeployMariaDBCommunityServer10.4onRHEL7orCentOS7,firstdownloadandusethe mariadb_repo_setup scripttoconfiguretheMariaDBrepositoriesforYUM:$sudoyuminstallwget$wgethttps://downloads.mariadb.com/
阅读目录一什么是存储引擎二mysql支持的存储引擎三使用存储引擎一什么是存储引擎mysql中建立的库--> 文件夹库中建立的表--> 文件现实生活中我们用来存储数据的文件有不同的类型,每种文件类型对应各自不同的处理机制:比如处理文本用txt类型,处理表格用excel,处理图片
1、安装MariaDB安装命令yum-yinstallmariadbmariadb-server安装完成MariaDB,首先启动MariaDBsystemctlstartmariadb设置开机启动systemctlenablemariadb[root@node1~]#systemctlenablemariadbCreatedsymlinkfrom/etc/systemd/system/multi-user.target.wants/m
Centos7.5 刚安装的mariadb数据库报错报错:ERROR1045(28000):Accessdeniedforuser'root'@'localhost'(usingpassword:NO)原因一:没有启动数据库解决方法:systemctlstartmariadbsystemctlenablemariadb原因二:未知解决方法:[root@db01~]#
基于YUM安装的mariadb多实例.=================================================================1.yum安装mariadb-server包#yuminstallmariadb-server2.创建多实例对应的目录结构#mkdir/mysql/{3306,3307,3308}/{data,etc,socket,log,bin,pid}-pv#tree/mysql//mysql/
一、系统环境[root@localhost~]#cat/etcedhat-releaseCentOSLinuxrelease7.6.1810(Core)二、mysql安装#yuminstallmysqlmysql-servermysql-devel安装mysql-server失败,如下图:[root@localhost~]#yuminstallmysql-serverLoadedplugins:fastestmirrorLoadingm
数据库的选择两大点是:开源和跨平台,满足这三点MySQL、MongoDB和MariaDB。其中MariaDB是MySQL的分支,也是它的进阶产品,未来很有可能替代MySQL。与MySQL相比较,MariaDB更强的地方在于:Maria 存储引擎PBXT存储引擎XtraDB 存储引擎FederatedX 存储引擎更快的复制查询处理线
使用Navicat连接数据库时出现了 HostxxxisnotallowedtoconnecttothisMariaDbserver的情况。发现了是因为授权的问题,使得连接权限受阻。所以,只需要进入数据库中,给予其权限即可。具体解决代码如下:[root@localhost~]#mysql-uroot-pEnterpassword:#首先进入mys
1.临时表当绘画结束时,临时表会自动销毁,无法用showtables查看临时表。MariaDB[jason]>createtemporarytabletmp(prochar(30),citychar(30));QueryOK,0rowsaffected(0.01sec)MariaDB[jason]>insertintotmpvalues('shanghai','shanghai');QueryOK,1
为了看阳光我来到世上数据库介绍数据库是一个存放数据的仓库,目前市面上最流行的数据库大致氛围的两种,一种叫做关系型数据库,一种叫做非关系型数据库,而关系型数据库近期流行的即为mysql,mysql原本是一个开源的数据库后被oracle公司收购,开始进行服务收费,因此,市面上大多数免费
1,Linux上的mysql MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松
启动Mariadb前提需安装mariadb-server-安装mariadb-serveryuminstall-ymariadb-server-启动服务systemctlstartmariadb.service-添加到开机启动systemctlenablemariadb.service-安全设置,以及修改数据库管理员密码mysql_secure_installation-启
1、查看是否安装及可用安装:yumlist|grepmaria2、安装maria(依赖其他几个安装包):yuminstallmariadb-server.x86_64输入'y'继续安装直到安装结束3、检查是否安装:4、安装完后登录提示错误:mysql-uroot-p是由于安装完但是并未启动maria服务5、启动maria有以下几种方法:system
通过yum安装mariadb,并配置MySQL主从服务器主服务器:192.168.10.11从服务器:192.168.10.12#!/bin/bash#====================================================#Author:Mr.Song#CreateDate:2019-02-21#Description:autoconfigMySQLmaster&slave#=====================
实验:实现基于SSL加密的主从复制实验步骤:环境:三台主机,一台CA:200,一台master:150,一台slave:100平时都是在CA上帮用户生成私钥,在服务器上做的1CA,master,slave的证书相关文件mkdir/etc/my.cnf.d/sslcd/etc/my.cnf.d/sslopensslgenrsa2048>cakey.pemopensslreq-new-x509-k
MariaDB[db1]>select*fromstudent;+----+------+-----+--------+-------+|id|name|age|gender|phone|+----+------+-----+--------+-------+|1|a|20|m|119||2|b|20|m|120||3|c|20|m|110
过年了,在老家闲余时间想敲敲代码,发现在安装mariaDb的时候一直报错错误信息:Service‘MySQL’(MySQL)Faildtostart,Verifythatyouhavesuffcientprivilegestostartsystemservices.服务的MySQL(MySQL)启动错误,确认你有权限启动系统服务。记得多年前在使用sqlserver数