Allow starting without Elasticsearch. (#171)
* Allow starting without Elasticsearch. * Document running without Elasticsearch in the README.md.
This commit is contained in:
parent
83438a63a4
commit
cf3fd9c090
@ -40,6 +40,12 @@ Like this, you can add your `docker-compose.prod.yml` to a branch of your Git re
|
||||
|
||||
* RANCHER_URL=http://RANCHER_HOST:8080 rancher-compose --env-file=.env up
|
||||
|
||||
## Running without Elasticsearch
|
||||
|
||||
Elasticsearch is an optional, but strongly recommended dependency for Zammad. More details can be found in the [documentation](https://docs.zammad.org/en/latest/prerequisites/software.html#elasticsearch-optional). There are however certain scenarios when running without Elasticsearch may be desired, e.g. for very small teams, for teams with limited budget or as a temporary solution for an unplanned Elasticsearch downtime or planned cluster upgrade.
|
||||
|
||||
Elasticsearch is enabled by default in the example `docker-compose.yml` file. It is also by default required to run the "zammad-init" command. Disabling Elasticsearch is possible by setting a special environment variable: `ELASTICSEARCH_ENABLED=false` for the `zammad-init` container and removing all references to Elasticsearch everywhere else: the `zammad-elasticsearch` container, it's volume and links to it.
|
||||
|
||||
## Upgrading
|
||||
|
||||
### From =< 3.3.0-12
|
||||
|
@ -3,6 +3,7 @@
|
||||
set -e
|
||||
|
||||
: "${AUTOWIZARD_JSON:=''}"
|
||||
: "${ELASTICSEARCH_ENABLED:=true}"
|
||||
: "${ELASTICSEARCH_HOST:=zammad-elasticsearch}"
|
||||
: "${ELASTICSEARCH_PORT:=9200}"
|
||||
: "${ELASTICSEARCH_SCHEMA:=http}"
|
||||
@ -74,32 +75,36 @@ if [ "$1" = 'zammad-init' ]; then
|
||||
else
|
||||
bundle exec rake db:migrate
|
||||
fi
|
||||
|
||||
|
||||
# es config
|
||||
echo "changing settings..."
|
||||
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')"
|
||||
|
||||
bundle exec rails r "Setting.set('es_index', '${ELASTICSEARCH_NAMESPACE}')"
|
||||
|
||||
if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then
|
||||
bundle exec rails r "Setting.set('es_user', \"${ELASTICSEARCH_USER}\")"
|
||||
bundle exec rails r "Setting.set('es_password', \"${ELASTICSEARCH_PASS}\")"
|
||||
fi
|
||||
|
||||
until (echo > /dev/tcp/${ELASTICSEARCH_HOST}/${ELASTICSEARCH_PORT}) &> /dev/null; do
|
||||
echo "zammad railsserver waiting for elasticsearch server to be ready..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
if [ "${ELASTICSEARCH_SSL_VERIFY}" == "false" ]; then
|
||||
SSL_SKIP_VERIFY="-k"
|
||||
if [ "${ELASTICSEARCH_ENABLED}" == "false" ]; then
|
||||
bundle exec rails r "Setting.set('es_url', '')"
|
||||
else
|
||||
SSL_SKIP_VERIFY=""
|
||||
fi
|
||||
|
||||
if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then
|
||||
echo "rebuilding es searchindex..."
|
||||
bundle exec rake searchindex:rebuild
|
||||
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')"
|
||||
|
||||
bundle exec rails r "Setting.set('es_index', '${ELASTICSEARCH_NAMESPACE}')"
|
||||
|
||||
if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then
|
||||
bundle exec rails r "Setting.set('es_user', \"${ELASTICSEARCH_USER}\")"
|
||||
bundle exec rails r "Setting.set('es_password', \"${ELASTICSEARCH_PASS}\")"
|
||||
fi
|
||||
|
||||
until (echo > /dev/tcp/${ELASTICSEARCH_HOST}/${ELASTICSEARCH_PORT}) &> /dev/null; do
|
||||
echo "zammad railsserver waiting for elasticsearch server to be ready..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
if [ "${ELASTICSEARCH_SSL_VERIFY}" == "false" ]; then
|
||||
SSL_SKIP_VERIFY="-k"
|
||||
else
|
||||
SSL_SKIP_VERIFY=""
|
||||
fi
|
||||
|
||||
if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then
|
||||
echo "rebuilding es searchindex..."
|
||||
bundle exec rake searchindex:rebuild
|
||||
fi
|
||||
fi
|
||||
|
||||
# chown everything to zammad user
|
||||
|
Loading…
Reference in New Issue
Block a user