Skip to content
Permalink
Browse files

Fixes #2400 - Local Elasticsearch is recognized as remote installation.

  • Loading branch information
Marcel Herrguth authored and thorsteneckel committed Nov 27, 2019
1 parent 8c27cbb commit a9dd93796844ca3a5d98743e542caf34e7d3c251
Showing with 5 additions and 4 deletions.
  1. +5 −4 contrib/packager.io/functions
@@ -228,10 +228,12 @@ function create_webserver_config () {
function setup_elasticsearch () {
echo "# Configuring Elasticsearch..."

ES_CONNECTION="$(zammad run rails r "puts Setting.get('es_url')" 2>> /dev/null)"
ES_CONNECTION="$(zammad run rails r "puts Setting.get('es_url')"| tail -n 1 2>> /dev/null)"

if [ -z "${ES_CONNECTION}" ]; then
ES_CONNECTION="http://127.0.0.1:9200"
echo "-- Nevermind, no es_url is set, leaving Elasticsearch untouched ...!"
echo "-- The above is all right if you don't want to use Elasticsearch (locally) - if this is not intended, consult https://docs.zammad.org !"
return 0
fi

if [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep mapper-attachments)" ]; then
@@ -252,8 +254,7 @@ function setup_elasticsearch () {
${INIT_CMD} restart elasticsearch
else
echo -e "\n It seems you're running an external Elasticsearch server on ${ES_CONNECTION}"
echo -e "Stopping local elasticsearch server..."
${INIT_CMD} stop elasticsearch
echo -e "\n We'll not touch your Elasticsearch on the local and remote system."

This comment has been minimized.

Copy link
@monotek

monotek Nov 27, 2019

Member

local or remote

This comment has been minimized.

Copy link
@MrGeneration

MrGeneration Nov 27, 2019

Collaborator

In my opinion local and remote is correct, because the line above It seems you're running an external Elasticsearch server on ${ES_CONNECTION} expects an external elasticsearch to be used.

Thus we will not touch the local and remote elasticsearch installation.
If you do not use ES at all, this message will not return. :x

This comment has been minimized.

Copy link
@monotek

monotek Nov 27, 2019

Member

"and" sounds for me as you would have 2 es servers

This comment has been minimized.

Copy link
@MrGeneration

MrGeneration Nov 27, 2019

Collaborator

Technically you do, because Elasticsearch is a package dependency of Zammad which enforces you to install a local Elasticsearch Server. :-)

This is the reason why we had a systemctl stop elasticsearch below the line I'm replacing. :-)

echo -e "\n Please get sure to install the 'ingest-attachment' plugin on your Elasticsearch server by:"
echo -e "/usr/share/elasticsearch/bin/elasticsearch-plugin -s install ingest-attachment"
echo -e "\nAfter this you might need to rebuild the searchindex by:"

0 comments on commit a9dd937

Please sign in to comment.
You can’t perform that action at this time.