- Deploy Zabbix Server, Frontend e Grafana no Docker
- Primeiro passo corrigir o horário do servidor
- Ajustes de S.O após a instalação
- Instalando o Docker
- Instalando repositório do docker
- Removendo repositórios antigos
- Listando versões disponiveis do docker
- Instalando device mapper
- Instalando a ultima versão do Docker
- Inicializando o daemon do docker
- Habilitar roteamento nos containers
- Verificando versão do docker
- Ativando modo swarm no host
- Inspect de todas as redes do docker
- Validando conflito de rede
- Criando rede para o nosso ambiente
- Inspect de todas as redes do docker novamente
- Deploy stack Zabbix
timedatectl status
Output:
Local time: Wed 2020-06-03 05:03:25 -03
Universal time: Wed 2020-06-03 08:03:25 UTC
RTC time: Wed 2020-06-03 08:03:24
Time zone: America/New_York (-03, -0300)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
timedatectl list-timezones | grep Sao_Paulo
Output:
America/Sao_Paulo
timedatectl set-timezone America/Sao_Paulo
timedatectl status
Local time: Wed 2020-06-03 05:03:25 -03
Universal time: Wed 2020-06-03 08:03:25 UTC
RTC time: Wed 2020-06-03 08:03:24
Time zone: America/Sao_Paulo (-03, -0300)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
dnf clean all
dnf check-update
dnf install -y net-tools vim nano epel-release wget curl tcpdump
dnf install -y git
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf clean all
dnf list docker-ce --showduplicates | sort -r
dnf install -y device-mapper-persistent-data
Se precisar da ultima versão do docker, é necessário instalar manualmente a ultima versão do containerd.io
dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
dnf install -y docker-ce
Se não, utilize o parâmetro --nobest na hora de instalação
dnf install -y docker-ce --nobest
systemctl enable --now docker
systemctl status docker
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --reload
docker version
docker swarm init
for net in `docker network ls |grep -v NAME | awk '{print $2}'`;do ipam=`docker network inspect $net --format {{.IPAM}}` && echo $net - $ipam; done
ifconfig ens18
Output:
ens18: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.34 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::d440:d1d9:33cf:3800 prefixlen 64 scopeid 0x20<link>
inet6 fe80::b5c3:70cc:d7a0:5d57 prefixlen 64 scopeid 0x20<link>
inet6 fe80::5b2:4fc5:e2cb:dbab prefixlen 64 scopeid 0x20<link>
ether ee:2d:73:2e:4b:9f txqueuelen 1000 (Ethernet)
RX packets 69824 bytes 177640772 (169.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 32110 bytes 2666365 (2.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker node ls
NESTE MOMENTO ELE NÃO IRA INICIAR NOVOS SERVIÇOS
<NODE_NAME> É O NOME DO HOSTNAME QUE RETORNA NO COMANDO docker node ls
docker node update --availability drain <NODE_NAME>
$ docker network rm ingress
Output:
WARNING! Before removing the routing-mesh network, make sure all the nodes
in your swarm run the same docker engine version. Otherwise, removal may not
be effective and functionality of newly created ingress networks will be
impaired.
Are you sure you want to continue? [y/N]
docker network create \
--driver overlay \
--ingress \
--subnet=192.168.102.0/28 \
--gateway=192.168.102.2 \
--opt com.docker.network.driver.mtu=1200 \
ingress
<NODE_NAME> É O NOME DO HOSTNAME QUE RETORNA NO COMANDO docker node ls
docker node update --availability active <NODE_NAME>
docker network create --driver overlay monitoring-network
for net in `docker network ls |grep -v NAME | awk '{print $2}'`;do ipam=`docker network inspect $net --format {{.IPAM}}` && echo $net - $ipam; done
cd ~/
git clone https://github.com/jorgepretel/maratonazabbix.git
cd maratonazabbix
sh grafana.sh
docker stack deploy -c docker-compose.yaml maratonazabbix
docker stack ls
docker service ls
docker service logs -f maratonazabbix_zabbix-server
docker service logs -f maratonazabbix_zabbix-frontend
docker service logs -f maratonazabbix_grafana
docker stack rm maratonazabbix