ElasticSearch 安装
1. ES主体安装
1.1. 获取ES
下载ES,拷贝至目录 /opt
1.2. 安装es
1.2.1. 解压
1 | tar -zxvf es.tar.gz |
1.2.2. 创建用户用户组,修改文件权限
由于ElasticSearch可以接收用户输入的脚本并且执行,为了系统安全考虑,需要创建一个单独的用户用来运行ElasticSearch
1 | groupadd elastic |
1.2.3. 启动es
切换到es目录,启动
1 | cd /opt/elasticsearch-7.13.4/bin |
1.2.4. 检查
本地检查
1
curl 127.0.0.1:9200
外网检查
浏览器访问 {ip}:9200
1.2.5. 问题解决
启动可能遇到的问题
1.2.5.1. 未使用ES_JAVA_HOME 变量
JAVA_HOME 不行的
1 | warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME |
解决方案:环境变量中加入ES_JAVA_HOME
1 | vim /etc/profile |
1.2.5.2. 内存不对
1 | JVM arguments [-Xshare:auto, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -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, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,JRE, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/elasticsearch-3461752725857884135, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Xms1024m, -Xmx1024m, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/opt/elasticsearch-7.13.4, -Des.path.conf=/opt/elasticsearch-7.13.4/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true |
解决方案: 修改Java虚拟机内存
1 | vim config/jvm.options |
1.2.5.3. 外网无法访问
修改配置文件 config/elasticsearch.yml 中的 network.host 重启
1 | vim config/elasticsearch.yml |
1.2.5.4. 启动报内存不足
1 | bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. |
解决:
内存太小了,需要修改vm.max_map_count的内存大小
切换到root账户 命令 su root 修改sysctl.conf文件
1 | su root |
1.2.5.5. 启动报hosts
1 | bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. |
解决
1 | vim config/elasticsearch.yml |
2. kibana安装
2.1. 获取Kibana
下载ES,拷贝至目录 /opt
2.2. 安装Kibana
2.2.1. 解压
1 | tar -zxvf kibana.tar.gz |
2.2.2. 修改配置
修改 config/kibana.yml
1 | vim kibana.yml |
2.2.3. 启动
1 | nohup ./kibana & |
yum方式安装
https://blog.csdn.net/smxalong/article/details/103568418#:~:text=%E4%BA%8C%E3%80%81yum%E5%AE%89%E8%A3%85ES%201%E3%80%81%E6%9B%B4%E6%96%B0yum%E7%9A%84%E7%BC%93%E5%AD%98%20%23%20yum%20makecache,2%E3%80%81%E5%AE%89%E8%A3%85ES%20%23%20yum%20install%20elasticsearch
docker 方式安装
https://blog.csdn.net/Acloasia/article/details/130683934
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 KewenBlogs!
评论