引言: 下载docker什么的大家都会我就不献丑了,就直接开始吧。 第一步: 下载镜像 docker pull docker.elastic.co/elasticsearch/elasticsearch:7.6.2 第二步: 配置elasticsearch.yml http.host: 0.0.0.0 # Uncomment the following lines for a production cluster deployment #transport.host: 0.0.0.0 #discovery.zen.minimum_master_nodes: 1 #Password config xpack.security.enabled: true #这一步是开启x-pack插件 创建docker
命令给你们,你们自己修改吧 docker run -d -it --restart=always --privileged=true --name=es7 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -v /home/user/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -e ES_JAVA_OPTS="-Xms256m -Xmx256m" f29a1ee41030 第三步:进入容器并修改配置 docker exec -it es7 /bin/bash # 进入容器 [root@f18d8bc7b8f5 elasticsearch]# cd bin [root@f18d8bc7b8f5 bin]# ls elasticsearch elasticsearch-croneval elasticsearch-migrate elasticsearch-setup-passwords elasticsearch-syskeygen x-pack-watcher-env elasticsearch-certgen elasticsearch-env elasticsearch-node elasticsearch-shard elasticsearch-users elasticsearch-certutil elasticsearch-env-from-file elasticsearch-plugin elasticsearch-sql-cli x-pack-env elasticsearch-cli elasticsearch-keystore elasticsearch-saml-metadata elasticsearch-sql-cli-7.6.2.jar x-pack-security-env [root@f18d8bc7b8f5 bin]# elasticsearch-setup-passwords interactive #此步为手动设置密码 Initiating the setup of passwords for reserved users elastic,apm_system,kibana,logstash_system,beats_system,remote_monitoring_user. You will be prompted to enter passwords as the process progresses. Please confirm that you would like to continue [y/N]y Enter password for [elastic]: #在这里设置密码,注意最少六位,下面也一样 Reenter password for [elastic]: Passwords do not match. Try again. Enter password for [elastic]: Reenter password for [elastic]: Enter password for [apm_system]: Reenter password for [apm_system]: Enter password for [kibana]: Reenter password for [kibana]: Enter password for [logstash_system]: Reenter password for [logstash_system]: Enter password for [beats_system]: Reenter password for [beats_system]: Enter password for [remote_monitoring_user]: Reenter password for [remote_monitoring_user]: Changed password for user [apm_system] Changed password for user [kibana] Changed password for user [logstash_system] Changed password for user [beats_system] Changed password for user [remote_monitoring_user] Changed password for user [elastic] [root@f18d8bc7b8f5 bin]# exit #退出容器 现在重启一下容器测试一些效果吧 docker restart es7 默认用户名是elastic 这样就成功了。 另外elasticsearch7.6.2配套的ik分词器的链接我放上https://download.csdn.net/download/u012999325/12321786
|
|