Centos7安装部署Zabbix6
时间: 2023-07-05 20:18:26 浏览: 155
centos7安装zabbix
以下是在CentOS 7上安装和部署Zabbix 6的步骤:
1. 安装必要的软件包:
```
sudo yum install epel-release -y
sudo yum install wget httpd php php-mysql php-gd php-xml php-bcmath php-mbstring mariadb mariadb-server -y
```
2. 启动MariaDB服务,并设置root密码:
```
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
```
3. 创建Zabbix数据库和用户,并授予必要的权限:
```
sudo mysql -uroot -p
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;
```
4. 导入Zabbix数据库模板:
```
sudo wget https://repo.zabbix.com/zabbix/6.0/mysql/schema.sql
sudo mysql -uzabbix -p zabbix < schema.sql
```
5. 安装Zabbix服务器和代理:
```
sudo rpm -ivh https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-release-6.0-1.el7.noarch.rpm
sudo yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
```
6. 编辑Zabbix服务器配置文件`/etc/zabbix/zabbix_server.conf`,配置数据库连接信息:
```
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=password
```
7. 启动Zabbix服务器和代理:
```
sudo systemctl start zabbix-server zabbix-agent httpd
sudo systemctl enable zabbix-server zabbix-agent httpd
```
8. 配置防火墙规则,允许Zabbix Web访问端口:
```
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload
```
9. 访问Zabbix Web界面,进行初始化配置:
在浏览器中输入`http://<your-server-ip>/zabbix`,进入Zabbix Web初始化界面,按照提示进行配置即可。
以上是在CentOS 7上安装和部署Zabbix 6的步骤。
阅读全文