Help Center> Cloud Search Service> Getting Started> Getting Started with Common Practices
Updated on 2023-07-14 GMT+08:00

Getting Started with Common Practices

CSS provides you with best practices in different service scenarios and solution architectures, helping you select a proper practice solution based on your service scenario.

Table 1 Common practices

Scenario

Description

Migrating data

Migrating data from Elasticsearch

Migrating the Entire Elasticsearch Database to CSS

Huawei Cloud CDM is used to migrate clusters between different cloud services. This practice describes how to use CDM to migrate the entire local Elasticsearch database to CSS.

Migrating Cluster Data Using Logstash

Logstash: an official data cleaning tool provided by Elasticsearch. It is a part of the Elk ecosystem and provides powerful functions. It can migrate data between different data sources and Elasticsearch, and clean and process data.

Migration from Kafka/MQ

In industries dealing with a large amount of data, such as IoT, news, public opinion analysis, and social networking, message middleware such as Kafka and MQ is used to balance traffic in peak and off-peak hours. The tools such as Flink and Logstash are then used to consume data, preprocess data, and import data to the search engine. This practice describes how to migrate clusters from Kafka/MQ.

Migration from a Database

Elasticsearch supports full-text search and ad hoc queries. It is often used as a supplement to relational databases, such as MySQL and GaussDB(for MySQL), to improve the full-text search and high-concurrency ad hoc query capabilities of databases.

Accessing a cluster

Accessing an Elasticsearch Cluster

CSS clusters have built-in Kibana and Cerebro components. You can quickly access an Elasticsearch cluster through Kibana and Cerebro.

Accessing a Cluster Using cURL Commands

If the CSS cluster and ECS are in the same VPC, you can run cURL commands on the ECS to directly access the Elasticsearch cluster. This method is mainly used to check whether the client that accesses the cluster can be connected to Elasticserach nodes.

Accessing a cluster using Java

Accessing a Cluster Through the Rest High Level Client

Elasticsearch provides SDK (Rest High Level Client) for connecting to a cluster. This client encapsulates Elasticsearch APIs. You only need to construct required structures to access the Elasticsearch cluster.

Accessing a Cluster Through the Rest Low Level Client

The high-level client is encapsulated based on the low-level client. If the method calls (such as .search and .bulk) in the high-level client cannot meet the requirements or has compatibility issues, you can use the low-level client. You can even use HighLevelClient.getLowLevelClient() to directly obtain a low-level client.

Accessing the Cluster Through the Transport Client

This practice describes how to use the native Transport Client of Elasticsearch to access to a cluster in non-security mode.

Using Spring Boot to Access a Cluster

This practice describes how to use Spring Boot to access a cluster.

Accessing a Cluster Using Python

This practice describes how to access a CSS cluster using Python.

Using ES-Hadoop to Read and Write Data in Elasticsearch Through Hive

This practice uses the ES-Hadoop of MRS as an example to describe how to connect to a CSS cluster. You can configure any other applications that need to use the Elasticsearch cluster. Ensure the network connection between the client and the Elasticsearch cluster is normal.

Optimizing cluster performance

Optimizing Write Performance

Before using a CSS cluster, you are advised to optimize the write performance of the cluster to improve efficiency.

Optimizing Query Performance

Before using a CSS cluster, you are advised to optimize the query performance of the cluster to improve efficiency.

Managing the index lifecycle

Configuring the Lifecycle to Automate Index Rollover

Time series data is continuously written and increases index size. You can configure the lifecycle to periodically roll over to new indexes and delete old indexes.

Automatic Storage and Compute Separation Using Lifecycles

CSS supports decoupled storage and compute. That is, indexes can be frozen in OBS to reduce the storage cost of cold data. This document describes how to use index lifecycle management to automatically freeze indexes at a specific time to decouple storage and compute.

Accelerated data query and analysis

Using CSS to Accelerate Database Query and Analysis

Elasticsearch is used as a supplement to relational databases, such as MySQL and GaussDB(for MySQL), to improve the full-text search and high-concurrency ad hoc query capabilities of the databases.

Unified log management platform

Using CSS to Build a Unified Log Management Platform

A unified log management platform built using CSS can manage logs in real time in a unified and convenient manner, enabling log-driven O&M and improving service management efficiency.

Querying customized scores

Configuring Query Scoring in an Elasticsearch Cluster

This practice describes how to customize scores for documents that match the search criteria.