当前位置:网站首页>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
边栏推荐
猜你喜欢

如何實現十億級離線 CSV 導入 Nebula Graph

《大学“电路分析基础”课程实验合集.实验四》丨线性电路特性的研究

二叉树前,中,后序遍历

Thoroughly understand browser strong cache and negotiation cache

Comparison between rstan Bayesian regression model and standard linear regression model of R language MCMC

Comment réaliser un graphique Nebula d'importation CSV hors ligne de niveau milliard
![[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

win10系统升级一段时间后,内存占用过高

Review materials for the special topic of analog electronics with all essence: basic amplification circuit knowledge points

XPT2046 四线电阻式触摸屏
随机推荐
2278. Percentage of letters in string
Strings and arrays
Solve the problem of base64encoder error
Astra: could not open "2bc5/ [email protected] /6“: Failed to set USB interface
/bin/ld: 找不到 -lxslt
Pyinstaller's method of packaging pictures attached to exe
Some problems about pytorch extension
/Bin/ld: cannot find -lcrypto
What are the necessary functions of short video app development?
Invalid bound statement (not found)解决方法总结
6096. Success logarithm of spells and potions
纪念成为首个 DAYU200 三方 demo 贡献者
/bin/ld: 找不到 -lxml2
6090. Minimax games
仙人掌之歌——投石问路(3)
Golang MD5 encryption and MD5 salt value encryption
将点云坐标转换成世界坐标的demo
Ant group's large-scale map computing system tugraph passed the national evaluation
idea 公共方法抽取快捷键
Introduction to dynamic planning I, BFS of queue (70.121.279.200)