Exporting and importing Hive metadata in the Metastore cluster
Getting started
-
Create a service account named
my-account
with thestorage.uploader
role. -
Create a static access key for the
my-account
service account. Save the ID and secret key: you will need them for work with Yandex Object Storage. -
Configure the network and create a Metastore cluster. When creating, specify the static access key parameters.
Warning
Data export and import are only available in Metastore clusters with a static access key.
-
Create a bucket named
my-bucket
in Object Storage. It will store the metadata file for import and export. -
Grant a
READ and WRITE
permission to themy-account
service account for the bucket namedmy-bucket
.
Warning
Do not assign a bucket policy for the bucket; otherwise, the Metastore cluster will not be able to write any data to the bucket.
Export data
-
Go to the folder page
and select Yandex MetaData Hub. -
In the left-hand panel, select the
Metastore page. -
Click
for the cluster you need and select Export. -
In the window that opens, specify:
- The bucket named
my-bucket
the cluster data will be exported to. - The
.sql
file the cluster data will be written to. If a file with that name already exists, it will be overwritten.
- The bucket named
-
Click Export.
Import data
Before importing, upload the .sql
file with metadata into my-bucket
. For information on how to prepare a file and how the import process works, see Transferring data between Yandex Data Processing clusters using Metastore.
To import data to a cluster:
- Go to the folder page
and select Yandex MetaData Hub. - In the left-hand panel, select the
Metastore. - Click
for the cluster you need and select Import. - In the window that opens, select the bucket named
my-bucket
and the file the cluster data will be imported from. - Click Import.