docker安装elastic search

Posted lovoo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker安装elastic search相关的知识,希望对你有一定的参考价值。

1、下载ealastic search和kibana

docker pull elasticsearch:7.6.2
docker pull kibana:7.6.2

2、在虚拟机上创建目录

mkdir -p /mydata/elasticsearch/config  创建目录
mkdir -p /mydata/elasticsearch/data
echo "http.host: 0.0.0.0" >/mydata/elasticsearch/config/elasticsearch.yml

//将mydata/elasticsearch/文件夹中文件都可读可写
chmod -R 777 /mydata/elasticsearch/

3、启动Elastic search

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \\
-e  "discovery.type=single-node" \\
-e ES_JAVA_OPTS="-Xms64m -Xmx512m" \\
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \\
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \\
-v  /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \\
-d elasticsearch:7.6.2 

#设置开机启动elasticsearch
docker update elasticsearch --restart=always

4、启动kibana

docker run --name kibana -e ELASTICSEARCH_HOSTS=http://192.168.6.128:9200 -p 5601:5601 -d kibana:7.6.2

#设置开机启动kibana
docker update kibana  --restart=always

5、查看elasticsearch版本信息

地址:http://192.168.6.128:9200/


    "name": "0adeb7852e00",
    "cluster_name": "elasticsearch",
    "cluster_uuid": "9gglpP0HTfyOTRAaSe2rIg",
    "version": 
        "number": "7.6.2",
        "build_flavor": "default",
        "build_type": "docker",
        "build_hash": "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
        "build_date": "2020-03-26T06:34:37.794943Z",
        "build_snapshot": false,
        "lucene_version": "8.4.0",
        "minimum_wire_compatibility_version": "6.8.0",
        "minimum_index_compatibility_version": "6.0.0-beta1"
    ,
    "tagline": "You Know, for Search"

6、访问Kibana

地址:http://192.168.6.128:5601/app/kibana


分布式技术QQ群:722865146
分布式商城下载:https://gitee.com/charlinchenlin/wysmall

以上是关于docker安装elastic search的主要内容,如果未能解决你的问题,请参考以下文章

Docker 部署 分布式搜索引擎 Elastic Search

ELASTIC SEARCH 安装

Elastic-search在linux上的安装

一. Windows安装Elastic Search和Head插件

elastic search 第一次安装 报错记录

ELK 实验安装Elastic Search 单节点