Skip to main content

Connect to an OpenSearch cluster

To connect to an OpenSearch cluster, connect to nodes in the group with the Manager, Data, or Dashboard role. The choice of node for connection depends on the purpose of connection — for example, if you need to access the cluster dashboard, you should connect to a node in the group with the Dashboard role. For more information about node groups and their roles, see Node Groups.

You can:

TLS(SSL)-encryption is supported only when connecting via a private IP address.

Specify the port and address when connecting.

Connection ports

Use port 9200 to connect to the cluster nodes.

Addresses for connection

The address to connect to depends on where you are connecting from. You can select an address depending on one of the scenarios:

Connecting to the cluster from a private subnet

If you are connecting to the cluster from a private subnet, use a private IP address.

To connect from another private subnet, first connect both private subnets to the cloud router.

You can view the address to connect to in the control panel.

Connecting to the cluster from the Internet

If you are connecting to the cluster from the Internet, use a public IP address. The private subnet must meet the requirements. If the subnet does not meet the requirements, prepare it to connect a public IP address.

You can view the address to connect to in the control panel.

View the address for connection

  1. In the Dashboard, on the top menu, click Products and select Cloud Databases.
  2. Open the Active tab.
  3. Open the Database Cluster page → Connection tab.
  4. In the Connection Addresses block, open the tab of the node group whose addresses you want to view.

Connect to nodes in the group with the Manager and Data roles

Group nodes with the Manager and Data role can only be connected with SSL using a private IP address. Connecting using TLS(SSL)-encryption provides a secure connection between your server and the database cluster.

  1. Download the root certificate and place it in the ~/.opensearch/ folder:

    mkdir -p ~/.opensearch/
    wget https://storage.dbaas.selcloud.ru/CA.pem -O ~/.opensearch/root.crt
    chmod 0600 ~/.opensearch/root.crt
  2. Connect to the node:

    curl -XGET -u 'admin:<password>' --cacert ~/.opensearch/root.crt 'https://<ip_address>:<port>/'

    Specify:

    • <password> — password of the admin user;
    • <ip_address> — IP address of the node;
    • <port> — port for connection.

Connect to a group node with the Dashboard role

You can connect to a group node with the Dashboard role through the OpenSearch Dashboards web interface.

  1. Open the page in your browser:

    https://<ip_address>

    Specify <ip_address> — IP address of the group node with the Dashboard role.

  2. Enter login — admin.

  3. Enter password — set when creating the cluster. Once created, the password cannot be viewed in the control panel, but can be changed.

  4. To test the connection, run a test query in the Dev Tools console — for example, see the status of the cluster:

    GET _cluster/health

    The cluster status information will appear in the response.