如何利用小游戏开发框架提升企业小程序的用户体验与运营效率
939
2022-09-07
ElasticStack----使用Docker方式安装单节点的8.1.3版本的ElasticSearch
1 -镜像
docker
2 创建挂载目录,将数据盘挂载出来
mkdir -p /docker/elasticsearch/usr/share/elasticsearch/datachmod 777
3 创建docker启动Elasticsearch服务
docker run -d --name elasticsearch -p 10013:9200 -p 10014:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms512m -Xmx1024m" -e "--privileged --restart=always -v /docker/elasticsearch/usr/share/elasticsearch/data:/usr/share/elasticsearch/data docker.elastic.co/elasticsearch/elasticsearch:8.1.3
4 Elasticsearch从8开始不再提供默认密码,这里需要重置密码
使用如下命令一次性将 elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user 等用户密码都重新设置
docker exec
如下依次输入各个用户的密码,当然也可以设置为一个,自己需要记住:
[root@redrose2100 ~]# docker exec -it elasticsearch /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive******************************************************************************Note: The 'elasticsearch-setup-passwords' tool has been deprecated. This command will be removed in a future release.******************************************************************************Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,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]yEnter password for [elastic]:Reenter password for [elastic]:Enter password for [apm_system]:Reenter password for [apm_system]:Enter password for [kibana_system]:Reenter password for [kibana_system]: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_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@redrose2100 ~]#
5 由于Elasticsearch从8开始启用了安全证书机制,将证书拷贝到宿主机
mkdir -p /docker/elasticsearch/usr/share/elasticsearch/config/certsdocker cp
6 在命令行使用如下命令验证Elasticsearch是否安装成功
使用如下命令,然后在交互环境根据提示输入上面重置后的密码
curl
过程如下:
[root@redrose2100 ~]# curl --cacert /docker/elasticsearch/usr/share/elasticsearch/config/certs/-u elastic host password for user 'elastic':{ "name" : "994bcface178", "cluster_name" : "docker-cluster", "cluster_uuid" : "xOFaXy78QxWuJ8b-qcUF1g", "version" : { "number" : "8.1.3", "build_flavor" : "default", "build_type" : "docker", "build_hash" : "39afaa3c0fe7db4869a161985e240bd7182d7a07", "build_date" : "2022-04-19T08:13:25.444693396Z", "build_snapshot" : false, "lucene_version" : "9.0.0", "minimum_wire_compatibility_version" : "7.17.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "You Know, for Search"}[root@redrose2100 ~]#
7 至此,Elasticsearch 8.1.3版本的安装就已经成功完成了
8 若后期想单独修改某个用户的密码时,使用如下命令即可
如下为修改用户elastic的密码
docker exec
9 为了简单使用,也可以将使用认证的开关关掉,首先将ElasticSearch中的配置文件拷贝出来
docker cp
10 编辑配置文件,
vi
将如下位置的配置的true修改为false
11 然后使用如下命令将修改后的配置重新拷贝到docker容器中
docker cp
12 重启docker
docker
13 此时,直接使用如下命令再次请求Elasticsearch,即不适用证书直接请求
curl
结果如下:
Enter host password for user 'elastic':{ "name" : "994bcface178", "cluster_name" : "docker-cluster", "cluster_uuid" : "xOFaXy78QxWuJ8b-qcUF1g", "version" : { "number" : "8.1.3", "build_flavor" : "default", "build_type" : "docker", "build_hash" : "39afaa3c0fe7db4869a161985e240bd7182d7a07", "build_date" : "2022-04-19T08:13:25.444693396Z", "build_snapshot" : false, "lucene_version" : "9.0.0", "minimum_wire_compatibility_version" : "7.17.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "You Know, for Search"}[root@redrose2100 elasticsearch]#
14 至此,可以在浏览器通过ip+端口访问了,如下:
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~