Run Elastic search and Crebro in the Docker container

Chapter one: Installation and Simple Configuration of Elasticsearch 7.x (Aliyun Ubuntu)

System environment

  • Operating system: Ubuntu 18.04 LTS (ALI cloud)
  • System IP
# Intranet, private address
 172. inside. inside. inside
 # Extranet, public address
 112. Outside. Outside. Outside.
  • Elastic search version: 7.2
  • Docker Version: 18.09

install

$ sudo apt install docker
# Add the current user to the docker group to avoid the root privilege to run the docker command
$ sudo usermod -aG docker ${USER}
$ docker --version
Docker version 18.09.7, build 2d0083d
  • Install docker.io
$ sudo apt install docker.io
  • Install docker-compose
$ sudo apt install docker-compose
$ docker-compose --version
docker-compose version 1.17.1, build unknown

Configuration of docker image accelerator

  • Aliyun Console - > Products and Services - > Elastic Computing - > Container Mirror Service

Create and start containers

# docker-compose.yaml
version: '2.2'
services:
  cerebro:
    image: lmenezes/cerebro:0.8.3
    container_name: cerebro
    ports:
      - "9000:9000"
    command:
      - -Dhosts.0.host=http://elasticsearch:9200
    networks:
      - es72net
  kibana:
    image: docker.elastic.co/kibana/kibana:7.2.0
    container_name: kibana72
    environment:
      #- I18N_LOCALE=zh-CN
      - XPACK_GRAPH_ENABLED=true
      - TIMELION_ENABLED=true
      - XPACK_MONITORING_COLLECTION_ENABLED="true"
    ports:
      - "5601:5601"
    networks:
      - es72net
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
    container_name: es72_01
    environment:
      - cluster.name=geektime
      - node.name=es72_01
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.seed_hosts=es72_01,es72_02
      - network.publish_host=elasticsearch
      - cluster.initial_master_nodes=es72_01,es72_02
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - es72data1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - es72net
  elasticsearch2:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
    container_name: es72_02
    environment:
      - cluster.name=geektime
      - node.name=es72_02
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.seed_hosts=es72_01,es72_02
      - network.publish_host=elasticsearch
      - cluster.initial_master_nodes=es72_01,es72_02
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - es72data2:/usr/share/elasticsearch/data
    networks:
      - es72net


volumes:
  es72data1:
    driver: local
  es72data2:
    driver: local

networks:
  es72net:
    driver: bridge
  • Run the following command in the directory of docker-compose.yaml to create and start the container
$ docker-compose up

Tags: Linux Docker ElasticSearch sudo Ubuntu

Posted on Sat, 05 Oct 2019 23:01:16 -0700 by 8ball