安装部署elasticsearch
linux安装部署es
·
目录
1、下载
官网下载地址: https://www.elastic.co/cn/downloads/elasticsearch
2、解压
tar -xvf xxxx.tar.gz
3、启动
启动es不能用root,用root用户会报错
创建es用户步骤:
useradd es
设置密码:passwd es
然后对es用户授权目录elasticsearch-8.3.3 (重要)
sudo chown -R es:es elasticsearch-8.3.3
切换到es用户: su es
启动es: ./bin/elasticsearch
若想后台运行es,启动命令加上 -d,即 ./bin/elasticsearch -d
访问:http://127.0.0.1:9200
4、启动报错
1)没必要地图数据报错
org.elasticsearch.ElasticsearchException: not all primary shards of [.geoip_databases] index are active
at org.elasticsearch.ingest.geoip.GeoIpDownloader.updateDatabases(GeoIpDownloader.java:135) ~[ingest-geoip-8.2.2.jar:8.2.2]
at org.elasticsearch.ingest.geoip.GeoIpDownloader.runDownloader(GeoIpDownloader.java:275) [ingest-geoip-8.2.2.jar:8.2.2]
at org.elasticsearch.ingest.geoip.GeoIpDownloaderTaskExecutor.nodeOperation(GeoIpDownloaderTaskExecutor.java:102) [ingest-geoip-8.2.2.jar:8.2.2]
at org.elasticsearch.ingest.geoip.GeoIpDownloaderTaskExecutor.nodeOperation(GeoIpDownloaderTaskExecutor.java:48) [ingest-geoip-8.2.2.jar:8.2.2]
at org.elasticsearch.persistent.NodePersistentTasksExecutor$1.doRun(NodePersistentTasksExecutor.java:42) [elasticsearch-8.2.2.jar:8.2.2]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:773) [elasticsearch-8.2.2.jar:8.2.2]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-8.2.2.jar:8.2.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
解决:
因为他启动时会去更新地图的一些数据库,这里直接禁掉即可,用到时再说,配置文件conf/elasticsearch.yml,增加配置
1 |
|
2)访问http://127.0.0.1:9200没返回结果,可能是ssl验证,没必要可以值都设为false,路径conf/elasticsearch.yml
3)若内存爆满,可以改配置文件conf/jvm.options
增加
-Xms1g
-Xmx1g
按自己需求更改即可
5、参考资料:
更多推荐
所有评论(0)