Hi. As a learning experience, I am trying to install Metricbeat on the MySQL 5.7 docker official (debian flavor see Dockerfile below) image using the official ELK image (elasticsearch:7.5.1 and kibana:7.5.1). I am struggling with an Kibana dashboard error and I was hoping someone could help as I am stuck. Thanks.
root@b6fd4a1ece3d:/usr/share/metricbeat# ./bin/metricbeat setup
Index setup finished.
Loading dashboards (Kibana must be running and reachable)
Skipping loading dashboards, No directory /usr/share/metricbeat/bin/kibana/7
root@b6fd4a1ece3d:/usr/share/metricbeat# /usr/share/metricbeat/bin/kibana/7
bash: /usr/share/metricbeat/bin/kibana/7: No such file or directory
Okay, so to investigate I created that directory myself :
root@b6fd4a1ece3d:/usr/share/metricbeat# mkdir /usr/share/metricbeat/bin/kibana/7
root@b6fd4a1ece3d:/usr/share/metricbeat# ./bin/metricbeat setup
Index setup finished.
Loading dashboards (Kibana must be running and reachable)
Skipping loading dashboards, The directory /usr/share/metricbeat/bin/kibana/7 does not contain the index-pattern or dashboard subdirectory. There is nothing to import into Kibana.
This is my metricbeat.yml :
#========================== Modules configuration ============================
metricbeat.config.modules:
Glob pattern for configuration loading
path: /etc/metricbeat/modules.d/*.yml
Set to true to enable config reloading
reload.enabled: false
Period on which files under path should be checked for changes
reload.period: 10s
#==================== Elasticsearch template setting ==========================
setup.template.settings:
index.number_of_shards: 1
index.codec: best_compression
#_source.enabled: false
#============================== Dashboards =====================================
These settings control loading the sample dashboards to the Kibana index. Loading
the dashboards is disabled by default and can be enabled either by setting the
options here, or by using the -setup
CLI flag or the setup
command.
setup.dashboards.enabled: true
logging.level: warning
logging.to_files: true
logging.to_syslog: false
logging.files:
path: /var/log/metricbeat
name: metricbeat.log
keepfiles: 2
permissions: 0644
#============================== Kibana =====================================
Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
This requires a Kibana endpoint configuration.
setup.kibana.host: "kibana:5601"
setup.kibana.protocol: "http"
output.elasticsearch:
hosts: ["elasticsearch:9200"]
metricbeat.modules:
- module: mysql
enabled: true
metricsets: ["status"]
period: 5s
hosts: ["tcp(localhost:3306)/"]
username: user
password: password
AND this is my Dockerfile :
Pull the mysql:5.6 image
FROM mysql:5.7
The maintainer name and email
MAINTAINER MyEmail myemail@gmail.com
ENV MYSQL_DATABASE='test'
ENV MYSQL_USER='user'
ENV MYSQL_PASSWORD='password'
ENV MYSQL_ROOT_PASSWORD='password'
Install requirement (curl)
RUN apt-get update && apt-get install -y curl
Install
RUN curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.5.1-amd64.deb &&
dpkg -i metricbeat-7.5.1-amd64.deb
COPY ./metricbeat.yml /usr/share/metricbeat/metricbeat.yml
COPY ./metricbeat.yml /etc/metricbeat/metricbeat.yml
COPY ./modules.d /etc/metricbeat/modules.d
RUN cd /usr/share/metricbeat/ &&
./bin/metricbeat modules enable mysql &&
service metricbeat start
EXPOSE 3306