kibanaEs un servicio para visualizar datos de Elasticsearch y navegarlos a través del Elastic Stack. Le ayuda a crear paneles, personalizar el formulario de visualización, generar gráficos interactivos, incluso presentar geodatos, analizar relaciones y explorar anomalías con aprendizaje automático.
Instalación de Kibana desde el repositorio
Importamos la clave PGP para agregar aún más el repositorio de Elasticsearch
$ rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Agregar el repositorio
$ sudo nano /etc/yum.repos.d/kibana.repo
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
Instalar Kibana
$ sudo dnf -y install kibana
Agregue el servicio Kibana al inicio e inícielo
$ sudo systemctl enable --now kibana
Comprobando si el servicio ha comenzado
$ systemctl status kibana
Instalación de Kibana desde un paquete RPM
Descargue el paquete Kibana e instálelo
$ wget https://artifacts.elastic.co/downloads/kibana/kibana-7.9.3-x86_64.rpm -P /tmp
$ cd /tmp
$ sudo dnf -y localinstall kibana-7.9.3-x86_64.rpm
Agregue el servicio Kibana al inicio e inícielo
$ sudo systemctl enable --now kibana
Comprobando si el servicio ha comenzado
$ sudo systemctl status kibana
Comprobando el puerto
$ netstat -tulnp | grep 5601
Configurando Kibana
Editar el archivo de configuración de Kibana
$ sudo nano /etc/kibana/kibana.yml
# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601
# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "192.168.1.10"
[?]
# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["https://localhost:9200"]
Reiniciando Kibana
$ sudo systemctl restart kibana
Si usamos Nginx como Proxy inverso
[?]
server.host: "localhost"
[?]
En este ejemplo, decimos que el servidor debe escuchar en la interfaz 192.168.1.10.
Configuración del firewall (si no usamos nginx como proxy inverso)
Puerto de apertura 5601
$ sudo firewall-cmd --add-port=5601/tcp --permanent
$ sudo firewall-cmd --reload
Instalación de NGINX
Agregar repositorio NGINX
$ sudo nano /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=https://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=https://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
La versión estable se utilizará por defecto. Si necesita una versión principal, cambie
$ sudo dnf config-manager --set-enabled nginx-mainline
Instale NGINX y httpd-tools
$ sudo dnf -y install nginx httpd-tools
Agregue el servicio NGINX al inicio e inícielo
$ sudo systemctl enable --now nginx
Comprobando si el servicio ha comenzado
$ systemctl status nginx
Configurando NGINX
Deshabilitar la configuración predeterminada
$ cd /etc/nginx/conf.d/
$ sudo mv default.conf default.conf.disable
Crear configuración para Kibana
$ sudo nano kibana.conf
server {
listen 80;
#listen [::]:80 ipv6only=on;
server_name _;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.kibana-user;
location / {
proxy_pass https://localhost:5601/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Generando una contraseña para autorización
$ sudo htpasswd -c /etc/nginx/.kibana-user mykibana
New password: password
Re-type new password: password
Adding password for user mykibana
Reinicie NGINX, verifique el estado
$ sudo systemctl reload nginx
$ systemctl status nginx
Configuración del cortafuegos
Puerto de apertura 80
$ sudo firewall-cmd --permanent --zone=public --add-service=http
$ sudo firewall-cmd --reload
Ver la lista de reglas
$ sudo firewall-cmd --list-all
Cerramos el puerto 5601 si estaba abierto previamente
$ sudo firewall-cmd --permanent --zone=public --remove-port=5601/tcp
$ sudo firewall-cmd --reload
configuración SELinux
Agregar una regla a la política SELinux
$ sudo setsebool -P httpd_can_network_connect=1