雖前幾天弄成功利用 docker 自編 Open Distro for Elasticsearch SQL, 但它只能用在 7.10.2, 所以打算再拼一個能支援 7.13.4 版本
Google 後, 找到 NLPchina/elasticsearch-sql, 目前只支援 7.13.2, 只要小修 .travis.yml & pom.xml 就可以成功弄出 7.13.4 版本, 而且利用 docker 超方便編出 elasticsearch plugin, 為了避免自己忘己, 還是寫一寫, 當紀錄
OS: buster, debian 10.10
docker: 19.03.1
docker image: maven:3-openjdk-17
- 參考如何自編文件: BUILDING.md, 需要使用 mvn, Apache Maven, 發現 dockerhub 有對應的版本, 採用 maven:3-openjdk-17
- 確認 dockremap, 假設 10000:10000, 此次採用 docker container root 0:0 (remap 10000:10000)
echo "`grep dockremap /etc/subuid | awk -F: '{print 2}'`:`grep dockremap /etc/subgid | awk -F: '{print2}'`"
- 下載, 準備環境
sudo docker pull maven:3-openjdk-17
cd /tmp
git clone https://github.com/NLPchina/elasticsearch-sql.git
cd elasticsearch-sql
git checkout elastic7.13.2
- 修改 .travis.yml, pom.xml, 參考 git diff 修改
diff --git a/.travis.yml b/.travis.yml
index 28935bd..299b04a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,7 @@ jdk:
- openjdk8
before_install:
- - wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.2-amd64.deb && sudo dpkg -i --force-confnew ela
sticsearch-7.13.2-amd64.deb
+ - wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.4-amd64.deb && sudo dpkg -i --force-confn
ew elasticsearch-7.13.4-amd64.deb
- sudo cp ./src/test/resources/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml
- sudo cat /etc/elasticsearch/elasticsearch.yml
- sudo java -version
diff --git a/pom.xml b/pom.xml
index 79b267e..145b852 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.nlpcn</groupId>
<artifactId>elasticsearch-sql</artifactId>
- <version>7.13.2.0</version>
+ <version>7.13.4.0</version>
<packaging>jar</packaging>
<description>Query elasticsearch using SQL</description>
<name>elasticsearch-sql</name>
@@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<runSuite>**/MainTestSuite.class</runSuite>
<elasticsearch.plugin.name>sql</elasticsearch.plugin.name>
- <elasticsearch.version>7.13.2</elasticsearch.version>
+ <elasticsearch.version>7.13.4</elasticsearch.version>
<elasticsearch.plugin.classname>org.elasticsearch.plugin.nlpcn.SqlPlug</elasticsearch.plugin.classname>
<druid.version>1.1.16</druid.version>
<guava.version>30.1.1-jre</guava.version>
- 自編 elasticsearch.zip
cd /tmp/elasticsearch-sql
sudo docker run --user root --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3-openjdk-17 mvn clean package assembly:single -DskipTests
- 取得檔案 elasticsearch.zip, 建議重新命名, 改 elasticsearch-sql-7.13.4.zip
cd /tmp/elasticsearch-sql/target
mv elasticsearch.zip elasticsearch-sql-7.13.4.zip
- 安裝 plugin
elasticsearch-plugin install file:///PATH/elasticsearch-sql-7.13.4.zip
- 成果
自編 elasticsearch-sql