docker-compose部署Estack

1.安装docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# 增加可执行权限
sudo chmod +x /usr/local/bin/docker-compose

2. 准备部署文配置文件

mkdir /opt/es/data
echo 'version: "3"
services:  
es:   
   image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2    
   restart: always    
  ports:     
        - "9200:9200"      
        - "9300:9300"    
  volumes:      
        - /opt/es/data:/usr/share/elasticsearch/data    
  envrionment:      
       - ES_JAVA_OPTS=-Xms512m -Xmx512m  
kibana:    
     image: docker.elastic.co/kibana/kibana:7.6.2    
     restart: always    
     depends_on:      
        - es    
     links:     
        - es:elasticsearch     
  ports:      
        - "5601:5601"' > /opt/es/es-stack.yaml
docker-compose -f /opt/es/es-stack.yaml  up -d

3. 使用

  • 访问5601端口即可访问Kibana服务,并使用ES API操作ES中的数据

你可能感兴趣的