cxzl25 commented on a change in pull request #1175:
URL: https://github.com/apache/incubator-kyuubi/pull/1175#discussion_r724685750
##########
File path:
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala
##########
@@ -256,6 +261,28 @@ object ServiceDiscovery extends Logging {
}
serviceNode
}
+
+ private def addConfsToPublish(conf: KyuubiConf, instance: String): String = {
+ if (!instance.contains(":")) {
+ return instance
+ }
+ val hostPort = instance.split(":", 2)
+ val confsToPublish = collection.mutable.Map[String, String]()
+
+ // Hostname
+ confsToPublish += ("hive.server2.thrift.bind.host" -> hostPort(0))
+ // Transport mode
+ confsToPublish += ("hive.server2.transport.mode" -> "binary")
+ // Transport specific confs
+ confsToPublish += ("hive.server2.thrift.port" -> hostPort(1))
+ confsToPublish += ("hive.server2.thrift.sasl.qop" -> "auth")
+ // Auth specific confs
+ confsToPublish += ("hive.server2.authentication" -> "KERBEROS")
+ confsToPublish += ("hive.server2.authentication.kerberos.principal" ->
+
conf.get(KyuubiConf.SERVER_PRINCIPAL).map(KyuubiHadoopUtils.getServerPrincipal).getOrElse(""))
Review comment:
Kyuubi use configuration (`kyuubi.kinit.principal abc/[email protected]`)
The data published by service1 to znode is `abc/[email protected]`
The data published by service2 to znode is `abc/[email protected]`
The client connects to different nodes and uses different principals as
parameters.
org.apache.hive.jdbc.ZooKeeperHiveClientHelper
```java
if
(matcher.group(1).equalsIgnoreCase("hive.server2.authentication.kerberos.principal")
&& ... ){
connParams.getSessionVars().put(JdbcConnectionParams.AUTH_PRINCIPAL,
matcher.group(2));
}
```
org.apache.hive.jdbc.HiveConnection
```java
if (sessConfMap.containsKey(JdbcConnectionParams.AUTH_PRINCIPAL)) {
transport = KerberosSaslHelper.getKerberosTransport(
sessConfMap.get(JdbcConnectionParams.AUTH_PRINCIPAL), host,
socketTransport, saslProps, assumeSubject);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]