Open gehongfei opened 2 years ago
如果直接用transportclient,设置用户名和密码,可否访问?
看一下下面连接的内容呢,是否可以适配RestHighLevelClient 高级API https://blog.csdn.net/wuxiaolongah/article/details/119850609
------------------ 原始邮件 ------------------ 发件人: "NLPchina/elasticsearch-sql" @.>; 发送时间: 2021年12月13日(星期一) 晚上6:59 @.>; @.**@.>; 主题: Re: [NLPchina/elasticsearch-sql] es版本是7.1.1,jdbc连接用户认证依然有问题 None of the configured nodes are available: [{#transport#-1}{vVQlytIeTKeJ4c4kD5RsHg}{x.x.x.x}{x.x.x.x:9300}]] (Issue #1154)
如果直接用transportclient,设置用户名和密码,可否访问?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
8之后不支持transportclient,后期可能会考虑支持RestHighLevelClient
public DataSourceDialect factory(DBConfig config) throws Exception { Properties properties = new Properties(); properties.setProperty(DruidDataSourceFactory.PROP_URL, config.getUrl()); properties.put(DruidDataSourceFactory.PROP_CONNECTIONPROPERTIES, "client.transport.ignore_cluster_name=true;xpack.security.user=elastic:123456"); //properties.setProperty("username", config.getUser()); //properties.setProperty("password", config.getPassword()); return new ElasticsearchDataSource((DruidDataSource) ElasticSearchDruidDataSourceFactory.createDataSource(properties)); }