From 380a209ffa9f0b1d8e40cd0afea8dd2f62e16360 Mon Sep 17 00:00:00 2001 From: ashwinkumar12345 Date: Wed, 20 Oct 2021 11:25:46 -0700 Subject: [PATCH 1/3] ansible steps --- _opensearch/install/ansible.md | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 _opensearch/install/ansible.md diff --git a/_opensearch/install/ansible.md b/_opensearch/install/ansible.md new file mode 100644 index 00000000..867bb8f7 --- /dev/null +++ b/_opensearch/install/ansible.md @@ -0,0 +1,55 @@ +--- +layout: default +title: Ansible playbook +parent: Install OpenSearch +nav_order: 60 +--- + +# Ansible playbook + +You can use an Ansible playbook to install and configure a production-ready OpenSearch cluster along with OpenSearch Dashboards. + +The Ansible playbook only supports deployment of OpenSearch / OpenSearch Dashboards to CentOS7 hosts. +{: .note } + +## Prerequisites + +Make sure you have [Ansible](https://www.ansible.com/) and [Java 8](https://www.java.com/en/download/manual.jsp) installed. + +## Run OpenSearch and OpenSearch Dashboards using Ansible playbook + +1. Clone the OpenSearch [ansible-playbook](https://github.com/opensearch-project/ansible-playbook) repository: + + ```bash + git clone https://github.com/opensearch-project/ansible-playbook + ``` + +1. Run the Ansible playbook with root privileges: + + ```bash + ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 opensearch-dashboards-server_password=Test@6789" + ``` + + You can set the passwords for the reserved users (`admin` and `opensearch-dashboards-server`) using the `admin_password` and `opensearch-dashboards-server_password` variables. + +1. After the deployment process is complete, you can access OpenSearch / OpenSearch Dashboards with username `admin` and the password that you set for the `admin_password` variable. + + ```bash + curl -XGET https://localhost:9200 -u 'admin:Test@123' --insecure + ``` + +## Configuration + +You can modify the default configuration values in the `inventories/opensearch/group_vars/all/all.yml` file. +For example, you can increase the Java memory heap size: + +```bash +xms_value: 8 +xmx_value: 8 +``` + +You can configure node properties in the `inventories/opensearch/hosts` file. Specify the IP addresses of the nodes that you want the Ansible playbook to connect to with the `ansible_host` property: + +```bash +ansible_host= ansible_user=root ip= +``` From 95dc1be29c7531f8fdc2584304c529a9fb41754f Mon Sep 17 00:00:00 2001 From: ashwinkumar12345 Date: Tue, 2 Nov 2021 12:03:02 -0700 Subject: [PATCH 2/3] Added Ansible playbook docs --- _opensearch/install/ansible.md | 51 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/_opensearch/install/ansible.md b/_opensearch/install/ansible.md index 867bb8f7..3302454a 100644 --- a/_opensearch/install/ansible.md +++ b/_opensearch/install/ansible.md @@ -9,14 +9,14 @@ nav_order: 60 You can use an Ansible playbook to install and configure a production-ready OpenSearch cluster along with OpenSearch Dashboards. -The Ansible playbook only supports deployment of OpenSearch / OpenSearch Dashboards to CentOS7 hosts. +The Ansible playbook only supports deployment of OpenSearch and OpenSearch Dashboards to CentOS7 hosts. {: .note } ## Prerequisites Make sure you have [Ansible](https://www.ansible.com/) and [Java 8](https://www.java.com/en/download/manual.jsp) installed. -## Run OpenSearch and OpenSearch Dashboards using Ansible playbook +## Configuration 1. Clone the OpenSearch [ansible-playbook](https://github.com/opensearch-project/ansible-playbook) repository: @@ -24,32 +24,39 @@ Make sure you have [Ansible](https://www.ansible.com/) and [Java 8](https://www. git clone https://github.com/opensearch-project/ansible-playbook ``` +2. Configure the node properties in the `inventories/opensearch/hosts` file: + + ```bash + ansible_host= ansible_user=root ip= + ``` + + where: + + - `ansible_host` is the IP address of the target node that you want the Ansible playbook to install OpenSearch and OpenSearch DashBoards on. + - `ip` is the IP address that you want OpenSearch and OpenSearch DashBoards to bind to. You can specify the private IP of the target node, or localhost, or 0.0.0.0. + +3. You can modify the default configuration values in the `inventories/opensearch/group_vars/all/all.yml` file. For example, you can increase the Java memory heap size: + + ```bash + xms_value: 8 + xmx_value: 8 + ``` + +Make sure you have direct SSH access into the root user of the target node. +{: .note } + +## Run OpenSearch and OpenSearch Dashboards using Ansible playbook + 1. Run the Ansible playbook with root privileges: ```bash - ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 opensearch-dashboards-server_password=Test@6789" + ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789" ``` - You can set the passwords for the reserved users (`admin` and `opensearch-dashboards-server`) using the `admin_password` and `opensearch-dashboards-server_password` variables. + You can set the passwords for reserved users (`admin` and `kibanaserver`) using the `admin_password` and `kibanaserver_password` variables. -1. After the deployment process is complete, you can access OpenSearch / OpenSearch Dashboards with username `admin` and the password that you set for the `admin_password` variable. +2. After the deployment process is complete, you can access OpenSearch and OpenSearch Dashboards with the username `admin` and the password that you set for the `admin_password` variable: ```bash - curl -XGET https://localhost:9200 -u 'admin:Test@123' --insecure + curl https://localhost:9200 -u 'admin:Test@123' --insecure ``` - -## Configuration - -You can modify the default configuration values in the `inventories/opensearch/group_vars/all/all.yml` file. -For example, you can increase the Java memory heap size: - -```bash -xms_value: 8 -xmx_value: 8 -``` - -You can configure node properties in the `inventories/opensearch/hosts` file. Specify the IP addresses of the nodes that you want the Ansible playbook to connect to with the `ansible_host` property: - -```bash -ansible_host= ansible_user=root ip= -``` From 610334f9ebd9a87fd581fbd4ae840a0aed49101f Mon Sep 17 00:00:00 2001 From: ashwinkumar12345 Date: Tue, 2 Nov 2021 12:57:04 -0700 Subject: [PATCH 3/3] incorporated feedback --- _opensearch/install/ansible.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_opensearch/install/ansible.md b/_opensearch/install/ansible.md index 3302454a..47a91a8d 100644 --- a/_opensearch/install/ansible.md +++ b/_opensearch/install/ansible.md @@ -55,8 +55,12 @@ Make sure you have direct SSH access into the root user of the target node. You can set the passwords for reserved users (`admin` and `kibanaserver`) using the `admin_password` and `kibanaserver_password` variables. -2. After the deployment process is complete, you can access OpenSearch and OpenSearch Dashboards with the username `admin` and the password that you set for the `admin_password` variable: +2. After the deployment process is complete, you can access OpenSearch and OpenSearch Dashboards with the username `admin` and the password that you set for the `admin_password` variable. + + If you bind `ip` to a private IP or localhost, make sure you're logged into the server that deployed the playbook to access OpenSearch and OpenSearch Dashboards: ```bash curl https://localhost:9200 -u 'admin:Test@123' --insecure ``` + + If you bind `ip` to 0.0.0.0, then replace `localhost` with the public IP or the private IP (if it's in the same network).