From b9c9fd109e29d38bf314274f5bc75deb1db1f532 Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Tue, 17 Jan 2017 15:19:50 +0000 Subject: [PATCH] set api port in config test + doc clarification --- README.md | 10 ++++++---- templates/elasticsearch.j2 | 2 +- test/integration/config.yml | 3 ++- test/integration/multi.yml | 4 ++-- test/integration/package.yml | 2 +- test/integration/xpack.yml | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5b81475..ac88a52 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ The following illustrates applying configuration parameters to an Elasticsearch es_templates: false es_version_lock: false es_heap_size: 1g + es_api_port:9201 ``` ` The role utilises Elasticsearch version defaults. The following should be set to ensure a successful cluster forms. @@ -117,6 +118,7 @@ A more complex example: es_version_lock: false es_start_service: false es_plugins_reinstall: false + es_api_port:9201 es_plugins: - plugin: license - plugin: lmenezes/elasticsearch-kopf @@ -127,8 +129,8 @@ A more complex example: #### Important Note -The role uses es_api_host and es_api_port to communicate with the node for actions only achievable via http e.g. to install templates. These default to "localhost" and 9200 respectively. -If the node is deployed to bind on either a different host or port, these must be changed. +**The role uses es_api_host and es_api_port to communicate with the node for actions only achievable via http e.g. to install templates and to check the NODE IS ACTIVE. These default to "localhost" and 9200 respectively. +If the node is deployed to bind on either a different host or port, these must be changed.** ### Multi Node Server Installations @@ -174,7 +176,7 @@ recommended in any multi node cluster configuration. cluster.name: "test-cluster" } } - - { role: elasticsearch, es_instance_name: "node2", + - { role: elasticsearch, es_instance_name: "node2", es_api_port:9201, es_config: { discovery.zen.ping.unicast.hosts: "elastic02:9300", http.port: 9201, @@ -317,7 +319,7 @@ Additional parameters to es_config allow the customization of the Java and Elast * ```es_major_version``` (e.g. "5.1" ). Should be consistent with es_version. For versions >= 5.0 this must be "5.x". * ```es_version``` (e.g. "5.1.2"). * ```es_api_host``` The host name used for actions requiring HTTP e.g. installing templates. Defaults to "localhost". -* ```es_api_port``` The port used for actions requiring HTTP e.g. installing templates. Defaults to 9200. +* ```es_api_port``` The port used for actions requiring HTTP e.g. installing templates. Defaults to 9200. **CHANGE IF THE HTTP PORT IS NOT 9200** * ```es_api_basic_auth_username``` The Elasticsearch username for making admin changing actions. Used if Security is enabled. Ensure this user is admin. * ```es_api_basic_auth_password``` The password associated with the user declared in `es_api_basic_auth_username` * ```es_start_service``` (true (default) or false) diff --git a/templates/elasticsearch.j2 b/templates/elasticsearch.j2 index a86fe16..0c7f4a6 100644 --- a/templates/elasticsearch.j2 +++ b/templates/elasticsearch.j2 @@ -17,7 +17,7 @@ LOG_DIR={{log_dir}} # Elasticsearch PID directory PID_DIR={{pid_dir}} -#ES_JVM_OPTIONS={{conf_dir}}/jvm.options +ES_JVM_OPTIONS={{conf_dir}}/jvm.options # Configure restart on package upgrade (true, every other setting will lead to not restarting) #ES_RESTART_ON_UPGRADE=true diff --git a/test/integration/config.yml b/test/integration/config.yml index 2a05ebe..5c4d3d4 100644 --- a/test/integration/config.yml +++ b/test/integration/config.yml @@ -9,4 +9,5 @@ es_scripts: false es_templates: false es_version_lock: false - es_heap_size: 1g \ No newline at end of file + es_heap_size: 1g + es_api_port: 9201 \ No newline at end of file diff --git a/test/integration/multi.yml b/test/integration/multi.yml index 6bfa96c..e3f1f30 100644 --- a/test/integration/multi.yml +++ b/test/integration/multi.yml @@ -3,8 +3,8 @@ - name: Elasticsearch Multi tests hosts: localhost roles: - - { role: elasticsearch, es_instance_name: "master", es_data_dirs: ["/opt/elasticsearch/master"], es_config: { discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9200, transport.tcp.port: 9300, node.data: false, node.master: true, bootstrap.memory_lock: true } } - - { role: elasticsearch, es_instance_name: "node1", es_data_dirs: "/opt/elasticsearch/data-1,/opt/elasticsearch/data-2", es_config: { discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9201, transport.tcp.port: 9301, node.data: true, node.master: false } } + - { role: elasticsearch, es_api_port:9200, es_instance_name: "master", es_data_dirs: ["/opt/elasticsearch/master"], es_config: { discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9200, transport.tcp.port: 9300, node.data: false, node.master: true, bootstrap.memory_lock: true } } + - { role: elasticsearch, es_api_port:9201, es_instance_name: "node1", es_data_dirs: "/opt/elasticsearch/data-1,/opt/elasticsearch/data-2", es_config: { discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9201, transport.tcp.port: 9301, node.data: true, node.master: false } } vars: es_scripts: true es_templates: true diff --git a/test/integration/package.yml b/test/integration/package.yml index 015f08b..a1319a7 100644 --- a/test/integration/package.yml +++ b/test/integration/package.yml @@ -2,7 +2,7 @@ - name: Elasticsearch Package tests hosts: localhost roles: - - { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" } + - { role: elasticsearch, es_api_port:9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" } vars: es_scripts: true es_templates: true diff --git a/test/integration/xpack.yml b/test/integration/xpack.yml index 39099ba..a65f321 100644 --- a/test/integration/xpack.yml +++ b/test/integration/xpack.yml @@ -2,7 +2,7 @@ - name: Elasticsearch Xpack tests hosts: localhost roles: - - { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300", + - { role: elasticsearch, es_api_port:9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300", "xpack.security.authc.realms.file1.type": "file","xpack.security.authc.realms.file1.order": 0, "xpack.security.authc.realms.native1.type": "native","xpack.security.authc.realms.native1.order": 1 }, es_instance_name: "security_node" } vars: