实验环境

虚拟机两台,一台公网地址为 1.1.1.1,部署 zabbix server,一台公网地址为 1.1.1.2,部署 zabbix proxy,系统为centos7.2。

1 zabbix server部署

1.1 准备工作

配置防火墙

systemctl start firewalld
systemctl enable firewalld
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="1.1.1.2/32" port port="10051" protocol="tcp" accept"
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="1.1.1.2/32" port port="123" protocol="udp" accept"
firewall-cmd --reload

配置selinux

setenforce 0
vim /etc/sysconfig/selinux
SELINUX=disabled

1.2 安装 server

安装 zabbix库

rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all

如果出现 curl: (60) The certificate issuer's certificate has expired. Check your system date and time 报错,则需要更新证书

yum install -y ca-certificates
update-ca-trust extract

安装 zabbix server

mariadb

yum install -y zabbix-server-mysql

PostgreSQL

yum install -y zabbix-server-pgsql

安装 zabbix 前端

yum install -y centos-release-scl
vim /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
enabled=1

Mariadb

yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl

PostgreSQL

yum install -y zabbix-web-pgsql-scl zabbix-apache-conf-scl

安装 mariadb

yum install -y mariadb-server
vim /etc/my.cnf
max_connections = 4096
character-set-server = utf8
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation 设置root密码为r00tP@ssw0rd
mysql -uroot -p'r00tP@ssw0rd'
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'z@bbixP@ssw0rd';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p'z@bbixP@ssw0rd' zabbix

安装 PostgreSQL

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql14-server
/usr/pgsql-14/bin/postgresql-14-setup initdb

配置

systemctl enable postgresql-14
systemctl start postgresql-14
sudo -u postgres createuser --pwprompt zabbix 设置密码为z@bbixP@ssw0rd
sudo -u postgres createdb -O zabbix zabbix
zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix

安装timescaledb

tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/$(rpm -E %{rhel})/\$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL
yum -y update
yum install -y timescaledb-2-postgresql-14
timescaledb-tune --pg-config=/usr/pgsql-14/bin/pg_config
systemctl restart postgresql-14
sudo -u zabbix psql zabbix
CREATE EXTENSION IF NOT EXISTS timescaledb;
zcat /usr/share/doc/zabbix-server-pgsql*/timescaledb.sql.gz | sudo -u zabbix psql zabbix

配置 php

修改时区

vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai

修改端口

vim /etc/httpd/conf/httpd.conf
Listen 12345

启动 zabbix server

vim /etc/zabbix/zabbix_server.conf
DBPassword=z@bbixP@ssw0rd
systemctl start zabbix-server httpd rh-php72-php-fpm
systemctl enable zabbix-server httpd rh-php72-php-fpm

配置zabbix前端

访问 http://1.1.1.1:12345/zabbix 按照提示配置,默认密码 Admin/zabbix,立即修改,并限制guest访问

1.3 配置ntp服务端

由于agent与server之间时间相差过大容易造成nodata的误告警,强烈建议设置时间同步

yum install –y ntp
vim /etc/ntp.conf
Server ntp.ntsc.ac.cn iburst
systemctl start ntpd
systemctl enable ntpd

检查ntp服务状态

ntpstat
ntpq -p

1.4 安装agent

yum install -y zabbix-agent
systemctl start zabbix-agent
systemctl enable zabbix-agent

2 zabbix proxy部署

2.1 准备工作

配置防火墙

systemctl start firewalld
systemctl enable firewalld
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="1.1.1.1/32" port port="10050" protocol="tcp" accept"
firewall-cmd --reload

配置selinux

setenforce 0
vim /etc/sysconfig/selinux
SELINUX=disabled

配置时间同步

vim /etc/chrony.conf
server 1.1.1.1 iburst
systemctl start chronyd

2.2 安装 proxy

安装 proxy

rpm -ivh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum-config-manager --enable rhel-7-server-optional-rpms
yum install -y zabbix-proxy-mysql

如果出现 curl: (60) The certificate issuer's certificate has expired. Check your system date and time 报错,则需要更新证书

yum install -y ca-certificates
update-ca-trust extract

安装 mariadb

yum install -y mariadb-server
vim /etc/my.cnf
max_connections = 4096
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation 设置root密码为r00tP@ssw0rd
mysql -uroot -p'r00tP@ssw0rd'
mysql> create database zabbix_proxy character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'z@bbixP@ssw0rd';
mysql> grant all privileges on zabbix_proxy.* to zabbix@localhost;
mysql> quit;
zcat /usr/share/doc/zabbix-proxy-mysql*/schema.sql.gz | mysql -uzabbix -p'z@bbixP@ssw0rd' zabbix_proxy

启动 proxy

web配置

vim /etc/zabbix/zabbix_proxy.conf
Server=1.1.1.1
Hostname=ZabbixProxy01
DBPassword=z@bbixP@ssw0rd
systemctl start zabbix-proxy
systemctl enable zabbix-proxy

2.3 安装agent

web配置

yum install -y zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
Hostname=ZabbixProxy01
Server=1.1.1.1
systemctl start zabbix-agent
systemctl enable zabbix-agent

公网环境部署zabbix5.0的更多相关文章

  1. ELK实时日志分析平台环境部署--完整记录

    在日常运维工作中,对于系统和业务日志的处理尤为重要.今天,在这里分享一下自己部署的ELK(+Redis)-开源实时日志分析平台的记录过程(仅依据本人的实际操作为例说明,如有误述,敬请指出)~ ==== ...

  2. ELK实时日志分析平台环境部署--完整记录(转)

    在日常运维工作中,对于系统和业务日志的处理尤为重要.今天,在这里分享一下自己部署的ELK(+Redis)-开源实时日志分析平台的记录过程(仅依据本人的实际操作为例说明,如有误述,敬请指出)~ ==== ...

  3. mongodb基础环境部署(windows系统下)

    Normal 0 false 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNorma ...

  4. Zabbix5.0服务端部署

    Zabbix5.0服务端部署 基础环境配置 [root@localhost ~]# systemctl disable --now firewalld Removed symlink /etc/sys ...

  5. DotNet Core 1.0 集成 CentOS 开发与运行环境部署

    一.     DotNet Core 1.0 开发环境部署 操作系统安装 我们使用CentOS 7.2.1511版本. 安装libunwind库 执行:sudo yum install libunwi ...

  6. ubuntu12.04+hadoop2.2.0+zookeeper3.4.5+hbase0.96.2+hive0.13.1伪分布式环境部署

    目录: 一.hadoop2.2.0.zookeeper3.4.5.hbase0.96.2.hive0.13.1都是什么? 二.这些软件在哪里下载? 三.如何安装 1.安装JDK 2.用parallel ...

  7. 【J2EE】struts-2.3.16.3+apache-tomcat-8.0.9开发环境部署,“Hello World”的实现。

    1.在官网下载Struts2的开发包 下载链接如下: http://120.203.229.30/5ff/2bc79/5ff16ae8698e1c321758a8f03a1bc0939892bc79/ ...

  8. CentOS7+ApacheServer2.4+MariaDB10.0+PHP7.0+禅道项目管理软件8.0环境部署

    CentOS7+ApacheServer2.4+MariaDB10.0+PHP7.0+禅道项目管理软件8.0环境部署 by:授客 QQ:1033553122 目录 一. 二. 三. 四. 五. 六. ...

  9. [2020.03]Unity ML-Agents v0.15.0 环境部署与试运行

    一.ML-Agents简介 近期在学习Unity中的机器学习插件ML-Agents,做一些记录,用以简单记录或交流学习. 先简单说一下机器学习使用的环境场景:高视觉复杂度(Visual Complex ...

  10. linux(centos8):lnmp环境编译安装zabbix5.0

    一,zabbix的用途: zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案 zabbix能监视各种网络参数,保证服务器系统的安全运营: 并提供灵活的通知机制以 ...

随机推荐

  1. 关于 static

    由static定义的被称为类属性 例如(  static String company = "博客园"  ) 类方法 例如(  public static void printCo ...

  2. 如何实现一个sync.Once

    sync.Once 是 golang里用来实现单例的同步原语.Once 常常用来初始化单例资源, 或者并发访问只需初始化一次的共享资源,或者在测试的时候初始化一次测试资源. 单例,就是某个资源或者对象 ...

  3. GE反射内存实时通讯网络解决方案

    时通讯网络是用于需要较高实时性要求的应用领域的专用网络通讯技术,一般采用基于高速网络的共享存储器技术实现.它除了具有严格的传输确定性和可预测性外,还具有速度高.通信协议简单.宿主机负载轻.软硬件平台适 ...

  4. SQL Server数据库判断最近一次的备份执行结果

    1 麻烦的地方 在SQL Server的官方文档里面可以看到备份和还原的表,但是这些表里面只能找到备份成功的相关信息,无法找到备份失败的记录,比如msdb.dbo.backupset.对于一些监控系统 ...

  5. nuxt下运行项目时内存溢出(out of memory)的一种情况

    话不多说直接上代码: 如图,点红点的三行引入了一个组件,内容是同意注册协议的弹窗.但是在run dev的时候提示说内存溢出了(out of memory)...经过多方排查,定位到这个组件,警察叔叔就 ...

  6. 2021-02-23:给定一个正数n,求n的裂开方法数。规定:后面的数不能比前面的数小 。比如4的裂开方法有: 1+1+1+1、1+1+2、1+3、2+2、4,5种,所以返回5。

    2021-02-23:给定一个正数n,求n的裂开方法数.规定:后面的数不能比前面的数小 .比如4的裂开方法有: 1+1+1+1.1+1+2.1+3.2+2.4,5种,所以返回5. 福哥答案2021-0 ...

  7. Strings must be encoded before hashing

    Strings must be encoded before hashing 当我们将字符串传递给 hash 算法时,会出现 "TypeError: Strings must be enco ...

  8. 【源码解读】asp.net core源码启动流程精细解读

    引言 core出来至今,已经7年了,我接触也已经4年了,从开始的2.1,2.2,3.1,5,6再到如今的7,一直都有再用,虽然我是一个Winform仔,但是源码一直从3.1到7都有再看,然后在QQ上面 ...

  9. flutter 中使用 WebView加载H5页面异常net:ERR_CLEARTEXT_NOT_PERMITTED

    最近有个flutter项目中根据搜索结果跳转到相应的H5页面发现老是报错,曾现在闲暇拉出来解决哈 先来看一个搜索功能的测试 已进入详情页面就提示错误,尴尬了. 只有去检测代码了撒 Search.dar ...

  10. vue对vue-giant-tree进行节点操作

    vue 项目中使用到了vue-giant-tree这个使用ztree封装的树形插件,在对其节点进行操作时遇到了无法向传统的jquery那样获取到ztreeObj:而导致了无法控制节点dom:浪费了许多 ...