<property> <name>content</name> <display-name>Elasticsearch config file template</display-name> <description>This is the template for elasticsearch.yml file</description> <value> # ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primages/ambari二次开发二/imary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please see the documentation for further information on configuration options:
# ---------------------------------- Cluster ----------------------------------- # Use a descriptive name for your cluster: cluster.name: {{cluster_name}}
# ------------------------------------ Node ------------------------------------ # Use a descriptive name for the node: node.name: {{hostname}}
# Add custom attributes to the node: node.attr.rack: {{node_attr_rack}}
# ----------------------------------- Paths ------------------------------------ # Path to directory where to store the data (separate multiple locations by comma): path.data: {{path_data}}
# Path to log files: path.logs: {{elastic_log_dir}}
# ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # bootstrap.memory_lock: {{bootstrap_memory_lock}}
# ---------------------------------- Network ----------------------------------- # Set the bind address to a specific IP (IPv4 or IPv6): network.host: {{hostname}}
# Set a custom port for HTTP: http.port: {{elasticsearch_port}} transport.tcp.port: 9300
# ----------------------------------- Head Requires ----------------------------------- http.cors.enabled: {{http_cors_enabled}} http.cors.allow-origin: "{{http_cors_allow_origin}}" # --------------------------------- Discovery ---------------------------------- # Pass an initial list of hosts to perform discovery when new node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] discovery.zen.ping.unicast.hosts: {{discovery_zen_ping_unicast_hosts}}
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1): discovery.zen.minimum_master_nodes: {{discovery_zen_minimum_master_nodes}}
# ---------------------------------- Gateway ----------------------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # gateway.recover_after_nodes: {{gateway_recover_after_nodes}} # # For more information, consult the gateway module documentation. # # ---------------------------------- Various 123----------------------------------- # # Require explicit names when deleting indices: # action.destructive_requires_name: {{action_destructive_requires_name}} {% if ping_timeout_default %}
{ "name":"es_head_webui", "label":"Es Head Web UI", "description":"This host-level alert is triggered if the Es Head Web UI is unreachable.", "interval":1,// 单位:分钟 "scope":"ANY", "source":{ "type":"WEB", "uri":{ "http":"{{elastic-config/elasticsearch_head_port}}",// 可直接追加端口号,参数变量用{{}}标识,当前发现只识别configuration目录下的xml文件内的属性。如果参数变量不符合语法,就会读取https。 "https":"{{elastic-config/elasticsearch_head_port}}", "https_property":"http",// 当这里值是http时,就检测http链接;当这里值是https时,就检测的https链接。 "https_property_value":"https", "connection_timeout":5.0, "default_port":9100// 默认端口。假如上面的http和https参数变量填的都报错,系统就会默认使用这个端口号,加上当前组件的主机名,构成一个web ui链接。也就是http://hadoop1:9100 }, "reporting":{ "ok":{ "text":"HTTP {0} response in {2:.3f}s" }, "warning":{ "text":"HTTP {0} response from {1} in {2:.3f}s ({3})" }, "critical":{ "text":"Connection failed to {1} ({3})" } } } }
result = os.path.exists(elastic_head_pid_file) if result: result_code = 'OK' es_head_process_running = True else: # OK、WARNING、CRITICAL、UNKNOWN、NONE result_code = 'CRITICAL' es_head_process_running = False
if host_name isNone: host_name = socket.getfqdn()
# 告警时显示的内容Response alert_label = 'Elasticsearch Head is running on {0}'if es_head_process_running else'Elasticsearch Head is NOT running on {0}' alert_label = alert_label.format(host_name)