Bugzilla – Attachment 68094 Details for
Bug 19465
Allow choosing Elasticsearch server on instance creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19465: Add --elasticsearch-server option to koha-create
Bug-19465-Add---elasticsearch-server-option-to-koh.patch (text/plain), 4.64 KB, created by
Tomás Cohen Arazi
on 2017-10-13 19:05:15 UTC
(
hide
)
Description:
Bug 19465: Add --elasticsearch-server option to koha-create
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2017-10-13 19:05:15 UTC
Size:
4.64 KB
patch
obsolete
>From fc89b411640a9e5af37446ea09258e493e65cb45 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 13 Oct 2017 15:59:25 -0300 >Subject: [PATCH] Bug 19465: Add --elasticsearch-server option to koha-create > >This patch adds the --elasticsearch-server option switch to koha-create. >It allows choosing a different Elasticsearch configuration. It defaults >to the current 'localhost:9200' value. > >To test: >- Apply this patches >- Run: > $ reset_all > $ man koha-create >=> SUCCESS: The man page shows correct information about the added >option switch >- Run: > $ sudo koha-create --create-db test >=> SUCCESS: /etc/koha/sites/test/koha-conf.xml contains the default > value (i.e. the current behaviour is kept) >- Run: > $ sudo koha-create --create-db --elasticsearch-server tomas:1234 test2 >=> SUCCESS: /etc/koha/sites/test2/koha-conf.xml contains the passed > value in the <elasticsearch><server> section. >- Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > debian/scripts/koha-create | 14 +++++++++++++- > debian/templates/koha-conf-site.xml.in | 2 +- > 2 files changed, 14 insertions(+), 2 deletions(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 74888bc39e..8a3fcab57a 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -57,6 +57,8 @@ Options: > values are dom (default) and grs1. > --biblio-idx idx_mode Set the indexing mode for bibliographic records. > Valid values are dom (default) and grs1. >+ --elasticsearch-server s Enforce the use of the specified Elasticsearch server(s) >+ (default: localhost:9200). > --use-memcached Set the instance to make use of memcache. > --memcached-servers str Set a comma-separated list of host:port memcached servers. > --memcached-prefix str Set the desired prefix for the instance memcached namespace. >@@ -111,6 +113,7 @@ generate_config_file() { > -e "s/__DB_HOST__/$mysqlhost/g" \ > -e "s/__DB_USER__/$mysqluser/g" \ > -e "s/__DB_PASS__/$mysqlpwd/g" \ >+ -e "s/__ELASTICSEARCH_SERVER__/${ELASTICSEARCH_SERVER}/g" \ > -e "s/__UNIXUSER__/$username/g" \ > -e "s/__UNIXGROUP__/$username/g" \ > -e "s#__UPLOAD_PATH__#$UPLOAD_PATH#g" \ >@@ -398,6 +401,8 @@ PASSWDFILE="/etc/koha/passwd" > USE_MEMCACHED="no" > MEMCACHED_SERVERS="" > MEMCACHED_PREFIX="" >+# elasticsearch config >+ELASTICSEARCH_SERVER="localhost:9200" > # hardcoded memcached defaults > DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211" > DEFAULT_MEMCACHED_PREFIX="koha_" >@@ -433,7 +438,7 @@ fi > > [ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" ) > >-TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,adminuser:,memcached-servers:,memcached-prefix:,upload-path:,letsencrypt, \ >+TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,elasticsearch-server:,adminuser:,memcached-servers:,memcached-prefix:,upload-path:,letsencrypt, \ > -n "$0" -- "$@"` > > # Note the quotes around `$TEMP': they are essential! >@@ -448,6 +453,7 @@ CLO_BIBLIOS_INDEXING_MODE="" > CLO_AUTHORITIES_INDEXING_MODE="" > CLO_MEMCACHED_SERVERS="" > CLO_MEMCACHED_PREFIX="" >+CLO_ELASTICSEARCH_SERVER="" > CLO_UPLOAD_PATH="" > CLO_LETSENCRYPT="" > >@@ -467,6 +473,8 @@ while true ; do > CLO_MEMCACHED_SERVERS="$2" ; shift 2 ;; > --memcached-prefix) > CLO_MEMCACHED_PREFIX="$2" ; shift 2;; >+ --elasticsearch-server) >+ CLO_ELASTICSEARCH_SERVER="$2" ; shift 2 ;; > -m|--marcflavor) > CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; > -l|--zebralang) >@@ -537,6 +545,10 @@ then > PASSWDFILE="$CLO_PASSWDFILE" > fi > >+if [ "${CLO_ELASTICSEARCH_SERVER}" != "" ]; then >+ ELASTICSEARCH_SERVER="${CLO_ELASTICSEARCH_SERVER}" >+fi >+ > if [ "$CLO_BIBLIOS_INDEXING_MODE" != "" ]; then > BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE > fi >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index 8e8204f1aa..ae5b3e4dc3 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -323,7 +323,7 @@ __END_SRU_PUBLICSERVER__ > <plack_workers>2</plack_workers> > > <elasticsearch> >- <server>localhost:9200</server> >+ <server>__ELASTICSEARCH_SERVER__</server> > <index_name>koha___KOHASITE__</index_name> > </elasticsearch> > >-- >2.14.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19465
:
68094
|
68095
|
73953
|
73954
|
80748
|
80749
|
90074
|
96046
|
96047