Synchronizing Data From EnOS Hive to the Target Database¶
You can synchronize the data in EnOS Hive to the target database for data analysis.
EnOS enables the synchronization of data in EnOS Hive to the following databases.
External MySQL database
External PostgreSQL database
Note
As the Data Report service has been deprecated, the Data Synchronization service no longer supports integrating data from EnOS Hive to the ReportDB.
Before You Start¶
Ensure that you have created the target table before synchronizing.
If you are synchronizing data to an external MySQL database, you must establish and verify the connection in Data Source Registration and create a target table. For more information, see Registering a MySQL or SQL Server Data Source
If you are synchronizing data to an external PostgreSQL database, you must establish and verify the connection in Data Source Registration and create a target table. For more information, see Registering a PostgreSQL Data Source
Step 1: Create a Data Synchronization Task¶
In the EnOS Management Console, click Data Synchronization from the left navigation menu and click + to create a data synchronization task.
In the New Data Synchronization Task window, complete the basic settings for the task.
Mode: Select Create to create a task from scratch. If you wish to Import task config, go to Creating a Task by Importing an Existing Configuration.
Name: Enter the name of the data synchronization task.
Sync Type: Select Structured data.
Scheduling Type: Select Manual scheduling.
Description: Provide a description for the data synchronization task.
Select Dir: Select the directory to save the task.
Click OK to create the data synchronization task.
Step 2: Select the Hive Data Source¶
To select and synchronize data to external MySQL database or PostgreSQL database, follow the steps below.
Data Source Type: Select HIVE(EnOS).
Source Table: Select the data table to be synchronized.
(Optional) Specify the Partition to be synchronized through the following methods. If not specified, all data is synchronized to the target data table.
Fixed value: If 20180101 is entered, for example, the data will be automatically synchronized to the
20180101
partition of the target table.Placeholder: You can use system reserved or custom parameters such as the system variable
${cal_dt}
. For more information about the usage of system variables, see Supported System Variables.
(Optional) Click Data Preview. The system will display 5 random data entries by default.
Click Next to select the target table.
Step 3: Select the Target Table¶
You can synchronize the Hive data either to an external MySQL database or PostgreSQL database.
To synchronize the data to an external MySQL database, follow the steps below.
Data Source Type: Select MYSQL.
Data Sources: Select the target database that the data is synchronized to.
Table Name: Select the target table that the data is synchronized to.
Data Writing Rule: Select Overwrite existing data or Do not overwrite existing data according to your requirements.
Click Next.
To synchronize data to an external PostgreSQL database, follow the steps below.
Data Source Type: Select POSTGRESQL.
Data Sources: Select the target database that the data is synchronized to.
Schema: Select the schema of the target database.
Table Name: Select the target table that the data is synchronized to.
Data Writing Rule: Select Overwrite existing data or Do not overwrite existing data according to your requirements.
Click Next.
Next Step¶
You can continue to configure the task scheduling settings, parameter settings, field mapping configuration, and channel control. For more information, see the following.
Periodic scheduling: See Synchronizing Data from External Data Source to Hive (Periodic Scheduling).
Manual scheduling: See Synchronizing Data from External Data Source to Hive (Manual Scheduling).