Opendistroforelasticsearch-1.6.0.rpm fails to install if not connected to internet

When trying to install the rpm-based version offline, (with the repositorys synchronized from internet), it will fail to grab the /usr/lib/libKNNIndexV1_7_3_6.so from internet.

The %preinstall for opendistroforelasticsearch-1.6.0.rpm is like:

preinstall scriptlet (using /bin/sh):
RPM_ARCH=noarch
RPM_OS=linux
RPM_PACKAGE_NAME=opendistroforelasticsearch
RPM_PACKAGE_VERSION=1.6.0
RPM_PACKAGE_RELEASE=1

echo “Fetching kNN library”
FILE=/usr/lib/libKNNIndexV1_7_3_6.so
if [ -f “$FILE” ]
then
echo “$FILE exist: removing $FILE”
sudo rm $FILE
fi
FILE=/libKNNIndexV1_7_3_6.zip
if [ -f “$FILE” ]
then
echo “$FILE exist: removing $FILE”
sudo rm $FILE
fi
wget https://d3g5vo6xdbdb9a.cloudfront.net/downloads/k-NN-lib/libKNNIndexV1_7_3_6.zip
&& unzip libKNNIndexV1_7_3_6.zip
&& mv libKNNIndexV1_7_3_6.so /usr/lib
&& rm libKNNIndexV1_7_3_6.zip

This behaivour will not work if not connected to Internet… :frowning:

Why not put the file in the package itself, license issues?

Otherwise I think that I should be able to put the file in the local filesystem before installing the rpm.
(Maybe something like below. Have not tested it, but it should work…

if (wget https://d3g5vo6xdbdb9a.cloudfront.net/downloads/k-NN-lib/libKNNIndexV1_7_3_6.zip 2>/dev/null) ; then unzip libKNNIndexV1_7_3_6.zip \ && mv libKNNIndexV1_7_3_6.so /usr/lib \ && rm libKNNIndexV1_7_3_6.zip else echo "Check for local zip-file" if test -r /var/tmp/libKNNIndexV1_7_3_6.zip ; then tmp_dir=(mktemp -d -t libKNN-XXX)
&& unzip -d {tmp_dir} /var/tmp/libKNNIndexV1_7_3_6.zip \ && sudo mv {tmp_dir}/libKNNIndexV1_7_3_6.so /usr/lib
test -r {tmp_dir} && rm -rf {tmp_dir}
fi
fi

if [ -r “/var/tmp/libKNNIndexV1_7_3_6.zip” ] ; then
unzip /var/tmp/libKNNIndexV1_7_3_6.zip && mv libKNNIndexV1_7_3_6.so /usr/lib

I can confirm that, if you don’t have access to the Internet, installation through yum repository is completely useless.

We are using internal repository manager as proxy ( Sonatype Nexus , but you can youse any other ) to install OpenDistro, so in this situation installation is not possible.

Thaks for the info, but 1.4 works fine with offline installation. But I dont understa d why the library is not in the rpm instead? I am goung to see if i can rebuild it with local compilation of the library instead of downloading the library from amazon…

BR

Skickat från min iPhone

It’s a problem with version 1.6 , version 1.4 can be installed without any problems.

Thanks for bringing this up. We created a issue to fix this in 1.6.
https://github.com/opendistro-for-elasticsearch/opendistro-build/issues/120.