Skip to main content
Connect to an OpenSearch cluster
Last update:

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 to connect to depends on the purpose of the connection — for example, if you want 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 the manual Groups of nodes.

Nodes can be connected to by IP address: private or public. If you need to configure access to the node from the Internet, connect a public IP address.

Ports

Use port 9200 to connect to the cluster nodes.

Ways of connection

The way to connect to the nodes of the OpenSearch cloud database cluster depends on the role of the node group — more information about roles in the manual Groups of nodes. You can:

View the address for connection

  1. В control panels from the top menu, press Products and select Managed databases.
  2. Open the tab Active.
  3. Open the Database Cluster page → tab Connection.
  4. In the block Addresses for connection 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 be connected to from program code with SSL. 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 folder ~/.opensearch/:

    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>:9200/"

    Specify:

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

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 the login — admin.

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

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

    GET _cluster/health

    The cluster status information will appear in the response.