报错了,提示 can not runas root,不能使用root用户启动会报错 。
②、创建运行的用户,启动成功,但无法访问
[root@VM-0-12-centos elasticsearch-8.6.1]# useradd elastic[root@VM-0-12-centos elasticsearch-8.6.1]# chown -R elastic:elastic /usr/local/elasticsearch-8.6.1/[root@VM-0-12-centos elasticsearch-8.6.1]# su elastic[elastic@VM-0-12-centos elasticsearch-8.6.1]$ ./bin/elasticsearch
启动成功,这时候我们试着访问你的 9200端口 :你的IP:9200/ ,失败 。
并且启动台那边也报错了 httpdid not trust this 's ,如下:
[2023-02-14T18:04:06,931][WARN ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [VM-0-12-centos] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.17.0.12:9200, remoteAddress=/218.81.82.139:2348}[2023-02-14T18:06:25,213][WARN ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [VM-0-12-centos] http client did not trust this server's certificate, closing connection Netty4HttpChannel{localAddress=/172.17.0.12:9200, remoteAddress=/218.81.82.139:2349}[2023-02-14T18:06:25,214][WARN ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [VM-0-12-centos] http client did not trust this server's certificate, closing connection Netty4HttpChannel{localAddress=/172.17.0.12:9200, remoteAddress=/218.81.82.139:2350}
原因是因为默认开启了安全认证,虽然启动台启动成功,但访问 9200 端口失败 。
解决办法:找到/目录下面的.yml配置文件,把安全认证开关从原先的true都改成false,实现免密登录访问即可,修改这两处都为false后,重新启动:
③、停止,修改配置文件重新启动
新开一个SSH连接,停止:
[root@VM-0-12-centos ~]# ps -ef | grep elasticroot26132 241030 18:23 pts/400:00:00 su elasticelastic26133 261320 18:23 pts/400:00:00 bashelastic26178 261332 18:23 pts/400:00:02 /usr/local/elasticsearch-8.6.1/jdk/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/usr/local/elasticsearch-8.6.1 -Des.path.conf=/usr/local/elasticsearch-8.6.1/config -Des.distribution.type=tar -cp /usr/local/elasticsearch-8.6.1/lib/ *:/usr/local/elasticsearch-8.6.1/lib/cli-launcher/ * org.elasticsearch.launcher.CliToolLauncherelastic26246 26178 31 18:23 pts/400:00:31 /usr/local/elasticsearch-8.6.1/jdk/bin/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -Djava.security.manager=allow -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=SPI,COMPAT --add-opens=java.base/java.io=ALL-UNNAMED -XX:+UseG1GC -Djava.io.tmpdir=/tmp/elasticsearch-2471405775610397709 -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs/hs_err_pid%p.log -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -Xms999m -Xmx999m -XX:MaxDirectMemorySize=524288000 -XX:G1HeapRegionSize=4m -XX:InitiatingHeapOccupancyPercent=30 -XX:G1ReservePercent=15 -Des.distribution.type=tar --module-path /usr/local/elasticsearch-8.6.1/lib --add-modules=jdk.net -m org.elasticsearch.server/org.elasticsearch.bootstrap.Elasticsearchelastic26275 262460 18:23 pts/400:00:00 /usr/local/elasticsearch-8.6.1/modules/x-pack-ml/platform/linux-x86_64/bin/controllerroot26681 266050 18:24 pts/500:00:00 grep --color=auto elastic[root@VM-0-12-centos ~]# kill -9 26133[root@VM-0-12-centos ~]# kill -9 26178
修改配置文件 .yml,把这两处改为 false:
- 网站优化基础教程:怎么做好关键词优化?
- chatgpt赋能python:Python编程:求解二元二次方程的简单方法
- 二 Android集成百度地图SDK笔记
- LwIP 之二 网络接口 netif(netif.c、ethernetif
- 23西安电子科技大学 西电 833计算机专业基础综合 834 数据结构 计算机组
- 陪学读书会——《点石成金》第十二章-救命!老板想要我......
- 零基础小白想学习并且从事次世代游戏建模都会遇到的6个问题,看看你有没有
- 测试思维和基础测试方法
- 二 【3D点云】分割算法总结
- 二手车过户3次还能买吗 二手车过户3次了还可以买吗