我正在尝试为spring xd自定义创建一个作业,以便可以创建一个hive表。 我试过以下,但它不起作用。有什么帮助吗?
<hdp:configuration>
fs.default.name=hdfs://sandbox:8020
</hdp:configuration>
<hdp:hive-server port="10000" auto-startup="true" properties-location="${xd.config.home}/hive-server.properties" configuration-ref="hadoopConfiguration">
</hdp:hive-server>
<!-- basic Hive driver bean -->
<bean id="hive-driver" class="org.apache.hadoop.hive.jdbc.HiveDriver"/>
<bean id="hive-ds" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"
c:driver-ref="hive-driver" c:url="jdbc:hive://localhost:10000/default"/>
<!-- standard JdbcTemplate declaration -->
<bean id="template" class="org.springframework.jdbc.core.JdbcTemplate" c:data-source-ref="hive-ds"/>
<bean class="org.springframework.batch.core.scope.StepScope">
<property name="proxyTargetClass" value="true" />
</bean>
<hdp:hive-runner id="hiveRunner" hive-client-factory-ref="hiveClientFactory" run-at-startup="true">
<hdp:script>
DROP TABLE IF EXISTS testHiveBatchTable;
CREATE TABLE testHiveBatchTable (key int, value string);
</hdp:script>
</hdp:hive-runner>
<hdp:hive-client-factory host="localhost" port="10000" id="hiveClientFactory">
</hdp:hive-client-factory>
<hdp:hive-template />
<batch:job id="job" restartable="true">
<batch:step id="createhivetable">
<hdp:hive-tasklet id="createhivetable-tasklet" hive-client-factory-ref="hiveClientFactory" >
<hdp:script>
DROP TABLE IF EXISTS testHiveBatchTable;
CREATE TABLE testHiveBatchTable (key int, value string);
</hdp:script>
</hdp:hive-tasklet>
</batch:step>
</batch:job>
答案 0 :(得分:1)
您似乎正在尝试连接配置单元服务器2,如果是这种情况,那么您有2个问题。
jdbc:hive2://localhost:10000/default