Switching the Log Engine¶
Introduction¶
This document describes how to perform Guance to switch the log engine. It supports 6 different engines: the original open-source Elasticsearch, the original open-source OpenSearch, managed OpenSearch on AWS, managed Elasticsearch on Huawei Cloud, managed Elasticsearch (Log Enhanced Edition) on Alibaba Cloud, and managed Elasticsearch on Alibaba Cloud. This operation is suitable for POC switching to a production log engine.
Prerequisites¶
- Prepare the log engine address, username, and password.
- Confirm that the
analysis-ikplugin has been installed successfully. - Confirm that automatic index creation is disabled.
- Prepare the Guance MySQL address and the
df_coredatabase credentials.
Switching Steps¶
Step 1: Stop the kodo-x Service¶
Step 2: Refresh the Configuration¶
Log in to the df_core database.
- Back up the table:
- Query the information:
Structure:
mysql> select id,host,authorization,configJSON from df_core.main_es_instance;
+----+----------------------------------------+------------------------------------------------------------------------+-------------------------+
| id | host | authorization | configJSON |
+----+----------------------------------------+------------------------------------------------------------------------+-------------------------+
| 1 | http://testing-ft-elastic.cloudcare.cn | {"admin": {"password": "xxxxx", "username": "elastic"}} | {"provider": "elastic"} |
+----+----------------------------------------+------------------------------------------------------------------------+-------------------------+
1 rows in set (0.01 sec)
- Update the configuration:
SQL> update df_core.main_es_instance a set a.authorization='{"admin": {"password": "xxxxx", "username": "elastic"}}',a.configJSON='{"provider": "elastic"}',a.host='http://elasticsearch-client-headless.middleware:9200' where id =1;
Parameter descriptions:
authorizationis the ES username and password.configJSONis the ES provider.
Possible values:elastic(original open-source Elasticsearch)opensearch(original open-source OpenSearch)aws_opensearch(managed OpenSearch on AWS)huawei_opensearch(managed Elasticsearch on Huawei Cloud)aliyun_openstore(managed Elasticsearch Log Enhanced Edition on Alibaba Cloud)aliyun_elasticsearch(managed Elasticsearch on Alibaba Cloud)
hostis the ES address.idis the ES instance ID obtained in Step 2.
Step 3: Restart the Service¶
Step 4: Initialize the ES Template¶
Log in to the forethought-core inner API container and execute the commands:
$ curl 'http://127.0.0.1:5000/api/v1/inner/es/init' -X 'POST' -H 'Content-Type: application/json'
$ curl 'http://127.0.0.1:5000/api/v1/inner/es/init_subsequent' -X 'POST' -H 'Content-Type: application/json'
Step 5: Start kodo-x¶
Step 6: Clear the Redis Cache¶
Log in to the Redis database:
Step 7: Verification¶
Log in to the Guance console and carefully inspect the infrastructure and log features.
FAQ¶
Query Failed on the Page¶
Prerequisites¶
- Obtain the workspace ID of the workspace that reported the error.
- Access to OpenSearch.
Delete the Erroneous Index¶
Do not omit the wildcard *.
