summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHa The Tung2020-02-17 14:56:23 +0800
committerHa The Tung2020-02-17 14:56:23 +0800
commitb9ecaca56769d65002b13d353e3bc595c8cb403f (patch)
tree26d4148cadee24b080828842b5b1cd980d8e310b
downloadaur-b9ecaca56769d65002b13d353e3bc595c8cb403f.tar.gz
es 6.8.6-1
-rw-r--r--.SRCINFO36
-rw-r--r--PKGBUILD90
-rw-r--r--elasticsearch-env50
-rw-r--r--elasticsearch-keystore.service10
-rw-r--r--elasticsearch-keystore@.service11
-rw-r--r--elasticsearch-sysctl.conf1
-rw-r--r--elasticsearch-tmpfile.conf7
-rw-r--r--elasticsearch-user.conf1
-rw-r--r--elasticsearch.default13
-rw-r--r--elasticsearch.service40
-rw-r--r--elasticsearch@.service40
11 files changed, 299 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fc47b0d881d0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,36 @@
+pkgbase = elasticsearch6
+ pkgdesc = Distributed RESTful search engine built on top of Lucene
+ pkgver = 6.8.6
+ pkgrel = 1
+ url = https://www.elastic.co/products/elasticsearch
+ arch = any
+ license = Apache
+ depends = java-runtime-headless
+ depends = systemd
+ backup = etc/elasticsearch6/elasticsearch.yml
+ backup = etc/elasticsearch6/log4j2.properties
+ backup = etc/elasticsearch6/jvm.options
+ backup = etc/default/elasticsearch6
+ source = https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.8.6.tar.gz
+ source = elasticsearch-env
+ source = elasticsearch.service
+ source = elasticsearch@.service
+ source = elasticsearch-keystore.service
+ source = elasticsearch-keystore@.service
+ source = elasticsearch-sysctl.conf
+ source = elasticsearch-user.conf
+ source = elasticsearch-tmpfile.conf
+ source = elasticsearch.default
+ sha256sums = 351861766c5fd8c1148e74c4186c6f77dcfe14b0c2c3a7e74315d3989b9ae068
+ sha256sums = cce7cfe85ddea80ff6db10ec88f973b87ffa97b9f6a2614234b846551a7731d7
+ sha256sums = ff1c01c16f77d18b0cf8c94798dd74f86a1f89d132508b98dcc8a8e9251c1750
+ sha256sums = 2af4e23d1e1b99211c413a73600e369b190eb7d5ff1ad844ad93191b0adc5311
+ sha256sums = 51ec569bbcbcb16929f6f39d7dfda9a0a8938225e4041e2e84aa18cb2c36dd3f
+ sha256sums = bc159a611dbb4a05dfe8805429bc02a65b4f78191e14d17a68f655e90237a327
+ sha256sums = b3feb1e9c7e7ce6b33cea6c727728ed700332aae942ca475c3bcc1d56b9f113c
+ sha256sums = 815f6a39db6f54bb40750c382ffbdc298d2c4c187ee8ea7e2f855923e2ff354b
+ sha256sums = 0ead1f4724268b51c0db15ee8f0612d23f87c3dc0445b737bc9b96e5511cb38c
+ sha256sums = bb74e5fb8bc28f2125e015395ab05bea117b72bfc6dadbca827694b362ee0bf8
+
+pkgname = elasticsearch6
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..630a12f66327
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,90 @@
+# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# Contributor: Marcello "mererghost" Rocha <https://github.com/mereghost>
+# Refactored by Blaž "Speed" Hrastnik <https://github.com/archSeer>
+
+pkgname=elasticsearch6
+_pkgname=elasticsearch
+pkgver=6.8.6
+pkgrel=1
+pkgdesc="Distributed RESTful search engine built on top of Lucene"
+arch=('any')
+url="https://www.elastic.co/products/elasticsearch"
+license=('Apache')
+depends=('java-runtime-headless' 'systemd')
+source=(
+ "https://artifacts.elastic.co/downloads/$_pkgname/$_pkgname-oss-$pkgver.tar.gz"
+ elasticsearch-env
+ elasticsearch.service
+ elasticsearch@.service
+ elasticsearch-keystore.service
+ elasticsearch-keystore@.service
+ elasticsearch-sysctl.conf
+ elasticsearch-user.conf
+ elasticsearch-tmpfile.conf
+ elasticsearch.default
+)
+sha256sums=('351861766c5fd8c1148e74c4186c6f77dcfe14b0c2c3a7e74315d3989b9ae068'
+ 'cce7cfe85ddea80ff6db10ec88f973b87ffa97b9f6a2614234b846551a7731d7'
+ 'ff1c01c16f77d18b0cf8c94798dd74f86a1f89d132508b98dcc8a8e9251c1750'
+ '2af4e23d1e1b99211c413a73600e369b190eb7d5ff1ad844ad93191b0adc5311'
+ '51ec569bbcbcb16929f6f39d7dfda9a0a8938225e4041e2e84aa18cb2c36dd3f'
+ 'bc159a611dbb4a05dfe8805429bc02a65b4f78191e14d17a68f655e90237a327'
+ 'b3feb1e9c7e7ce6b33cea6c727728ed700332aae942ca475c3bcc1d56b9f113c'
+ '815f6a39db6f54bb40750c382ffbdc298d2c4c187ee8ea7e2f855923e2ff354b'
+ '0ead1f4724268b51c0db15ee8f0612d23f87c3dc0445b737bc9b96e5511cb38c'
+ 'bb74e5fb8bc28f2125e015395ab05bea117b72bfc6dadbca827694b362ee0bf8')
+
+backup=('etc/elasticsearch6/elasticsearch.yml'
+ 'etc/elasticsearch6/log4j2.properties'
+ 'etc/elasticsearch6/jvm.options'
+ 'etc/default/elasticsearch6')
+
+prepare() {
+ cd "$srcdir"/$_pkgname-$pkgver
+
+ find bin -type f \( -name \*.bat -o -name \*.exe \) -delete
+ find bin -type f \( -name \*.jar -o -name \*-env \) -exec chmod a-x {} +
+ find bin -type f ! -name \*.jar -exec \
+ sed -r 's;source .*/(.*)-env;source /usr/share/elasticsearch6/\1-env;' -i {} +
+ find bin -type f -name "elasticsearch-*" ! -name elasticsearch-bin -exec \
+ sed 's/`dirname "$0"`/$(dirname "$(realpath "$0")")/' -i {} +
+}
+
+package() {
+ cd "$pkgdir"
+ install -dm750 etc/elasticsearch6{,/scripts}
+ install -dm755 {usr/share,var/lib,var/log}/elasticsearch6
+ install -dm755 usr/bin
+
+ cd "$srcdir"/$_pkgname-$pkgver
+ cp -R bin lib modules plugins "$pkgdir"/usr/share/elasticsearch6/
+
+ cd config
+ for conf in *; do
+ install -Dm644 "$conf" "$pkgdir/etc/elasticsearch6/$conf"
+ done
+
+ cd ..
+ mv bin/elasticsearch-env .
+ # find bin/ -type f -name elasticsearch-\* ! -name elasticsearch-cli -exec \
+ # ln -s ../share/elasticsearch6/{} "$pkgdir"/usr/{} \;
+ ln -s ../share/elasticsearch6/elasticsearch-keystore "$pkgdir"/usr/elasticsearch6-keystore
+ ln -s ../share/elasticsearch6/elasticsearch-plugin "$pkgdir"/usr/elasticsearch6-plugin
+ ln -s ../share/elasticsearch6/elasticsearch-shard "$pkgdir"/usr/elasticsearch6-shard
+ ln -s ../share/elasticsearch6/elasticsearch-translog "$pkgdir"/usr/elasticsearch6-translog
+
+ cd "$pkgdir"/usr/share/elasticsearch6
+ ln -s ../../../var/log/elasticsearch6 logs
+ ln -s ../../../var/lib/elasticsearch6 data
+
+ cd "$pkgdir"
+ install -Dm644 "$srcdir"/elasticsearch-env usr/share/elasticsearch6/elasticsearch-env
+ install -Dm644 "$srcdir"/elasticsearch.service usr/lib/systemd/system/elasticsearch6.service
+ install -Dm644 "$srcdir"/elasticsearch@.service usr/lib/systemd/system/elasticsearch6@.service
+ install -Dm644 "$srcdir"/elasticsearch-keystore.service usr/lib/systemd/system/elasticsearch6-keystore.service
+ install -Dm644 "$srcdir"/elasticsearch-keystore@.service usr/lib/systemd/system/elasticsearch6-keystore@.service
+ install -Dm644 "$srcdir"/elasticsearch-user.conf usr/lib/sysusers.d/elasticsearch6.conf
+ install -Dm644 "$srcdir"/elasticsearch-tmpfile.conf usr/lib/tmpfiles.d/elasticsearch6.conf
+ install -Dm644 "$srcdir"/elasticsearch-sysctl.conf usr/lib/sysctl.d/elasticsearch6.conf
+ install -Dm644 "$srcdir"/elasticsearch.default etc/default/elasticsearch6
+}
diff --git a/elasticsearch-env b/elasticsearch-env
new file mode 100644
index 000000000000..71e3a28cfd18
--- /dev/null
+++ b/elasticsearch-env
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+set -e -o pipefail
+
+ES_HOME=/usr/share/elasticsearch6
+
+# now set the classpath
+ES_CLASSPATH="$ES_HOME/lib/*"
+
+# now set the path to java
+if [ -x "$JAVA_HOME/bin/java" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+else
+ set +e
+ JAVA=`which java`
+ set -e
+fi
+
+if [ ! -x "$JAVA" ]; then
+ echo "could not find java; set JAVA_HOME or ensure java is in PATH"
+ exit 1
+fi
+
+# do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
+if [ ! -z "$JAVA_TOOL_OPTIONS" ]; then
+ echo "warning: ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS"
+ unset JAVA_TOOL_OPTIONS
+fi
+
+# JAVA_OPTS is not a built-in JVM mechanism but some people think it is so we
+# warn them that we are not observing the value of $JAVA_OPTS
+if [ ! -z "$JAVA_OPTS" ]; then
+ echo -n "warning: ignoring JAVA_OPTS=$JAVA_OPTS; "
+ echo "pass JVM parameters via ES_JAVA_OPTS"
+fi
+
+# check the Java version
+"$JAVA" -cp "$ES_CLASSPATH" org.elasticsearch.tools.java_version_checker.JavaVersionChecker
+
+export HOSTNAME=$HOSTNAME
+
+if [ -z "$ES_PATH_CONF" ]; then ES_PATH_CONF=/etc/elasticsearch6; fi
+
+if [ -z "$ES_PATH_CONF" ]; then
+ echo "ES_PATH_CONF must be set to the configuration path"
+ exit 1
+fi
+
+ES_DISTRIBUTION_FLAVOR=default
+ES_DISTRIBUTION_TYPE=tar
diff --git a/elasticsearch-keystore.service b/elasticsearch-keystore.service
new file mode 100644
index 000000000000..779cb4ec5b95
--- /dev/null
+++ b/elasticsearch-keystore.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Elasticsearch Keystore Generation
+ConditionPathExists=|!/etc/elasticsearch6/elasticsearch.keystore
+
+[Service]
+Type=oneshot
+Group=elasticsearch
+UMask=0007
+ExecStart=/usr/share/elasticsearch6/bin/elasticsearch-keystore create
+RemainAfterExit=yes
diff --git a/elasticsearch-keystore@.service b/elasticsearch-keystore@.service
new file mode 100644
index 000000000000..066b03d418f9
--- /dev/null
+++ b/elasticsearch-keystore@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Elasticsearch Keystore Generation
+ConditionPathExists=|!/etc/elasticsearch6/%I/elasticsearch.keystore
+
+[Service]
+Type=oneshot
+Group=elasticsearch
+UMask=0007
+Environment=ES_PATH_CONF=/etc/elasticsearch6/%I
+ExecStart=/usr/share/elasticsearch6/bin/elasticsearch-keystore create
+RemainAfterExit=yes
diff --git a/elasticsearch-sysctl.conf b/elasticsearch-sysctl.conf
new file mode 100644
index 000000000000..32da2c91cf27
--- /dev/null
+++ b/elasticsearch-sysctl.conf
@@ -0,0 +1 @@
+vm.max_map_count=262144 \ No newline at end of file
diff --git a/elasticsearch-tmpfile.conf b/elasticsearch-tmpfile.conf
new file mode 100644
index 000000000000..aa46faf69bf1
--- /dev/null
+++ b/elasticsearch-tmpfile.conf
@@ -0,0 +1,7 @@
+d /var/log/elasticsearch6 0755 elasticsearch elasticsearch -
+d /var/lib/elasticsearch6 0755 elasticsearch elasticsearch -
+d /usr/share/elasticsearch6/plugins 0755 elasticsearch elasticsearch -
+d /run/elasticsearch6 0755 elasticsearch elasticsearch -
+
+d /etc/elasticsearch6 0770 - elasticsearch -
+d /etc/elasticsearch6/scripts 0750 - elasticsearch -
diff --git a/elasticsearch-user.conf b/elasticsearch-user.conf
new file mode 100644
index 000000000000..d67b6c3fdde1
--- /dev/null
+++ b/elasticsearch-user.conf
@@ -0,0 +1 @@
+u elasticsearch - "Elasticsearch user"
diff --git a/elasticsearch.default b/elasticsearch.default
new file mode 100644
index 000000000000..ade7ae924ddd
--- /dev/null
+++ b/elasticsearch.default
@@ -0,0 +1,13 @@
+JAVA_HOME=/usr/lib/jvm/default-runtime
+
+# Heap Size (defaults to 256m min, 1g max)
+#ES_HEAP_SIZE=1g
+
+# Heap new generation
+#ES_HEAP_NEWSIZE=
+
+# max direct memory
+#ES_DIRECT_SIZE=
+
+# Additional Java OPTS
+#ES_JAVA_OPTS=
diff --git a/elasticsearch.service b/elasticsearch.service
new file mode 100644
index 000000000000..84401873c70e
--- /dev/null
+++ b/elasticsearch.service
@@ -0,0 +1,40 @@
+[Unit]
+Description=Elasticsearch
+Documentation=http://www.elastic.co
+Wants=elasticsearch-keystore.service
+Wants=network.target
+After=elasticsearch-keystore.service
+After=network.target
+
+[Service]
+Type=forking
+RuntimeDirectory=elasticsearch6
+PIDFile=/run/elasticsearch6/elasticsearch.pid
+
+Environment=JAVA_HOME=/usr/lib/jvm/default-runtime
+EnvironmentFile=-/etc/default/elasticsearch6
+Environment=ES_PATH_CONF=/etc/elasticsearch6
+Environment=ES_TMPDIR=/tmp
+
+PrivateTmp=true
+WorkingDirectory=/usr/share/elasticsearch6
+
+User=elasticsearch
+Group=elasticsearch
+
+ExecStart=/usr/share/elasticsearch6/bin/elasticsearch -d \
+ -p /run/elasticsearch6/elasticsearch.pid
+
+LimitNOFILE=65536
+LimitNPROC=4096
+LimitAS=infinity
+LimitFSIZE=infinity
+
+Restart=on-failure
+KillMode=process
+SendSIGKILL=no
+TimeoutStopSec=0
+SuccessExitStatus=143
+
+[Install]
+WantedBy=multi-user.target
diff --git a/elasticsearch@.service b/elasticsearch@.service
new file mode 100644
index 000000000000..006ce33b1fb1
--- /dev/null
+++ b/elasticsearch@.service
@@ -0,0 +1,40 @@
+[Unit]
+Description=Elasticsearch
+Documentation=http://www.elastic.co
+Wants=elasticsearch-keystore@%I.service
+Wants=network.target
+After=elasticsearch-keystore@%I.service
+After=network.target
+
+[Service]
+Type=forking
+RuntimeDirectory=elasticsearch6
+PIDFile=/run/elasticsearch6/%I.pid
+
+Environment=JAVA_HOME=/usr/lib/jvm/default-runtime
+EnvironmentFile=-/etc/default/elasticsearch6
+Environment=ES_PATH_CONF=/etc/elasticsearch6/%I
+Environment=ES_TMPDIR=/tmp
+
+PrivateTmp=true
+WorkingDirectory=/usr/share/elasticsearch6
+
+User=elasticsearch
+Group=elasticsearch
+
+ExecStart=/usr/share/elasticsearch6/bin/elasticsearch -d \
+ -p /run/elasticsearch6/%I.pid
+
+LimitNOFILE=65536
+LimitNPROC=4096
+LimitAS=infinity
+LimitFSIZE=infinity
+
+Restart=on-failure
+KillMode=process
+SendSIGKILL=no
+TimeoutStopSec=0
+SuccessExitStatus=143
+
+[Install]
+WantedBy=multi-user.target