当前位置:网站首页>Boot connection to impala database
Boot connection to impala database
2022-07-02 15:54:00 【lvhui321】
1. stay pom Integration drive dependency in file
<dependency>
<groupId>com.cloudera.impala.jdbc</groupId>
<artifactId>ImpalaJDBC41</artifactId>
<version>2.5.41</version>
</dependency>2. Configure data sources , Driver name ,jdbc Connect url
@Configuration
public class ImpalaSourceConfig {
@Value("${impala.driver_class_name}")
private String driverClassName;
@Value("${impala.jdbc_url}")
private String jdbcUrl;
@Bean(name = "impalaSource")
@Qualifier(value = "impalaSource")
public DataSource primaryDataSource() {
HikariConfig config = new HikariConfig();
config.setDriverClassName(driverClassName);
config.setJdbcUrl(jdbcUrl);
HikariDataSource dataSource = new HikariDataSource(config);
return dataSource;
}
@Bean(name = "jdbcTemplateImpala")
public JdbcTemplate jdbcTemplateImpala(@Qualifier("impalaSource") DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
}1)impala.driver_class_name=com.cloudera.impala.jdbc41.Driver
2)impala.jdbc_url=jdbc:impala://192.168.0.1:21050/impala_temp;UseSasl=0;AuthMech=3;UID=impala;PWD=
Explanation of connection parameters :
UseSasl by 0 Don't use SASL authentication . User credentials will still be passed to the server for Sentry Etc
UseSasl by 1 Use SASL Authentication
This attribute refers to whether SASL With user name and password authentication mechanism (AuthMech=3) Use a combination of .
AuthMech by 3 User name and password
AuthMech by 0 Authentication is not performed ( Default )
AuthMech by 1 be used for Kerberos
AuthMech by 2 user name
This attribute refers to the authentication mechanism used , Set the attribute to one of the above values .
UID Property to the appropriate user name , To visit Impala The server .
PWD Property to the password corresponding to the user name you provided .
3) Pay attention to case sensitivity in connection configuration , Not in URL Duplicate configuration properties
4) Configure authentication method
(1) There is no need to verify AuthMech Property is set to 0, Examples of connections jdbc:impala://192.168.0.1:21050/impala_temp;AuthMech=0
(2) Use Kerberos To verify , hold AuthMech Property is set to 1
(3) Use user name and password for authentication , hold AuthMech Property is set to 3, Examples of connections jdbc:impala://192.168.0.1:21050/impala_temp;AuthMech=2;UID=impala;PWD=123
(4) Use user name authentication , hold AuthMech Property is set to 2, Examples of connections jdbc:impala://192.168.0.1:21050/impala_temp;AuthMech=2;UID=impala
3. You can use mybatis do sql Operation
边栏推荐
- 动态规划入门二(5.647.62)
- Deux séquences ergodiques connues pour construire des arbres binaires
- 仙人掌之歌——投石问路(2)
- How to import a billion level offline CSV into Nepal graph
- 《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
- (万字精华知识总结)Shell脚本编程基础知识
- XPT2046 四线电阻式触摸屏
- 数字藏品系统开发(程序开发)丨数字藏品3D建模经济模式系统开发源码
- Use ffmpeg command line to push UDP and RTP streams (H264 and TS), and ffplay receives
- PTA ladder game exercise set l2-001 inter city emergency rescue
猜你喜欢

Tree binary search tree

PostgresSQL 流复制 主备切换 主库无读写宕机场景

XPT2046 四线电阻式触摸屏

Comment réaliser un graphique Nebula d'importation CSV hors ligne de niveau milliard

Aike AI frontier promotion (7.2)

Teach you how to build virtual machines locally and deploy microservices

可视化技术在 Nebula Graph 中的应用

idea jar包冲突排查

Why does the system convert the temp environment variable to a short file name?

全是精华的模电专题复习资料:基本放大电路知识点
随机推荐
Cultural scores of summer college entrance examination
How to import a billion level offline CSV into Nepal graph
Locate: cannot execute stat() `/var/lib/mlocate/mlocate Db ': there is no such file or directory
中科大脑知识图谱平台建设及业务实践
纪念成为首个 DAYU200 三方 demo 贡献者
【Experience Cloud】如何在VsCode中取得Experience Cloud的MetaData
Demo of converting point cloud coordinates to world coordinates
Group by的用法
全方位解读服务网格(Service Mesh)的背景和概念
lseek 出错
Review materials for the special topic of analog electronics with all essence: basic amplification circuit knowledge points
智联招聘的基于 Nebula Graph 的推荐实践分享
Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals
Ssh/scp does not prompt all activities are monitored and reported
ssh/scp 使不提示 All activities are monitored and reported.
2278. 字母在字符串中的百分比
(Wanzi essence knowledge summary) basic knowledge of shell script programming
Folium, diagnosis and close contact trajectory above
将点云坐标转换成世界坐标的demo
动态规划入门一,队列的bfs(70.121.279.200)