elasticsearch 7.xarm64 기반 rpm 구축

3392 단어

설정 다운로드

wget https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk13u-2019-12-06-19-50/OpenJDK13U-jdk_aarch64_linux_hotspot_2019-12-06-19-50.tar.gz
tar -xvf OpenJDK13U-jdk_aarch64_linux_hotspot_2019-12-06-19-50.tar.gz -C /usr/local/share/
echo -e "JAVA_HOME=/usr/local/share/jdk-13.0.1+9/
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH" >> /etc/profile source /etc/profile

자바 버전 확인
# java -version
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9-201912061032)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9-201912061032, mixed mode, sharing)

maven 창고 주소 수정


USER_HOME/.gradle/아래 새 init.gradle, 아래 내용을 입력하고 저장합니다
allprojects{
    repositories {
        def REPOSITORY_URL = 'https://mirrors.huaweicloud.com/repository/maven/'
        all {
            ArtifactRepository repo ->
    if (repo instanceof MavenArtifactRepository) {
                def url = repo.url.toString()
                if (url.startsWith('https://repo.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
    }
}

번역하다

git clone https://github.com/elastic/elasticsearch.git
#  tar , 
wget https://github.com/elastic/elasticsearch/archive/v7.5.0.tar.gz

기본 컴파일된 패키지는 x86_64 환경에서 설치하면 noarch로 수정하여 회피할 수 있습니다.
--- a/distribution/packages/build.gradle
+++ b/distribution/packages/build.gradle
@@ -107,7 +107,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
   return {
     dependsOn "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files"
     packageName "elasticsearch${oss ? '-oss' : ''}"
-    arch (type == 'deb' ? 'amd64' : 'X86_64')
+    arch (type == 'deb' ? 'amd64' : 'NOARCH')
     // Follow elasticsearch's file naming convention
     String jdkString = jdk ? "" : "no-jdk-"
     archiveName "${packageName}-${project.version}-${jdkString}${archString}.${type}"

jdk를 포장하지 않은 가방을 컴파일합니다.
cd elasticsearch
./gradlew -p distribution/packages/no-jdk-rpm/ assemble

distribution/packages/rpm/이면 x86_64의 jdk
컴파일이 완료되면 생성된 패키지는 distribution/packages/no-jdk-rpm/build/distributions/elasticsearch-7.5.0-SNAPSHOT-no-jdk-noarch.rpm

설치 구성


설치

yum install distribution/packages/no-jdk-rpm/build/distributions/elasticsearch-7.5.0-SNAPSHOT-no-jdk-noarch.rpm

JAVA_ 설정HOME


수정 /etc/sysconfig/elasticsearch
JAVA_HOME=/usr/local/share/jdk-13.0.1+9/

구성 수정


구성 파일 수정/etc/elasticsearch/elasticsearch.yml 추가:
xpack.ml.enabled: false

X-Pack은 x86_만 지원64, 비활성화해야 합니다. 그렇지 않으면es를 실행하면 오류가 발생합니다.

서비스 실행

systemctl start elasticsearch

좋은 웹페이지 즐겨찾기