Single Node
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
| $ docker pull elasticsearch:5.6.8
$ docker run -d -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:5.6.8
$ docker run -d -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" --name es -p 9200:9200 -p 9300:9300 -p 5601:5601 -e "discovery.type=single-node" elasticsearch:5.6.8
{ "name" : "wCWV0cR", "cluster_name" : "elasticsearch", "cluster_uuid" : "5krSWTgVQUuxvyQvF8LCTw", "version" : { "number" : "5.6.8", "build_hash" : "688ecce", "build_date" : "2018-02-16T16:46:30.010Z", "build_snapshot" : false, "lucene_version" : "6.6.1" }, "tagline" : "You Know, for Search" }
$ docker exec -it es /bin/bash
root@b340ba8042f5:/usr/share/elasticsearch# ./bin/elasticsearch -version Version: 5.6., Build: cfe3d9f/2018-09-10T20:12:43.732Z, JVM: 1.8.0_181
root@a604792a79ad:/usr/share/elasticsearch# cd config/ root@a604792a79ad:/usr/share/elasticsearch/config# echo "http.cors.enabled: true">> elasticsearch.yml root@a604792a79ad:/usr/share/elasticsearch/config# echo -e "http.cors.allow-origin: \"*\"">> elasticsearch.yml
root@a604792a79ad:/usr/share/elasticsearch/config# sed -i 's/^#\(transport.host: 0.0.0.0\)/\1/' elasticsearch.yml
root@a604792a79ad:/usr/share/elasticsearch/config# cat elasticsearch.yml http.host: 0.0.0.0
transport.host: 0.0.0.0
http.cors.enabled: true http.cors.allow-origin: "*" network.host: 127.0.0.1
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.8/elasticsearch-analysis-ik-5.6.8.zip
root@fa9104ef06a1:/usr/share/elasticsearch/plugins/ik/config# sed -i 's/<entry key="ext_dict">/&ext.did/' IKAnalyzer.cfg.xmllocation</entry> --> root@fa9104ef06a1:/usr/share/elasticsearch/plugins/ik/config# sed -i 's/<entry key="ext_stopwords">/&stopword.dic/' IKAnalyzer.cfg.xml root@fa9104ef06a1:/usr/share/elasticsearch/plugins/ik/config# cat IKAnalyzer.cfg.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>IK Analyzer 扩展配置</comment> <!--用户可以在这里配置自己的扩展字典 --> <entry key="ext_dict">ext.dic</entry> <!--用户可以在这里配置自己的扩展停止词字典--> <entry key="ext_stopwords">stopword.dic</entry> <!--用户可以在这里配置远程扩展字典 --> <!-- <entry key="remote_ext_dict">words_location</entry> --> <!--用户可以在这里配置远程扩展停止词字典--> <!-- <entry key="remote_ext_stopwords">words_location</entry> --> </properties> root@fa9104ef06a1:/usr/share/elasticsearch/plugins/ik/config#
$ docker restart es
$ docker pull mobz/elasticsearch-head:5
$ docker run -d -p 9100:9100 docker.io/mobz/elasticsearch-head:5
$ docker run -it -d -e ELASTICSEARCH_URL=http://127.0.0.1:9200 --name kibana --network=container:es kibana:5.6.8
$ vim /var/lib/docker/containers/[hash_of_the_container]/hostconfig.json
"5601/tcp": [{"HostIp": "","HostPort": "5601"}]
$ vim /var/lib/docker/containers/[hash_of_the_container]/config.v2.json
"5601/tcp": {}
|
https://shipengliang.com/software-exp/docker-%E5%AE%B9%E5%99%A8%E7%9A%84%E7%BD%91%E7%BB%9C%E6%A8%A1%E5%BC%8F.html
http://www.amd5.cn/atang_4301.html