Skip to main content
Connect to an OpenSearch cluster

Connect to an OpenSearch cluster

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

You can connect to nodes 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 you connect to nodes in the OpenSearch cloud database cluster depends on the role of the node group — see the Node Groups instructions for more information on roles. You can:

View the address for connection

  1. In the Control panel, 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 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 ~/.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>:9200/"

    Specify:

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

Connect to a group node with the Control panel role

You can connect to a group node with the Control panel role through the OpenSearch Control panels web interface.

  1. Open the page in your browser:

    https://<ip_address>

    Specify <ip_address> — IP address of the group node with the Control panel 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.