Example: Using Loader to Import Data from OBS to HDFS
Scenario
If you need to import a large volume of data from the external cluster to the internal cluster, import it from OBS to HDFS.
Prerequisites
- You have prepared service data.
- You have created an analysis cluster.
Procedure
- Upload service data to your OBS file system.
- Obtain the AK/SK information and create an OBS and HDFS link.
For details, see Loader Link Configuration.
- Access the Loader page.
If Kerberos authentication is enabled in the analysis cluster, refer to instructions in Accessing the Hue Web UI.
- Click New Job.
- In Information, set parameters.
- In Name, enter a job name. For example, obs2hdfs.
- In From link, select the OBS link you create.
- In To link, select the HDFS link you create.
- In From, set source link parameters.
- In Bucket Name, enter a name of the OBS file system.
- In Input directory or file, enter a detailed location of service data in the file system.
If it is a single file, enter a complete path containing the file name. If it is a directory, enter the complete path of the directory.
- In File format, enter the type of the service data file.
For details, see obs-connector.
- In To, set destination link parameters.
- In Output directory, enter the directory for storing service data in HDFS.
If Kerberos authentication is enabled in the cluster, the current user accessing Loader needs to have the permission to write data to the directory.
- In File format, enter the type of the service data file.
The type must correspond to the type in 6.c.
- In Compression codec, enter a compression algorithm. For example, if you do not compress data, select NONE.
- In Overwrite, select True.
- Click Show Senior Parameter and set Line Separator.
- Set Field Separator.
For details, see hdfs-connector.
- In Output directory, enter the directory for storing service data in HDFS.
- In Task Config, set job running parameters.
- In Extractors, enter the number of Map tasks.
- In Loaders, enter the number of Reduce tasks.
If the destination link is an HDFS link, Loaders is hidden.
- In Max error records in single split, enter an error record threshold.
- In Dirty data directory, enter a directory for saving dirty data, for example, /user/sqoop/obs2hdfs-dd.
- Click Save and execute.
On the Manage jobs page, view the job running result. You can click Refresh to obtain the latest job status.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot