我是靠谱客的博主 聪明鸭子,这篇文章主要介绍Hive跨集群数据迁移,现在分享给大家,希望可以做个参考。

参考链接:

方式一:

拷贝表结构:

#!/bin/bash
rm -f databases
hive -e " show databases; exit ;" > databases
#sleep(2)
rm -rf ./tables/*
mkdir -p ./tables
rm -rf ./desc_table/*
mkdir -p ./desc_table
for database in `cat databases`
do
{
echo "database:${database}"
hive -e " use $database ;
show tables ; exit ;" > ./tables/$database
rm -rf ./desc_table/$database
for table in `cat ./tables/$database`
do
echo "table:${database}.${table}"
hive -e "use $database ; show create table $table ;" >> ./desc_table/$database
echo >> ./desc_table/$database
done
}
done
#wait

数据:http://www.cnblogs.com/airnew/p/9788122.html

方式二:

采用Hive提供的export/import工具实现:https://blog.csdn.net/github_39577257/article/details/82390507

最后

以上就是聪明鸭子最近收集整理的关于Hive跨集群数据迁移的全部内容,更多相关Hive跨集群数据迁移内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(120)

评论列表共有 0 条评论

立即
投稿
返回
顶部