Commit b7523386 authored by 徐顺's avatar 徐顺

Initial commit

parents
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/../../../../:\Code\hive_export\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="hive_export" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
k java:S117#"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ðãÒ¿øÿÿÿÿ
Y
java:S1858*"C"substring" returns a string, there's no need to call "toString()".(˜Á¢
h
java:S3776"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(Á¯¦þ
N java:S106K"9Replace this use of System.out or System.err by a logger.(áÆŒ»
b
java:S2095"GUse try-with-resources or close this "Statement" in a "finally" clause.(ý¡ªüÿÿÿÿ
]
java:S2095D"GUse try-with-resources or close this "Statement" in a "finally" clause.(ö“åê
S java:S106?"9Replace this use of System.out or System.err by a logger.(ýùôÓþÿÿÿÿ
M java:S106H"9Replace this use of System.out or System.err by a logger.(¼Âã-
T
java:S1155@">Use isEmpty() to check whether the collection is empty or not.(¬²å«
f java:S117*"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˜Á¢
7
java:S16434"Use a StringBuilder instead.( ¨Ëûÿÿÿÿ
] java:S125"<This block of commented-out lines of code should be removed.(Áá’ùÿÿÿÿ8ÿòÅ—/
\ No newline at end of file
x
java:S1488 "bImmediately return this expression instead of assigning it to the temporary variable "connection".(ò’Õþ
\ No newline at end of file
] java:S125/"<This block of commented-out lines of code should be removed.(ÒÑŸÁûÿÿÿÿ8Ä°Ëüø.
] java:S125&"<This block of commented-out lines of code should be removed.(Ժɛþÿÿÿÿ8Ä°Ëüø.
K
java:S2115")Add password protection to this database.(õöÿÿÿÿÿ8…ÆÅüø.
„
java:S1488"bImmediately return this expression instead of assigning it to the temporary variable "connection".(õöÿÿÿÿÿ8…ÆÅüø.
\ No newline at end of file
G
java:S1128"1Remove this unused import 'java.util.Properties'.(
J
java:S1128"/Remove this unused import 'java.io.FileReader'.(¡
D
java:S1128")Remove this unused import 'java.net.URL'.(
K
java:S1128"0Remove this unused import 'java.io.IOException'.(
\ No newline at end of file
` java:S112*"FDefine and throw a dedicated exception instead of using a generic one.(žÚ¹Äùÿÿÿÿ
X
java:S1163"=Refactor this code to not throw exceptions in finally blocks.(Ò‚Òéüÿÿÿÿ
O
java:S1143"4Remove this throw statement from this finally block.(Ò‚Òéüÿÿÿÿ
[ java:S112"FDefine and throw a dedicated exception instead of using a generic one.(øžò
` java:S112"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
U
java:S1118":Add a private constructor to hide the implicit public one.(ˆáì¦ùÿÿÿÿ
\ No newline at end of file
_
/src/main/java/com/qm/utils/PropertiesUtils.java,d\e\dea952f32dd98529217e1c24dc0664c9af34c803
7
pom.xml,4\4\442292b8a7efeabbe4cc176709b833b1792140ec
^
.src/main/java/com/qm/utils/HiveJdbcSource.java,b\0\b090e8f0a9271927d0b5dd1db592c16ca3c023f1
Z
*src/main/java/com/qm/utils/JDBCSource.java,b\3\b331bde9eb2c9e0e032e6aab53ac54d18897aade
_
/src/main/java/com/qm/utils/MysqlJdbcSource.java,a\b\abfbb7250459ff1661341ee227b582bdccbedf74
\
,src/main/java/com/qm/export/HiveToMysql.java,0\7\0795242e2a1e415a68d198af325c20d1c70d8b62
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.qiaomeng</groupId>
<artifactId>hive_export</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.8</jdk.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
</dependency>
</dependencies>
<!--<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.qm.export.HiveToMysql</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>-->
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<!--这里要替换成jar包main方法所在类 -->
<mainClass>com.qm.export.HiveToMysql</mainClass>
</manifest>
<manifestEntries>
<Class-Path>.</Class-Path>
</manifestEntries>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- 指定在打包节点执行jar包合并操作 -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.qm.export;
import com.qm.utils.HiveJdbcSource;
import com.qm.utils.MysqlJdbcSource;
import org.apache.commons.lang3.StringUtils;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
/**
* 将hive表的数据写入到MySQL中
*
*/
public class HiveToMysql {
public static void main(String[] args) throws SQLException {
//System.out.println("开始读取hive中"+args[0]+"表的数据。。。。。。");
//读取hive表的结构
HiveJdbcSource hiveJdbcSource = new HiveJdbcSource();
Connection hiveconn = hiveJdbcSource.getConn();
Statement hiveStatement = hiveconn.createStatement();
//读取hive表字段信息
List<String> allColumns = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
ResultSet hiveColResutSet = hiveStatement.executeQuery("describe " + args[0]);
if (hiveColResutSet != null) {
while (hiveColResutSet.next()) {
String col_name = hiveColResutSet.getString("col_name");
if(!StringUtils.isBlank(col_name)){
sb.append(col_name+",");
allColumns.add(col_name);
}else break;
}
}
String col_sql = sb.substring(0,sb.length() - 1).toString();
//释放资源
hiveJdbcSource.closeResultSet(hiveColResutSet);
ResultSet hiveSet = hiveStatement.executeQuery("select "+col_sql+" from "+args[0]+" where date_time >= '"+args[1]+"' ");
List<String> inserList = new ArrayList<String>();
if (hiveSet!=null){
while (hiveSet.next()){
String insertSql = "insert into "+args[0]+" values(";
for (String column : allColumns) {
insertSql += "'"+hiveSet.getObject(column).toString()+"'"+",";
}
insertSql = insertSql.substring(0, insertSql.length() - 1) +")";
inserList.add(insertSql);
}
}
//释放hive资源
hiveJdbcSource.close(hiveSet,hiveStatement,hiveconn);
System.out.println("写入数据到MySQL的"+args[0]+"表中");
if(inserList.size() != 0){
//将hive的数据批量写入到MySQL中
MysqlJdbcSource mysqlJdbcSource = new MysqlJdbcSource();
Connection mysqlConn = mysqlJdbcSource.getConn();
Statement mysqlStat = mysqlConn.createStatement();
for (String sql : inserList) {
mysqlStat.executeUpdate(sql);
}
System.out.println(args[0]+"表中的数据写入成功,共写入"+inserList.size()+"条数据");
mysqlJdbcSource.close(null,mysqlStat,mysqlConn);
}
System.out.println("数据导入成功。。。。");
}
}
package com.qm.utils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.security.UserGroupInformation;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class HiveJdbcSource extends JDBCSource {
@Override
public Connection getConn() {
try {
authKrb5();
Class.forName(PropertiesUtils.getValue("hive.driver"));
Connection connection = DriverManager.getConnection(PropertiesUtils.getValue("hive.url"),"","");
return connection;
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return null;
}
public static void authKrb5() {
// 设置jvm启动时krb5的读取路径参数
System.setProperty("java.security.krb5.conf","/etc/krb5.conf");
// 配置kerberos认证
Configuration conf = new Configuration();
conf.setBoolean("hadoop.security.authorization", true);
conf.set("hadoop.security.authentication", "kerberos");
// System.out.println(System.getProperty("java.security.krb5.conf"));
UserGroupInformation.setConfiguration(conf);
try {
UserGroupInformation.loginUserFromKeytab(
"hive@QIAOMENG.COM",
"/opt/software/kerberos/hive.keytab");
} catch (IOException e) {
e.printStackTrace();
}
// System.out.println("Succeeded in authenticating through Kerberos!");
}
}
package com.qm.utils;
import java.io.FileReader;
import java.io.IOException;
import java.net.URL;
import java.sql.*;
import java.util.Properties;
/**
* jdbc连接工具类
*/
public abstract class JDBCSource {
/**
* 获取jdbc连接
* @return
* @throws SQLException
*/
public abstract Connection getConn() throws ClassNotFoundException;
/**
* @Author 徐顺
* @Description 释放资源Pro版
* @Param [rs 结果集对象, stmt 执行sql的对象, conn 数据库连接对象]
* @return void
**/
public void close(ResultSet rs, Statement stmt, Connection conn){
if(rs != null){
try {
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if(stmt != null){
try {
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if(conn != null){
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
/**
* @Author 徐顺
* @Description 释放资源Pro版
* @Param [rs 结果集对象]
* @return void
**/
public void closeResultSet(ResultSet rs){
if(rs != null){
try {
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
package com.qm.utils;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class MysqlJdbcSource extends JDBCSource {
@Override
public Connection getConn() {
try {
Class.forName(PropertiesUtils.getValue("mysql.driver"));
Connection connection = DriverManager.getConnection(PropertiesUtils.getValue("mysql.url"),PropertiesUtils.getValue("mysql.user"),PropertiesUtils.getValue("mysql.password"));
return connection;
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return null;
}
}
package com.qm.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class PropertiesUtils {
private static Properties props = new Properties();
/* 在类初始化的时候加载配置文件 */
static {
// 1.读取配置文件
InputStream ins = PropertiesUtils.class.getClassLoader().getResourceAsStream("config.properties");
try {
// 2.加载配置文件
props.load(ins);
} catch (Exception e) {
throw new RuntimeException(e + "【加载配置文件失败】");
} finally {
if (ins != null) {
try {
ins.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}
/**
* 根据给定的key键,读取器对应的值value
*
* @param key
* @return value
*/
public static String getValue(String key) {
try {
return props.getProperty(key) != null ? props.getProperty(key) : "";
} catch (Exception e) {
throw new RuntimeException(e + "读取属性【" + key + "】失败");
}
}
}
#hive
hive.driver=org.apache.hive.jdbc.HiveDriver
hive.url=jdbc:hive2://qmbigdata01:10000/qm_app;principal=hive/qmbigdata01@QIAOMENG.COM
hive.user=
hive.password=
java.security.krb5.conf=/etc/krb5.conf
hadoop.security.authorization=true
hadoop.security.authentication=kerberos
#mysql
mysql.driver=com.mysql.jdbc.Driver
mysql.url=jdbc:mysql://8.135.22.177:3306/qm_app?useUnicode=true&characterEncoding=utf-8
mysql.user=root
mysql.password=v0qMRg+ZIkRfRqyJdL6rk8kKF0A=
# Configuration snippets may be placed in this directory as well
includedir /etc/krb5.conf.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
dns_lookup_realm = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
pkinit_anchors = FILE:/etc/pki/tls/certs/ca-bundle.crt
default_realm = QIAOMENG.COM
# default_ccache_name = KEYRING:persistent:%{uid}
udp_preference_limit = 1
[realms]
QIAOMENG.COM = {
kdc = qmbigdata02
admin_server = qmbigdata02
}
[domain_realm]
.QIAOMENG.COM = QIAOMENG.COM
QIAOMENG.COM = QIAOMENG.COM
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="error">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
#hive
hive.driver=org.apache.hive.jdbc.HiveDriver
hive.url=jdbc:hive2://qmbigdata01:10000/qm_app;principal=hive/qmbigdata01@QIAOMENG.COM
hive.user=
hive.password=
java.security.krb5.conf=/etc/krb5.conf
hadoop.security.authorization=true
hadoop.security.authentication=kerberos
#mysql
mysql.driver=com.mysql.jdbc.Driver
mysql.url=jdbc:mysql://8.135.22.177:3306/qm_app?useUnicode=true&characterEncoding=utf-8
mysql.user=root
mysql.password=v0qMRg+ZIkRfRqyJdL6rk8kKF0A=
# Configuration snippets may be placed in this directory as well
includedir /etc/krb5.conf.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
dns_lookup_realm = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
pkinit_anchors = FILE:/etc/pki/tls/certs/ca-bundle.crt
default_realm = QIAOMENG.COM
# default_ccache_name = KEYRING:persistent:%{uid}
udp_preference_limit = 1
[realms]
QIAOMENG.COM = {
kdc = qmbigdata02
admin_server = qmbigdata02
}
[domain_realm]
.QIAOMENG.COM = QIAOMENG.COM
QIAOMENG.COM = QIAOMENG.COM
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="error">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
#Generated by Maven
#Mon Mar 15 10:04:28 CST 2021
version=1.0-SNAPSHOT
groupId=org.qiaomeng
artifactId=hive_export
com\qm\utils\HiveJdbcSource.class
com\qm\utils\PropertiesUtils.class
com\qm\utils\MysqlJdbcSource.class
com\qm\export\HiveToMysql.class
com\qm\utils\JDBCSource.class
D:\Code\hive_export\src\main\java\com\qm\utils\PropertiesUtils.java
D:\Code\hive_export\src\main\java\com\qm\export\HiveToMysql.java
D:\Code\hive_export\src\main\java\com\qm\utils\HiveJdbcSource.java
D:\Code\hive_export\src\main\java\com\qm\utils\JDBCSource.java
D:\Code\hive_export\src\main\java\com\qm\utils\MysqlJdbcSource.java
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment