CDH6.2.x makes Elasticsearch Parcel package and csd file

1. Configure Java, maven and other environment variables

]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
]# mvn -version
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/software/apache-maven-3.6.3
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /usr/java/jdk1.8.0_211/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.1.3.el7.x86_64", arch: "amd64", family: "unix"

2. Download cm_ext

The cm_ext tool provided by Cloudera verifies the generated csd and parcel


]# mkdir -p ~/github/cloudera
]# cd ~/github/cloudera
]# git clone https://github.com/cloudera/cm_ext.git
]# cd cm_ext
]# mvn package -Dmaven.test.skip=true

Description: The path to execute the jar package in the build_parcel.sh and build_csd.sh script files defaults to ~/github/cloudera/...

3. Download the Elasticsearch installation package

ES download: https://www.elastic.co/cn/downloads/past-releases#elasticsearch

]# mkdir elasticsearch
]# cd elasticsearch
]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz

4. Download scripts for making Parcel packages and CSD files

]# git clone https://github.com/ibagomel/elasticsearch-parcel.git

5. Make and verify the Parcel package and CSD file of Elasticsearch

]# cd elasticsearch-parcel
elasticsearch-parcel]# POINT_VERSION=5 VALIDATOR_DIR=/root/github/cloudera/cm_ext OS_VER=el7 PARCEL_NAME=ElasticSearch ./build-parcel.sh /root/github/cloudera/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz
elasticsearch-parcel]# VALIDATOR_DIR=/root/github/cloudera/cm_ext CSD_NAME=ElasticSearch ./build-csd.sh

Note: Parcel-src/meta/parcel.json >>>> under elasticsearch-parcel 
is modified to: "depends": "CDH (>= 5.0), CDH (<< 10.0)",
csd-src/descriptor/service. sdl >>>> modified to: "cdhVersion": {                                                             "min": 6                                                     }

If not modified, an error will be reported when ES is activated

6. View Parcel package and csd file

elasticsearch-parcel]# ll
总用量 12
drwxr-xr-x. 2 root root   35 5月  28 22:46 build-csd
-rwxr-xr-x. 1 root root  597 5月  28 22:36 build-csd.sh
drwxr-xr-x. 3 root root  130 5月  28 22:46 build-parcel
-rwxr-xr-x. 1 root root 1661 5月  28 22:36 build-parcel.sh
drwxr-xr-x. 5 root root   53 5月  28 22:46 csd-src
drwxr-xr-x. 3 root root   18 5月  28 22:36 parcel-src
-rw-r--r--. 1 root root 1429 5月  28 22:36 README.md
elasticsearch-parcel]# ll build-csd
总用量 8
-rw-r--r--. 1 root root 5426 5月  28 22:46 ELASTICSEARCH-1.0.jar

 

7. Questions

Question 1:

could not find java in JAVA_HOME or bundled at /usr/java/latest/bin/java

solution:

/root/github/cloudera/elasticsearch-parcel/csd-src/scripts/control.sh file comment out export JAVA_HOME=/usr/java/latest

cloudera]# cd elasticsearch-parcel
cloudera]# cd csd-src/scripts/ 
cloudera]# vim control.sh

This problem needs to be modified before making the parcel package and csd file

Question 2:

Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: org.elasticsearch.cli.UserException: unable to create temporary keystore at [/opt/cloudera/parcels/ELASTICSEARCH/config/elasticsearch.keystore.tmp], please check filesystem permissions
Likely root cause: java.nio.file.AccessDeniedException: /opt/cloudera/parcels/ELASTICSEARCH-0.0.5.elasticsearch.p0.5/config/elasticsearch.keystore.tmp
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
	at java.nio.file.Files.newOutputStream(Files.java:216)
	at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:411)
	at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:407)
	at org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:255)
	at org.elasticsearch.common.settings.KeyStoreWrapper.save(KeyStoreWrapper.java:467)
	at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:232)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:289)
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)

solution:

Execute on each node of the cdh cluster:

]# chmod 777 /opt/cloudera/parcels/ELASTICSEARCH/config/

This problem needs to be solved before CM installs es

 

 

 

Guess you like

Origin blog.csdn.net/weixin_38023225/article/details/106467548