For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/public-cloud/data-analytics/opensearch-getting-started.md.
  • English

OpenSearch™ - Getting started

View as Markdown

Learn how to configure a Cloud Analytics with OpenSearch™ service in the OVHcloud Control Panel.

OpenSearch™ is an open-source search and analytics suite used for various use cases related to log and data analysis, real-time monitoring, and application searching. Forked from Elasticsearch and Kibana, OpenSearch™ offers users a highly scalable system with easy access to large amounts of data and integrated metrics.

 

Requirements

 

Instructions

Subscribe to the service

From the OVHcloud Control Panel, navigate to the Data Analysis section via the Public Cloud menu.

Click the Create a database instance (+ Create a service if your project already contains services) button.

 

Step 1: Select your database type

Click on the engine you want to use and then (if available) select the version to install from the drop-down menu.

Manager order database type

 

Step 2: Select a service plan

In this step, choose an appropriate service plan. If needed, you will be able to upgrade the plan after creation.

Please see the Capabilities and limitations guide for detailed information on each plan's properties.

Manager order service plan

 

Step 3: Select a region

Choose the geographical region of the data center in which your service will be hosted.

Manager database order regions

 

Step 4: Select the node type

You can increase the number of nodes and choose the node template in this step. The initial and maximum number of nodes depends on the solution chosen in step 2.

Please visit the Capabilities and limitations guide for detailed information on the hardware resources and other properties of the engine installation.

Manager order node type

 

Step 5: Cluster sizing

Here you can add additional storage. Please take note of the pricing information.

Manager order cluster sizing

 

Step 6: Configure your options

Decide whether to attach your instance to a public network or a private network. If you select a Private network (vRack), you will need to select a network and subnetwork to attach.

Manager database order public network

 

Step 7: Review and confirm

The panel on the right side of the screen will display a summary of your order.

In a matter of minutes, your new service will be deployed. Message banners in the OVHcloud Control Panel will inform you when the service is ready to use.

Manager order summary

 

Configure the OpenSearch™ service

Once the OpenSearch™ service is up and running, you will have to define at least one user and one authorized IP to fully connect to the service.

 

Step 1 (mandatory): Set up a new user

Switch to the Users tab. An admin user is pre-configured during the service installation. You can add more users by clicking on the button + Add user.

Enter a username, then click Create User.

Once the user is created, the password is generated. Please keep it secure, as it will not be shown again.

Manager users tab

Passwords can be created for the admin user or changed for all afterward by clicking the more options ... button in that user's row of the table.

Manager users tab more options

 

Step 2 (mandatory): Configure authorized IPs

Warning

NOTE: For security reasons, the default network configuration doesn't allow any incoming connections. You must authorize suitable IP addresses to successfully access your service.

Switch to the Configuration tab. At least one IP address must be authorized here before you can connect to your service. It can be your laptop IP, for example.

In the IPs panel, enter the information for the IP you wish to authorize and click the add + button. Click Save changes when you are finished.

Clicking on + Add an IP address or IP block (CIDR) opens a new window in which you can add single IP addresses or blocks to allow access to the service.

Manager configuration tab

You can edit and remove access to your service via the delete ⛔️ button.

If you don't know how to get your IP, please visit a website such as www.WhatismyIP.com. Copy the IP address numbers shown on this website and save them for later.

Tip

Success! Your OpenSearch™ service is now fully accessible!

Optionally, you can configure access control lists (ACLs) for granular permissions.

 

Optional: Configure ACLs

OpenSearch™ supports index-level access control lists (ACLs) to control permissions. This approach allows you to limit the operations that are available to specific connections and to restrict access to certain data sets, which improves the security of your data.

You first have to enable the ACLs functionality, and then you can add ACLs for all users:

DBaaS getting started - step 12

You can grant the following permissions:

  • Administrator: full access to APIs and documents
  • Read-only: allows only searching and retrieving documents
  • Write: allows updating, adding, and deleting documents
  • Read and write: full access to documents
  • none: no access

DBaaS getting started - step 13

Warning

NOTE: Write permission allows the service user to create new indexes that match the pattern, but it does not allow the deletion of those indexes.

Rules are defined separately for each user as permission/index model combinations. The index model, also called pattern, defines the indexes that the permission applies to. Patterns are glob-style, where * matches any number of characters and ? matches any character.

DBaaS getting started - step 14

When multiple rules match, they are applied in the order listed above. If ACLs are enabled and no rules match, access is denied.

 

Control access to top-level APIs

OpenSearch™ has several “top-level” API endpoints (_mget, _msearch, and so on), where you have to grant access separately. To do this, use patterns similar to the index patterns, for example:

  • Administrator/_* would grant unlimited access to all top-level APIs
  • Administrator/_msearch grants unlimited access to the _msearch API only

 

Access control and OpenSearch™ Dashboards

Enabling ACLs does not restrict access to OpenSearch™ Dashboards itself, but all requests made by OpenSearch™ Dashboards are checked against the current user’s ACLs.

In practice, for OpenSearch™ Dashboards to work properly, you must grant the user admin-level access to the _msearch interface (permission: Administrator, pattern: _msearch).

 

Advanced configuration

Index patterns

An index contains a schema. Each data is based on a basic unit, which is a JSON document, indexed with a unique ID. Indexing is the method used to store data by the search engine for fast retrieval.

You can learn more by browsing the OpenSearch™ indexing documentation.

It's not mandatory, but if needed, you can add new indices.

Manager index patterns tab

Please enter the name of the pattern that you want to create.

Manager index patterns tab add pattern

 

Automatic backups

OVHcloud performs daily backups for your OpenSearch™ service. To find them, switch to the Backups tab. Backups will be created automatically, and retention time depends on the service plan. Please read the Capabilities and limitations guide for detailed information on each plan's properties.

You can restore and delete backups via the more options ... button.

Manager backups tab

 

Connection to the OpenSearch™ Dashboard

Warning

NOTE: Verify that the IP address visible from your browser application is part of the "Authorized IPs" defined for this OpenSearch™ service.

From the General information tab in your OpenSearch™ service, you can get the Kibana service URI. Use it to combine with the user login and password in a web browser, and you will go to this page:

Home - OpenSearch getting started

 

Load sample data

Warning

NOTE: If you have enabled ACLs in a previous step and don't want to disable them, then make sure your user is granted read and write permissions to:

  • opensearch_dashboards_sample_data_*
  • _bulk
  • _mget

Without these permissions, you cannot add the sample data and view the corresponding dashboard.

As proposed natively in OpenSearch™, we can load sample data to the OpenSearch™ service:

Add data - OpenSearch getting started

For the following example, we will use the Sample web logs.

Once imported, you can get access to the main OpenSearch™ dashboard created for this sample. Click on the View Data button:

Logs - OpenSearch getting started

The dashboard and queries can be edited directly through this web interface.

 

Load your data

If you want to load your data, you have multiple ways. Please take a look at the official OpenSearch™ documentation.

 

Query the OpenSearch™ service

DB queries with cURL

Once the service is up and configured, you can try to connect from a remote session to it. You need to have at least:

  • the user login and password, with accurate ACLs if enabled;
  • the URI of the OpenSearch™ service. It can be found in the Dashboard tab.
Warning

NOTE: Verify that the IP address of your system running the cURL command is part of the Authorised IPs defined for this OpenSearch™ service.

Once ready, try this in a command line, with your user and password:

export OPENSEARCH_URI=https://user1:2fakeSVV5wvyPykF@opensearch-682faf00-682faf00.database.cloud.ovh.us:20184

Then try to connect:

curl $OPENSEARCH_URI

The response should be similar to:

{
"name" : "opensearch-682faf00-1",
"cluster_name" : "ba1b1006-776a-4686-9c3c-9f65d4d73467",
"cluster_uuid" : "UoyMAkrISd6r1rIVYn4q5g",
"version" : {
"distribution" : "opensearch",
"number" : "1.1.0",
"build_type" : "unknown",
"build_hash" : "unknown",
"build_date" : "2021-11-15T16:09:53.881093Z",
"build_snapshot" : false,
"lucene_version" : "8.9.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}

Now create an index:

curl -X PUT $OPENSEARCH_URI/my-index

In case of a wrongly defined ACL for the user, the response will be similar to:

<html><body>
<h1>403 Forbidden</h1>
Request forbidden by administrative rules.<br/>
(reason: PUT /my-index/ not allowed)
</body></html>

Try to add a document:

curl -X PUT $OPENSEARCH_URI/my-index/_doc/1' -H 'Content-Type: application/json' -d '{"Description": "To be or not to be, that is the question."}'

Retrieve the data:

curl -X GET $OPENSEARCH_URI/my-index/_doc/1

Delete the data:

curl -X DELETE $OPENSEARCH_URI/my-index/_doc/1

Delete the index:

curl -X DELETE $OPENSEARCH_URI/my-index/

 

DB queries with the Dashboard Dev Tool

For direct queries with a web interface to the OpenSearch™ service, you can use the Dev Tools available in the menu:

Side navigation - OpenSearch getting started

The Console is split into two: a left column for the command to execute, and a right column for the results.

Click on the triangle to execute the highlighted request.

Execute request - OpenSearch getting started - step 1

We can execute the same commands as we did with cURL:

Execute request - OpenSearch getting started - step 2

 

Go further

Your service is now configured. To go further, view the OpenSearch™ documentation or visit the GitHub examples repository to find out how to connect to your service with several languages.

Browse all the Analytics guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about Cloud Analytics on the OVHcloud US website.