当前位置:网站首页>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
边栏推荐
- 死锁的条件及解决方法
- 数组和链表的区别浅析
- 2278. Percentage of letters in string
- Comment réaliser un graphique Nebula d'importation CSV hors ligne de niveau milliard
- 可视化技术在 Nebula Graph 中的应用
- locate: 无法执行 stat () `/var/lib/mlocate/mlocate.db‘: 没有那个文件或目录
- /bin/ld: 找不到 -lpam
- Flink real-time data warehouse (IX): incremental synchronization of data in MySQL
- List of sergeant schools
- 愛可可AI前沿推介(7.2)
猜你喜欢

Aiko ai Frontier promotion (7.2)

Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin

《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量

图数据库|Nebula Graph v3.1.0 性能报告

隐藏在 Nebula Graph 背后的星辰大海

《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究

华为云服务器安装mysqlb for mysqld.service failed because the control process exited with error code.See “sys

【Salesforce】如何确认你的Salesforce版本?

又是一年毕业季
![[experience cloud] how to get the metadata of experience cloud in vscode](/img/45/012c2265402ba1b44f4497f468bc61.png)
[experience cloud] how to get the metadata of experience cloud in vscode
随机推荐
Some problems about pytorch extension
制作p12证书[通俗易懂]
Introduction to dynamic planning I, BFS of queue (70.121.279.200)
Finally, I understand the event loop, synchronous / asynchronous, micro task / macro task, and operation mechanism in JS (with test questions attached)
Application of visualization technology in Nebula graph
使用 percona 工具给 MySQL 表加字段中断后该如何操作
/bin/ld: 找不到 -lcrypto
Deux séquences ergodiques connues pour construire des arbres binaires
fastjson List转JSONArray以及JSONArray转List「建议收藏」
idea jar包冲突排查
The outline dimension function application of small motherboard
/Bin/ld: cannot find -lpam
纪念成为首个 DAYU200 三方 demo 贡献者
Aike AI frontier promotion (7.2)
6095. Strong password checker II
动态规划入门一,队列的bfs(70.121.279.200)
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
Pyinstaller打包exe附带图片的方法
[2. Basics of Delphi grammar] 3 Object Pascal constants and variables
Experiment collection of University "Fundamentals of circuit analysis". Experiment 4 - Research on linear circuit characteristics