"Fossies" - the Fresh Open Source Software Archive

Member "monasca-events-api-2.0.0/devstack/lib/elasticsearch.sh" (14 Oct 2020, 1339 Bytes) of package /linux/misc/openstack/monasca-events-api-2.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "elasticsearch.sh": 0.2.0_vs_0.3.0.

    1 #!/bin/bash
    2 
    3 # Copyright 2018 FUJITSU LIMITED
    4 #
    5 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    6 # not use this file except in compliance with the License. You may obtain
    7 # a copy of the License at
    8 #
    9 #      http://www.apache.org/licenses/LICENSE-2.0
   10 #
   11 # Unless required by applicable law or agreed to in writing, software
   12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   14 # License for the specific language governing permissions and limitations
   15 # under the License.
   16 
   17 _XTRACE_ELASTICSEARCH=$(set +o | grep xtrace)
   18 set +o xtrace
   19 
   20 function is_elasticsearch_enabled {
   21     is_service_enabled monasca-elasticsearch && return 0
   22     return 1
   23 }
   24 
   25 function configure_elasticsearch {
   26     if is_elasticsearch_enabled; then
   27         echo_summary "Configuring Elasticsearch for events handling"
   28         local service_file="/etc/systemd/system/devstack@elasticsearch.service"
   29         # This property disable elasticsearch check for dots in filed name,
   30         # Some event use dot in field name.
   31         local es_java_opts="ES_JAVA_OPTS=-Dmapper.allow_dots_in_name=true"
   32         iniset -sudo "$service_file" "Service" "Environment" "$es_java_opts"
   33         restart_process "elasticsearch" || true
   34     fi
   35 }
   36 
   37 $_XTRACE_ELASTICSEARCH