...
Run the Swarm Elasticsearch configuration script
/usr/share/caringo-elasticsearch-search/bin/configure_elasticsearch_with_swarm_search.py
on the first Elasticsearch node (e.g., es75-01).Enter the Elasticsearch cluster name (e.g., swarm-es75).
Code Block language bash Checking ES version... elasticsearch 7 detected ================= About to prompt for Elasticsearch config information, config=None Prompting admin for configuration input Enter Elasticsearch cluster name [A string]: swarm-es75
Enter the list of all Elasticsearch server names or private network IP addresses.
Code Block language bash Enter List of all the Elasticsearch server names in cluster [Comma-separated list of DNS-resolvable names or IP addresses]:192.168.9.21,192.168.9.22,192.168.9.23
Enter the name of the current Elasticsearch node.
Code Block language bash Enter this Elasticsearch node's name [A string name from the list entered above]: 192.168.9.21
The configuration script generates a custom Elasticsearch configure file for each node in the Elasticsearch cluster:
The other nodes’ files are
/etc/elasticsearch/elasticsearch.yml.<node-ip>
The current node’s file is
/etc/elasticsearch/elasticsearch.yml
Code Block language yaml ll /etc/elasticsearch/ -rw-rw----. 1 root elasticsearch 199 Jan 13 11:50 elasticsearch.keystore -rwxr-xr--. 1 root elasticsearch 3549 Jan 13 11:57 elasticsearch.yml -rwxr-xr--. 1 root root 3355 Jan 13 11:57 elasticsearch.yml.192.168.9.22 -rwxr-xr--. 1 root root 3355 Jan 13 11:57 elasticsearch.yml.192.168.9.23 -rw-rw----. 1 root elasticsearch 2847 Jan 15 2020 elasticsearch.yml-2022-01-13T11:57:17.bak -rw-rw-r--. 1 root elasticsearch 2436 Jan 13 11:57 jvm.options -rw-rw----. 1 root elasticsearch 2276 Jan 15 2020 jvm.options-2022-01-13T11:57:17.bak -rw-rw----. 1 root elasticsearch 17545 Jan 15 2020 log4j2.properties -rw-rw----. 1 root elasticsearch 473 Jan 15 2020 role_mapping.yml -rw-rw----. 1 root elasticsearch 197 Jan 15 2020 roles.yml -rw-rw----. 1 root elasticsearch 0 Jan 15 2020 users -rw-rw----. 1 root elasticsearch 0 Jan 15 2020 users_roles
Verify the Elasticsearch configuration files of all Elasticsearch nodes.
Code Block language yaml vi /etc/elasticsearch/elasticsearch.yml # ======================== Elasticsearch Configuration ========================= # Caringo (elasticsearch 7) render date: 2022-01-13T03:51:17Z # # 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 primary 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 consult the documentation for further information on configuration options: # https://www.elastic.co/guide/en/elasticsearch/reference/index.html # # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # cluster.name: swarm-es75 # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: 192.168.9.21 # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # path.data: /var/lib/elasticsearch # # Path to log files: # path.logs: /var/log/elasticsearch # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # bootstrap.memory_lock: true # # Make sure that the heap size is set to about half the memory available # on the system and that the owner of the process is allowed to use this # limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # Increasing from default 200 but it might not really help if there are not enough nodes to keep up. thread_pool.write.queue_size: 1000 # # ---------------------------------- Network ----------------------------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # #network.host: 0.0.0.0 network.host: 192.168.9.21 # # Set a custom port for HTTP: # #http.port: 9200 # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when this node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # discovery.seed_hosts: ["192.168.9.21", "192.168.9.22", "192.168.9.23"] # # Bootstrap the cluster using an initial set of master-eligible nodes: # cluster.initial_master_nodes: ["192.168.9.21", "192.168.9.22", "192.168.9.23"] # # For more information, consult the discovery and cluster formation module documentation. # # By default nodes can be both master or data but if set will be preserved # node.master: true node.data: true # # This should be set to 1 in Production # node.max_local_storage_nodes: 1 # # ---------------------------------- Gateway ----------------------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # gateway.recover_after_nodes: 2 # gateway.expected_nodes: 3 # # For more information, consult the gateway module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices: # #action.destructive_requires_name: true # # Disable automatic index creation, except for csmeter indices, Swarm NFS connectors, and ES watcher feature. action.auto_create_index: "+csmeter*,+*_nfsconnector,.watches,.triggered_watches,.watcher-history-*"
Copy the generated Elasticsearch configure file to other nodes.
Code Block language bash scp /etc/elasticsearch/elasticsearch.yml.192.168.9.22 root@192.168.9.22:/etc/elasticsearch/. scp /etc/elasticsearch/elasticsearch.yml.192.168.9.23 root@192.168.9.23:/etc/elasticsearch/.
SSH to other nodes of the Elasticsearch cluster to run the configuration script.
On ES75-02 node,
Code Block language bash ssh root@192.168.9.22 /usr/share/caringo-elasticsearch-search/bin/configure_elasticsearch_with_swarm_search.py -c \ /etc/elasticsearch/elasticsearch.yml.192.168.9.22
On ES75-03 node,
Code Block language bash ssh root@192.168.9.23 /usr/share/caringo-elasticsearch-search/bin/configure_elasticsearch_with_swarm_search.py -c \ /etc/elasticsearch/elasticsearch.yml.192.168.9.23
...