这篇文章主要介绍“docker如何安装elastic search”,在日常操作中,相信很多人在docker如何安装elastic search问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”docker如何安装elastic search”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
dokcer中安装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 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.137.14:9200 -p 5601:5601 -d kibana:7.6.2
设置开机启动kibana
docker update kibana --restart=always
(5)测试
查看elasticsearch版本信息: http://192.168.137.14: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" }
显示elasticsearch 节点信息http://192.168.137.14:9200/_cat/nodes ,
127.0.0.1 76 95 1 0.26 1.40 1.22 dilm * 0adeb7852e00
访问Kibana: http://192.168.137.14:5601/app/kibana
到此,关于“docker如何安装elastic search”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。