Baixe o app para aproveitar ainda mais
Prévia do material em texto
instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 1 / 8 Instalação Zabbix 5.0 - All In One Nesta aula iremos instalar o Zabbix 5.0 - All In One Instalação Zabbix 5.0 - All In One Ambiente utilizado Ajustes após instalação do S.O Verificar o timezone atual Definir timezone Valide a alteração do timezone Verifique a data e hora atual Instalar utilitários Desabilitar SELINUX Editar o arquivo de configuração e desabilitar o SELINUX Instalando Mysql 7 Instalar repositório e pacote do MySQL Habilitar e iniciar serviço do MySQL Verificar senha temporária do MySQL Definir senha do usuário root do MySQL Conectar no banco, criar o banco de dados e o usuário do Zabbix Instalar Zabbix Server Instalar repositório oficial Instalando Zabbix Server Carregar esquema inicial do banco Verificar se o banco de dados foi populado Editar arquivo de configuração do Zabbix Server Habilitar inicialização do serviço e inicia-lo Verifique os logs do Zabbix Server e veja se tem erros Instalar frontend Habilitar Red Hat Software Collections Habilitar o repositório do frontend Instalar os pacotes do frontend Configurando o PHP Habilitar inicialização do serviço e inicia-lo Criar regra no firewall Acesse a interface web Ambiente utilizado Servidor Zabbix Função: MySQL / Zabbix Server / Frontend Sistema Operacional: CentOS 7 (minimal) Memória: 4GB de RAM CPU: 2 vCPU Disco: 50GB instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 2 / 8 Ajustes após instalação do S.O Verificar o timezone atual timedatectl status Definir timezone timedatectl set-timezone America/Sao_Paulo NOTA: Para listar todos os timezone disponíveis utiliza o comando abaixo timedatectl list-timezones | grep Sao_Paulo Valide a alteração do timezone timedatectl status Verifique a data e hora atual date Instalar utilitários yum install -y net-tools vim nano epel-release wget curl tcpdump Desabilitar SELINUX Verificar status atual do SELINUX sestatus Editar o arquivo de configuração e desabilitar o SELINUX É NECESSÁRIO o REBOOT instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 3 / 8 cat /etc/selinux/config vim /etc/selinux/config SELINUX=disabled CASO NÃO QUEIRA DAR REBOOT setenforce 0 sestatus Instalando Mysql 7 Instalar repositório e pacote do MySQL rpm -ivh http://repo.mysql.com/mysql80-community-release-el7.rpm yum install -y mysql-community-server rpm -ivh https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community- server-8.0.23-1.el7.x86_64.rpm yum install mysql-server -y Habilitar e iniciar serviço do MySQL systemctl enable --now mysqld systemctl status mysqld Verificar senha temporária do MySQL grep 'temporary password' /var/log/mysqld.log Output 2021-01-21T13:14:31.416926Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: u0b#cL/RXraS Definir senha do usuário root do MySQL instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 4 / 8 mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Z4bb1x5!2o21 Re-enter new password: Z4bb1x5!2o21 The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: Z4bb1x5!2o21 Re-enter new password: Z4bb1x5!2o21 Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : n ... skipping. By default, MySQL 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. instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 5 / 8 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done! Conectar no banco, criar o banco de dados e o usuário do Zabbix mysql -u root -pZ4bb1x5!2o21 create database zabbix character set utf8 collate utf8_bin; create user zabbix@localhost identified with mysql_native_password by 'Jornada@2021!'; grant all privileges on zabbix.* to 'zabbix'@'localhost'; flush privileges; exit character set utf8 - suporte a multilinguagem collate utf8_bin - armazena os dados em case sensitive Se não usar a opção mysql_nativo_password você terá um erro ao iniciar o Zabbix server 26232:20210121:104600.402 [Z3001] connection to database 'zabbix' failed: [2059] Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory Instalar Zabbix Server Instalar repositório oficial rpm -ivh http://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release- 5.0-1.el7.noarch.rpm Instalando Zabbix Server instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 6 / 8 yum info zabbix-server-mysql yum install -y zabbix-server-mysql Carregar esquema inicial do banco zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix Jornada@2021! Verificar se o banco de dados foi populado mysql -u zabbix -p zabbix show tables; quit; Output: ... ... ... 166 rows in set (0.01 sec) Editar arquivo de configuração do Zabbix Server vim /etc/zabbix/zabbix_server.conf ### Option: DBPassword # Database password. # Comment this line if no password is used. # # Mandatory: no # Default: DBPassword=Jornada@2021! Habilitar inicialização do serviço e inicia-lo systemctl enable --now zabbix-server systemctl status zabbix-server instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 7 / 8 Verifique os logs do Zabbix Server e veja se tem erros tail -n50 /var/log/zabbix/zabbix_server.log Instalar frontend Enable Red Hat Software Collections Habilitar Red Hat Software Collections yum install centos-release-scl Habilitar o repositório do frontend vim /etc/yum.repos.d/zabbix.repo [zabbix-frontend] ... enabled=1 ... Instalar os pacotes do frontend yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y Configurando o PHP vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf php_value[date.timezone] = America/Sao_Paulo Habilitar inicialização do serviço e inicia-lo instalacao_all_in_one_centos7_zbxmysql.md 3/23/2021 8 / 8 systemctl enable --now httpd rh-php72-php-fpm systemctl status httpd rh-php72-php-fpm Criar regra no firewall firewall-cmd --permanent --add-port=80/tcp firewall-cmd --reload firewall-cmd --permanent --add-port=10051/tcp firewall-cmd --reload Acesse a interface web http://IP_OU_DNS/zabbix Usuário: Admin Senha: zabbix
Compartilhar