soyou盘启动 (soyou盘启动bios设置)

zabbix5.0版本和4.0还是有很大的差别,今天更新一下zabbix的5.0搭建过程。

一、准备

主机

IP

配置

系统

zabbix-server

10.30.59.242

2vcpu/4G内存/40G硬盘

centos7-1511

二、安装步骤

安装声明: 本次安装是安装rpm包、web使用nginx

1、关闭防火墙

[root@localhost ~]# systemctl stop firewalld[root@localhost ~]# systemctl disable firewalldRemoved symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.[root@localhost ~]# setenforce 0[root@localhost ~]# vi /etc/selinux/config[root@localhost ~]# iptables -F[root@localhost ~]# iptables -X[root@localhost ~]# iptables -Z[root@localhost ~]# iptables-save# Generated by iptables-save v1.4.21 on Tue Jun 22 01:32:04 2021*filter:INPUT ACCEPT [18:1204]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [10:1048]COMMIT# Completed on Tue Jun 22 01:32:04 2021


2、下载zabbix

rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm


官网的yum源是国外的,为了提高速度,这里改为国内的。

[root@localhost ~]# sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo[root@localhost ~]# yum clean all# 下载zabbix-server zabbix-agent[root@localhost ~]# yum install zabbix-server-mysql zabbix-agent -y


3、安装Software Collections。

SCL可以让你在同一个操作系统上安装和使用多个版本的软件,而不会影响整个系统的安装包,软件包会安装在/opt/rh目录下。

[root@localhost ~]# yum install 电脑 -y centos-release-scl


4、安装web环境

# 修改yum源,开启frontend[root@localhost ~]# vi /etc/yum.repos.d/zabbix.repo[zabbix-frontend]name=Zabbix Official Repository frontend - $basearchbaseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontendenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591[root@localhost ~]# yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl -y


5、MySQL配置

# 安装MySQL[root@localhost ~]# yum install -y mariadb-server# 启动服务[root@localhost ~]# systemctl start mariadb# 初始化[root@localhost ~]# mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB 电脑 to secure it, we'll need the currentpassword for the root user. If you've just installed MariaDB, andyou 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 MariaDBroot user without the proper authorisation.Set root password? [Y/n] y # 修改用户密码New password: 000000 # 输入新的用户密码Re-enter new password:000000 # 重新输入Password updated successfully!Reloading privilege tables..... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should 电脑 remove them before moving into aproduction environment.Remove anonymous users? [Y/n] y # 移除匿名用户... Success!Normally, root should only be allowed to connect from 'localhost'. Thisensures 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 canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] y # 删除test数据库- Dropping test database...... Success!- Removing privileges on test database...... Success!Reloading the privilege tables will ensure that all changes made so farwill 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 MariaDBinstallation should now be secure.Thanks for using MariaDB![root@localhost ~]# mysql -uroot -p000000Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 9Server version: 5.5.68-MariaDB MariaDB ServerCopyright (c) 2000, 2018, 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) # 创建zabbix数据库 指定字符编码utf8MariaDB [(none)]> create user zabbix@localhost identified by '000000';Query OK, 0 rows affected (0.00 sec) # 创建本地用户zabbix 密码000000MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;Query OK, 0 rows 电脑 affected (0.00 sec) # 让zabbix用户有zabbix数据库的所有权限。MariaDB [(none)]> flush privileges; # 刷新权限Query OK, 0 rows affected (0.00 sec)# 导入初始架构和数据,[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p000000# 如果报错第一行没有数据,在配置文件第一行加 use zabbix;


6、配置zabbix

配置zabbix server数据库

[root@localhost ~]# vim /etc/zabbix/zabbix_server.confDBPassword=000000[root@localhost ~]# vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf# 取消这两行注释# 这里要改为自己虚拟机的IP,大坑 !# listen 80;# server_name 10.30.59.242;[root@localhost ~]# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conflisten.acl_users = apache,nginxphp_value[date.timezone] = Asia/Shanghai# 重启服务[root@localhost ~]# systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm# 开机自启[root@localhost ~]# systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpmCreated symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.Created symlink from /etc/systemd/system/multi-user.target.wants/rh-nginx116-nginx.service to /usr/lib/systemd/system/rh-nginx116-nginx.service.Created symlink from /etc/systemd/system/multi-user.target.wants/rh-php72-php-fpm.service to /usr/lib/systemd/system/rh-php72-php-fpm.service.


7、搭建完成

搭建完成

配置语言

编辑语言

解决乱码

可以看到这里是有一些没有加载出来的,需要我们解决一下。

字符乱码

zabbix的原来字体是这个/usr/share/fonts/dejavu/DejaVuSans.ttf,然后直接在自己电脑C:\Windows\Fonts字体里找到一款喜欢的中文字体上传到这个目录中,替换掉原来的字体。

[root@localhost dejavu]# cd /usr/share/fonts/dejavu/[root@localhost dejavu]# lsDejaVuSans-BoldOblique.ttf DejaVuSansCondensed-Bold.ttf DejaVuSans-ExtraLight.ttf STFANGSO.TTFDejaVuSans-Bold.ttf DejaVuSansCondensed-Oblique.ttf DejaVuSans-Oblique.ttfDejaVuSansCondensed-BoldOblique.ttf DejaVuSansCondensed.ttf DejaVuSans.ttf[root@localhost dejavu]# mv DejaVuSans.ttf DejaVuSans.ttf.bak[root@localhost dejavu]# mv STFANGSO.TTF DejaVuSans.ttf


问题解决


电脑 电脑