forked from NetEase/hive-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hive-tools.properties
44 lines (41 loc) · 2.54 KB
/
hive-tools.properties
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 第一步:备份所有数据库");
# hadoop519 > cd /home/hadoop/database-auto-backup/");
# hadoop519 > ./autoBackupDB.sh");
# 第二步:清空 hadoop357 上 Mysql 数据库中的 exchange_db");
# hadoop357 > mysql -uroot -proot -Dexchange_db;");
# mysql > use exchange_db;");
# mysql > drop database exchange_db;");
# mysql > create database exchange_db;");
# mysql > exit;");
# 第三步:使用用户提供的元数据 Mysql IP 和用户名密码,将数据库通过 mysqldump 出数据库(申请RDS权限)");
# hadoop357 > mysqldump -hMysqlHostIP -uUserName -pPassword --single-transaction MysqlDatabaseName > MysqlDatabaseName.sql;");
# 第四步:将 用户的 元数据导入 exchange_db");
# hadoop357 > mysql -uroot -proot -Dexchange_db;");
# mysql > use exchange_db;");
# mysql > source ./MysqlDatabaseName.sql");
# 第五步:检查是否存着和 DEST 数据库存着数据库重名,联系业务方将重名的数据库该名");
# :通过用户 Hive 表中的 HDFS 文件所属集群确定需要导入到哪个 hive 集群");
# hadoop357 > cd /home/hadoop/hive-tools/");
# hadoop357 > ./merge2hivecluster[1-5].sh");
# hadoop357 > 如果有数据库重名,会打印出重名到数据库名称");
# 第六步:在 exchange_db 中删除多余的 DB");
# hadoop357 > cd /home/hadoop/hive-tools/");
# hadoop357 > vi delMetaData.sh");
# 修改脚本中的 DEL_DB(多个库之间用逗号分割,default必须删除)参数和 DEL_TBL(为空则删除所有表)");
# hadoop357 > ./delMetaData.sh");
# 第七步:重新执行元数据合并脚本");
# hadoop357 > cd /home/hadoop/hive-tools/");
# hadoop357 > ./merge2hivecluster[1-5].sh");
# 第八步:检查合并日志,通过hive进行测试是否导入成功");
########################################### online hive cluster mysql ################################################################
# online_cluster1
online_cluster1.jdbc.driverClassName=com.mysql.jdbc.Driver
online_cluster1.jdbc.url=jdbc:mysql://10.172.121.126:3306/hivecluster1?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
online_cluster1.jdbc.username=hivecluster1
online_cluster1.jdbc.password=SIpFGv2KgChQ
############################################### Intermediate temporary database ############################################################
# exchange_db
exchange_db.jdbc.driverClassName=com.mysql.jdbc.Driver
exchange_db.jdbc.url=jdbc:mysql://10.120.232.16:3306/exchange_db?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
exchange_db.jdbc.username=exchange_db
exchange_db.jdbc.password=exchange_db