...
For the installation of ElasticSearch and Kibana we will use Docker-Compose (it is better to check that the version of Docker-Compose is updated). It is recommended that you create a folder and place the docker-compose.yml file in it.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
version: '3.3' services: es01: image: docker.elastic.co/elasticsearch/elasticsearch:7.9.0 # <--- get the latest version container_name: es01 environment: - node.name=es01 - cluster.name=es-docker-cluster - discovery.type=single-node - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 volumes: - data01:/usr/share/elasticsearch/data ports: - 92:9200 # <--- change host port. Here we used 92 networks: - elastic k01: container_name: k01 image: docker.elastic.co/kibana/kibana:7.9.0 # <--- get the latest version environment: SERVER_NAME: kibana ELASTICSEARCH_HOSTS: http://es01:9200 ports: - 91:5601 # <--- change host port. Here we used 91 networks: - elastic volumes: data01: driver: local networks: elastic: driver: bridge |
...
Remember to run the docker-compose command inside the folder where the .yaml file is located.
Log
...
deployment with FileBeat
Let's move on to the cluster now, to direct its logs to the newly created data collection service. Download the .yaml
file from the link (look at the version of the file in the link)
...
and modify the lines highlighted by the comments in the following extract (to allow the creation of Pods also on the master, add the lines shown at the bottom)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
output.elasticsearch: hosts:['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:92}'] # <--- Enter the desired port username: ${ELASTICSEARCH_USERNAME} password: ${ELASTICSEARCH_PASSWORD} ----------------------------------------------------- env: name: ELASTICSEARCH_HOST value: 131.154.97.128 # <--- Enter the host FIP with elasticsearch name: ELASTICSEARCH_PORT value: "92" # <--- Enter the port (like above) name: ELASTICSEARCH_USERNAME value: elastic name: ELASTICSEARCH_PASSWORD value: changeme name: ELASTIC_CLOUD_ID value: name: ELASTIC_CLOUD_AUTH value: name: NODE_NAME ----------------------------------------------------- # this toleration is to have the daemonset runnable on master nodes. Remove it if your masters can't run pods spec: template: spec: tolerations: - key: node-role.kubernetes.io/master effect: NoSchedule |
...