1 | [root@staging ~]# docker search elasticsearch |
1 | [root@staging ~]# docker pull elasticsearch:7.14.2 |
1 2 3 4 5 | [root@staging ~]# mkdir -p /data2/elasticsearch/config [root@staging config]# vim elasticsearch.yml cluster.name: "docker-cluster" network.host: 0.0.0.0 [root@staging config]# chmod -R 777 /data2/elasticsearch/ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [root@staging ~]# docker run \ -itd \ -p 9200:9200 \ -p 9300:9300 \ -v /data2/elasticsearch/data:/usr/share/elasticsearch/data \ -v /data2/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \ -v /data2/elasticsearch/plugins:/usr/share/elasticsearch/plugins \ -v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime \ -e discovery.type=single-node \ -e ES_JAVA_OPTS="-Xms64m -Xmx512m" \ --restart always \ --privileged=true \ --name es \ elasticsearch:7.14.2 |
1 2 3 | [root@staging config]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7e1f75c1dd67 elasticsearch:7.14.2 "/bin/tini -- /usr/l…" 7 seconds ago Up 3 seconds 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp es |
1 | 输入IP+Port,本机192.168.2.18:9200,输入正确的用户名和修改过后的密码即可正常登陆。 |