安装rocky9
阿里巴巴开源镜像站http://mirrors.aliyun.com
1、Rocky
2、初始化 防火墙
systemctl stop firewalld
systemctl disable filewalld
或者
systemctl disable firewalld --now
3、selinux
vi /etc/selinux/config
配置源 sed -e 's|^mirrorlist=|#mirrorlist=|g' \-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.aliyun.com/rockylinux|g' \ -i.bak \ /etc/yum.repos.d/rocky*.repo
//按照笔记配置,图片中有些出入
4、固定IP地址:
vim /etc/NetworkManager/system-connections/ens33.nmconnection
[ipv4]
method=manual
address=192.168.100.136/24,192.168.100.2
dns=223.5.5.5
5、重启网络服务
systemctl restart NetworkManager /
6、测试:
ping baidu.com
如果ping域名无法ping通,但是可以ping通公网IP vim /etc/resolv.conf nameserver 223.5.5.5
rocky linux 9部署zabbix6
zabbix官网http://www.zabbix.com
查看 /etc/yum.repos.d 里面内容
配置官方源
# rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-2.el9.noarch.rpm
# dnf clean all
#yum makecache
安装必要软件
# dnf install glibc-common zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent langpacks-zh_CN
//安装中文语言
安装MySQL数据库
数据库官网http://www.mysql.com
1.下载数据库yum源
# yum -y install https://dev.mysql.com/get/mysql84-community-release-el9-1.noarch.rpm
或者
# rpm -ivh https://dev.mysql.com/get/mysql84-community-release-el9-1.noarch.rpm
2.安装数据库
(1)# cd /etc/yum.repos.d
# ll
# vim mysql-community-repo
将8.0 enable=1,8.4 enable=0;这样安装就是8.0版本了
(2)安装数据库
# yum -y install mysql-sever
3.启动数据库
# systemctl start mysqld
4.获取临时密码
# grep "passwd" /var/log/mysql.log
5.修改密码
# mysqladmin -p'临时密码' password '修改密码'
6.登录数据库
# mysql -p密码
7.创建zabbix数据库
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@'%' identified by 'password';
mysql>grant all privileges on zabbix.* to zabbix@'%';
mysql>set global log_bin_trust_function_creators = 1;
mysql> \q
8.导入数据 登录数据库
导入数据
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
或者
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p密码 zabbix
登录数据库
# mysql -p mima
mysql > set global log_bin_trust_function_creators = 0;
mysql>\q
修改 Zabbix server 配置文件
vim /etc/zabbix/zabbix_server.conf
DBPassword=password
为 Zabbix 前端配置 PHP
vim /etc/nginx/conf.d/zabbix.conf
# listen 80;
# server_name -;
启动 Zabbix server 和 agent 进程
# systemctl restart zabbix-server zabbix-agent nginx php-fpm
# systemctl enable zabbix-server zabbix-agent nginx php-fpm
登录界面
用户名:Adimn
密码:zabiix