1:为日志查询添加clickhouse数据源

2:为nis.properties中添加 存储分组复用域配置的redisdb属性
This commit is contained in:
RenKaiGe-Office
2018-08-31 15:11:40 +08:00
parent 509cea36d7
commit 35d2f29a65
9 changed files with 138 additions and 72 deletions

View File

@@ -33,8 +33,8 @@ import com.nis.web.service.SpringContextHolder;
* @date 2018年8月20日
*
*/
public class HiveJDBCByDruid {
private final static Logger logger = LoggerFactory.getLogger(HiveJDBCByDruid.class);
public class LogJDBCByDruid {
private final static Logger logger = LoggerFactory.getLogger(LogJDBCByDruid.class);
static DruidDataSource datasource = null;
Connection conn = null;
ResultSet rs = null;
@@ -43,6 +43,7 @@ public class HiveJDBCByDruid {
public static Connection getConnection() throws SQLException {
if (datasource == null) {
datasource = (DruidDataSource) SpringContextHolder.getBean("HiveDataSourceByDruid");
// datasource = (DruidDataSource) SpringContextHolder.getBean("ClickHouseDataSourceByDruid");
}
return datasource.getConnection();
}

View File

@@ -91,6 +91,14 @@ public class PropertyPlaceholderConfigurerCrypt extends PropertyPlaceholderConfi
new String(AESUtil.decrypt(Base64.decodeBase64(clusterPassword), clusterScretKey)));
}
//clickhouse
String clickHousePassword = props.getProperty("jdbc.clickhouse.password");
String clickHouseScretKey = props.getProperty("jdbc.clickhouse.key");
if (null != clickHousePassword) {
props.setProperty("jdbc.clickhouse.password",
new String(AESUtil.decrypt(Base64.decodeBase64(clickHousePassword), clickHouseScretKey)));
}
} catch (Exception e) {
e.printStackTrace();
}