Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Accessing an Elasticsearch Cluster Using cURL Commands

Updated on 2024-11-20 GMT+08:00

Open-source Elasticsearch provides a series of RESTful APIs. You can run cURL commands to access these APIs using tools such as Kibana and Postman. This topic describes how to use cURL commands to access an Elasticsearch or OpenSearch cluster.

Prerequisites

  • CSS has an Elasticsearch or OpenSearch cluster that is available.
  • An ECS has been created, and it is in the same VPC and security group as the CSS cluster.
    • If they are not in the same security group, modify the ECS security group, or configure the inbound and outbound rules of the group to allow all access from the cluster. For details, see Configuring Security Group Rules.
    • For details about how to use an ECS, see Purchasing a Custom ECS.

Accessing a Cluster

  1. Obtain the private network address of the cluster. It is used to access the cluster.

    This topic uses a private IP address as an example to describe how to access a cluster. The cluster access address varies with the network configurations used. For details, see Network Configuration.

    1. In the navigation pane on the left, choose Clusters.
    2. In the cluster list, obtain the IP address of the cluster you want to access from the Private Network Address column. Generally, the IP address format is <host>:<port> or <host>:<port>,<host>:<port>.

      If the cluster has only one node, the IP address and port number of this one node are displayed, for example, 10.62.179.32:9200. If the cluster has multiple nodes, the IP addresses and port numbers of all nodes are displayed, for example, 10.62.179.32:9200,10.62.179.33:9200.

  2. Run one of the following commands on the ECS to access the cluster. The access command varies according to the security mode of the cluster.
    • Cluster in non-security mode
      curl "http://<host>:<port>"
    • Cluster in security mode + HTTP
      curl -u <user>:<password> "http://<host>:<port>"
    • Cluster in security mode + HTTPS
      curl -u <user>:<password> -k "https://<host>:<port>"
    Table 1 Variables

    Variable

    Description

    <host>

    IP address of each node in the cluster. If the cluster contains multiple nodes, there will be multiple IP addresses. You can use any of them.

    <port>

    Port number for accessing a cluster node. Generally, the port number is 9200.

    <user>

    Username for accessing the cluster.

    <password>

    Password of the user.

    If the password contains special characters, enclose the username and password in single quotation marks, for example, curl -u "user:password!" "http://<host>:<port>".

    An access example is as follows:

    curl "http://10.62.176.32:9200"

    Information similar to the following is displayed:

    HTTP/1.1 200 OK
    content-type: application/json; charset=UTF-8
    content-length: 513
    
    {
    	"name" : "xxx-1",
    	"cluster_name" : "xxx",
    	"cluster_uuid" : "xxx_uuid",
    	"version" : {
    		"number" : "7.10.2",
    		"build_flavor" : "oss",
    		"build_type" : "tar",
    		"build_hash" : "unknown",
    		"build_date" : "unknown",
    		"build_snapshot" : true,
    		"lucene_version" : "8.7.0",
    		"minimum_wire_compatibility_version" : "6.7.0",
    		"minimum_index_compatibility_version" : "6.0.0-beta1"
    	},
    	"tagline" : "You Know, for Search"
    }
    NOTE:

    For more commands, see the Elasticsearch documentation.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback