Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titledocker-compose.yaml
collapsetrue
version: '3.3'
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.15.2		# <--- 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:
      - 929200:9200		# <--- change host port. Here we used 92
    networks:
      - elastic
  k01:
    container_name: k01
    image: docker.elastic.co/kibana/kibana:7.15.2	# <--- get the latest version
    environment:
      SERVER_NAME: kibana
      ELASTICSEARCH_HOSTS: http://es01:9200
    ports:
      - 915601:5601		# <--- change host port. Here we used 91
    networks:
      - elastic
volumes:
  data01:
    driver: local
networks:
  elastic:
    driver: bridge

...

Code Block
languagebash
titleVerify service
$ docker-compose ps
Name              Command               State                       Ports
----------------------------------------------------------------------------------------------
es01   /bin/tini -- /usr/local/bi ...   Up      0.0.0.0:929200->9200/tcp,:::929200->9200/tcp, 9300/tcp
k01    /bin/tini -- /usr/local/bi ...   Up      0.0.0.0:915601->5601/tcp,:::915601->5601/tcp

or equally with the command

Code Block
languagebash
titleVerify service (alternative method)
$ docker ps | grep elastic
CONTAINER ID   IMAGE                  COMMAND                  CREATED         STATUS   PORTS                                                 NAMES 
119eb7e8b36a   kibana:7.15.2          "/bin/tini -- /usr/l…"   2 minutes ago   Up       0.0.0.0:915601->5601/tcp, :::915601->5601/tcp             k01
e902ffce0b93   elasticsearch:7.15.2   "/bin/tini -- /usr/l…"   2 minutes ago   Up       9300/tcp, 0.0.0.0:929200->9200/tcp, :::929200->9200/tcp   es01

Finally, we can connect to the address http://<FIP>:<port>. In our case the address, which needs the VPN, is http://131.154.97.128:91. If we can see the Kibana dashboard, it means that the procedure carried out so far is correct (it may take a couple of minutes from startup to service activation). However, we are not yet able to view the logs generated by our cluster. In the next paragraph we will create a connection between the cluster and the newly instanced log collection service.

...

titlePort

...

.

...

To temporarily interrupt the execution of containers or to permanently delete them use respectively (Remember to run these commands inside the folder where the .yaml file is located)

Code Block
languagebash
titleStop or remove the service
# The command stops execution. To restart it use docker-compose start
$ docker-compose stop
# Stop and remove containers, networks, volumes and images created by "up"
$ docker-compose down [options]

...

Log deployment with FileBeat

...