编译
emqx-3.2.8编译
wget 下载东西报证书错误
mysql编译
pika在arm环境编译
kibana-6.8.4编译
elasticsearch-6.8.4编译
logstash 6.8.4 编译
-
+
首页
elasticsearch-6.8.4编译
## elasticsearch-6.8.4编译 - what: elasticsearch-6.8.4编译 - where: centos8 aarch64 - when: 2022-1-14 - who: jiaorongtao - why: 记录 - how: ### 1.环境 #### 1.1 依赖安装 ```bash yum install rpm-build gcc-c++ make vim wget net-tools passwd -y ``` #### 2.1 jdk安装 ```bash wget https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk12u-2019-09-25-09-23/OpenJDK12U-jdk_aarch64_linux_hotspot_2019-09-25-09-23.tar.gz #解压 tar -zxvf OpenJDK12U-jdk_aarch64_linux_hotspot_2019-10-16-11-08.tar.gz #配置环境变量 vim /etc/profile export JAVA_HOME=/opt/jdk-12.0.2+10/ export PATH=$JAVA_HOME/bin:$PATH source /etc/profile ``` ### 2.编译 ```bash wget https://github.com/elastic/elasticsearch/archive/v6.8.4.tar.gz tar -zxvf v6.8.4.tar.gz cd elasticsearch-6.8.4/ ./gradlew assemble -x :distribution:packages:buildDeb -x :distribution:packages:buildOssDeb #成功后,rpm包路径为: distribution/packages/rpm/build/distributions/elasticsearch-6.8.6-SNAPSHOT.rpm ``` ### 3.部署 ```bash #安装rpm包 cd distribution/packages/rpm/build/distributions/ yum install elasticsearch-6.8.4-SNAPSHOT.rpm -y #修改配置 vim /etc/elasticsearch/elasticsearch.yml X-Pack只支持x86_64,需要禁用,否则运行es会报错 #添加以下内容 xpack.ml.enabled: false #启动 sudo systemctl daemon-reload sudo systemctl enable elasticsearch.service sudo systemctl start elasticsearch.service ``` ### 4.问题解决 问题1:启动es时报java环境未设置 ```bash [root@b156873121b1 opt]# systemctl status elasticsearch.service elasticsearch.service - Elasticsearch Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2022-01-14 07:58:12 UTC; 6s ago Docs: http://www.elastic.co Process: 3300 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --qu> Main PID: 3300 (code=exited, status=1/FAILURE) Jan 14 07:58:12 b156873121b1 systemd[1]: Started Elasticsearch. Jan 14 07:58:12 b156873121b1 elasticsearch[3300]: which: no java in (/usr/local/sbin:/usr/local/bin:/usr/> Jan 14 07:58:12 b156873121b1 elasticsearch[3300]: warning: Falling back to java on path. This behavior is> Jan 14 07:58:12 b156873121b1 elasticsearch[3300]: could not find java; set JAVA_HOME Jan 14 07:58:12 b156873121b1 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=> Jan 14 07:58:12 b156873121b1 systemd[1]: elasticsearch.service: Failed with result 'exit-code'. ``` 问题解决: 环境变量问题,删除之前的Java,重新安装java java安装 ```bash wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz tar -zxf OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz mkdir -p /opt/ mv jdk8u252-b09 /opt/ vim /etc/profile export JAVA_HOME=/opt/jdk8u252-b09 export PATH=$JAVA_HOME/bin:$PATH source /etc/profile ``` 在es中设置java环境变量 ```bash 在/etc/sysconfig/elasticsearch增加环境变量, JAVA_HOME=/opt/jdk8u252-b09 参考:https://www.cnblogs.com/FengGeBlog/p/10266126.html ```
JRT
2022年1月14日 17:31
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码