Use docker-compose and install elasticsearch kibana

安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

Add vm.max_map_count = 262144 in the /etc/sysctl.conf
Vim /etc/sysctl.conf
vm.max_map_count = 262144

# Validate the configuration
sysctl -p

Create volume mount directory, and modify the directory users and groups. Because not allowed to enable root after elasticsearch6, so the need to modify the / usr / share / elasticsearch / data permissions for 1000
mkdir -pv / usr / share / elasticsearch / data
chown 1000: 1000 / usr / share / elasticsearch / data

编写department Bunken
Mkdir / Usr / Local / Elasticsearch-Kibana
Cd Elasticsearch-Kibana /
Vim Docker-Compose.Yml

version: '2.2'
services:
  elasticsearch:
    image: elasticsearch:6.6.2
    container_name: elasticsearch
    environment:
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    volumes:
      - /usr/share/elasticsearch/data:/usr/share/elasticsearch/data
      - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
    ports:
      - 9200:9200
      - 9300:9300
    mem_limit: 1024m
    restart: always
  kibana:
    image: kibana:6.6.2
    container_name: kibana
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch
    mem_limit: 512m
    restart: always

vim elasticsearch.yml

#集群名
cluster.name: "elasticsearch"
# 允许外部网络访问
network.host: 0.0.0.0
#支持跨域
http.cors.enabled: true
#支持所有域名
http.cors.allow-origin: "*"
# 关闭xpack安全校验,在kibana中使用就不需要输入账号密码
xpack.security.enabled: false

Start elasticsearch background and kibana container  

docker-compose up -d


Stop docker-compose down
to stop and unload volumes docker-compose down -v

Elasticsearch check whether a successful start

curl 127.0.0.1:9200 

Visit kibana

http: // host ip: 5601

Click Dev Tools menu

Then click the triangle next figure running query

 

The official installation tutorial https://www.elastic.co/guide/en/elasticsearch/reference/6.4/docker.html

 

 

Published 51 original articles · won praise 14 · views 40000 +

Guess you like

Origin blog.csdn.net/u010606397/article/details/90598287