Flink sql 集成hive metastore对接s3存储

櫰木2年前技术文章1493

1、hive metastore使用s3如何适配

1、在flink conf目录中添加core-site.xml和hive-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>fs.s3a.connection.ssl.enabled</name>
        <value>true</value>
    </property>
    <property>
        <name>fs.defaultFS</name>
        <value>s3a://spark1125</value>
    </property>
    <property>
        <name>fs.s3a.path.style.access</name>
        <value>true</value>
    </property>
    <property>
        <name>fs.s3a.access.key</name>
        <value>admin</value>
    </property>
    <property>
        <name>fs.s3a.secret.key</name>
        <value>Admin@123</value>
    </property>
    <property>
        <name>fs.s3a.impl</name>
        <value>org.apache.hadoop.fs.s3a.S3AFileSystem</value>
    </property>
    <property>
        <name>fs.s3a.endpoint</name>
        <value>http://172.16.104.165:30153</value>
    </property>
    <property>
        <name>fs.s3a.fast.upload</name>
        <value>true</value>
    </property>
    <property>
        <name>fs.s3a.multipart.threshold</name>
        <value>512M</value>
    </property>
    <property>
        <name>fs.s3a.socket.recv.buffer</name>
        <value>65536</value>
    </property>
    <property>
        <name>fs.s3a.socket.send.buffer</name>
        <value>65536</value>
    </property>
    <property>
        <name>fs.s3a.fast.upload.active.blocks</name>
        <value>2048</value>
    </property>
    <property>
        <name>fs.s3a.fast.upload.buffer</name>
        <value>disk</value>
    </property>
    <property>
        <name>fs.s3a.max.total.tasks</name>
        <value>2048</value>
    </property>
    <property>
        <name>fs.s3a.threads.max</name>
        <value>2048</value>
    </property>
    <property>
        <name>fs.s3a.committer.staging.conflict-mode</name>
        <value>append</value>
    </property>
    <property>
        <name>fs.s3a.connection.establish.timeout</name>
        <value>5000</value>
    </property>
    <property>
        <name>fs.s3a.multipart.size</name>
        <value>512M</value>
    </property>
    <property>
        <name>fs.s3a.committer.magic.enabled</name>
        <value>true</value>
    </property>
    <property>
        <name>fs.s3a.committer.abort.pending.uploads</name>
        <value>true</value>
    </property>
    <property>
        <name>fs.s3a.committer.threads</name>
        <value>8</value>
    </property>
    <property>
        <name>fs.s3a.committer.generate.uuid</name>
        <value>false</value>
    </property>
    <property>
        <name>fs.s3a.committer.require.uuid</name>
        <value>false</value>
    </property>
    <property>
        <name>fs.s3a.committer.name</name>
        <value>magic</value>
    </property>
</configuration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>hive.metastore.event.db.notification.api.auth</name>
        <value>false</value>
    </property>
    <property>
        <name>hive.metastore.uris</name>
        <value>thrift://172.16.104.165:31228</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:mysql://172.16.104.165:30066/spark1125?useSSL=false</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>com.mysql.cj.jdbc.Driver</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionUserName</name>
        <value>root</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>123456</value>
    </property>
    <property>
        <name>hive.metastore.warehouse.dir</name>
        <value>s3a://spark1125/hive/warehouse</value>
    </property>
</configuration>


相关文章

MySQL运维实战(4.6) SQL_MODE之NO_BACKSLASH_ESCAPES

设置NO_BACKSLASH_ESCAPES后,反斜杠(\)不作为转义符。不设置NO_BACKSLASH_ESCAPES时,反斜杠(\)用来转义后一个字符mysql> create&n...

Linux进程的几种状态之R、S、D、T、Z

Linux是一个多用户,多任务的系统,可以同时运行多个用户的多个程序,就必然会产生很多的进程,而每个进程会有不同的状态。1.R(TASK_RUNNING),可执行状态&运行状态(在run_qu...

MySQL 组复制一致性保证

MySQL 组复制一致性保证

说明本篇文章介绍,MySQL 组复制作为一个分布式系统,如何保证事务一致性?1. 一致性级别MySQL 8.0.14 版本开始,提供组复制变量:group_replication_consistenc...

CDP实操--Ranger Tag-based策略验证(四)

CDP实操--Ranger Tag-based策略验证(四)

1.1Ranger Tag-based策略验证在Ranger webui里给allan_admin和sam_sec用户赋权,给予添加classification的权限使用allan_admin或者sa...

Hadoop3.2.4纠删码实操(三)

Hadoop3.2.4纠删码实操(三)

1、纠删码实操1.在HDFS中建立以下三个目录,并都设置为XOR-2-1-1024k策略。[root@hd2 hadoop]# hadoop fs -mkdir /ec_xor_s SLF4J: C...

Hue简介

Hue简介

1.    Hue介绍1.1.  Hue是什么l   HUE = Hadoop User Experiencel   A...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。