[KYUUBI #4763] [DOCS] Fix the Kyuubi JDBC kerberos parameters

### _Why are the changes needed?_

The Kerberos-related parameters in Kyuubi JDBC driver are

- `kyuubiClientPrincipal`
- `kyuubiClientKeytab`
- `principal`. Since 1.7.0, `kyuubiServerPrincipal` is added as an alias

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4763 from pan3793/kerberos-doc.

Closes #4763

7400e3a08 [Cheng Pan] nit
021c73174 [Cheng Pan] nit
337fb1229 [Cheng Pan] fix
4c4907bc8 [Cheng Pan] fix
d2478eeb7 [Cheng Pan] nit
3b0899d3e [Cheng Pan] nit
8dfdb6bde [Cheng Pan] [DOCS] Fix the Kyuubi JDBC kerberos parameters

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
Cheng Pan 2023-04-25 02:16:28 +08:00
parent efe81ac0b1
commit e1e57e5233
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D
3 changed files with 10 additions and 10 deletions

View File

@ -242,5 +242,5 @@ jdbc:hive2://<kyuubi_server_address>:<kyuubi_server_port>/<db>;kyuubiServerPrinc
- `principal` is inherited from Hive JDBC Driver and is a little ambiguous, and we could use `kyuubiServerPrincipal` as its alias.
- `kyuubi_server_principal` is the value of `kyuubi.kinit.principal` set in `kyuubi-defaults.conf`.
- As a command line argument, JDBC URL should be quoted to avoid being split into 2 commands by ";".
- As to DBeaver, `<db>;principal=<kyuubi_server_principal>` should be set as the `Database/Schema` argument.
- As to DBeaver, `<db>;principal=<kyuubi_server_principal>` or `<db>;kyuubiServerPrincipal=<kyuubi_server_principal>` should be set as the `Database/Schema` argument.

View File

@ -168,12 +168,12 @@ It's straightforward to use principal and keytab for Kerberos authentication, ju
.. code-block::
jdbc:kyuubi://host:port/schema;clientKeytab=<clientKeytab>;clientPrincipal=<clientPrincipal>;serverPrincipal=<serverPrincipal>
jdbc:kyuubi://host:port/schema;kyuubiClientPrincipal=<clientPrincipal>;kyuubiClientKeytab=<clientKeytab>;kyuubiServerPrincipal=<serverPrincipal>
- clientKeytab: path of Kerberos ``keytab`` file for client authentication
- clientPrincipal: Kerberos ``principal`` for client authentication
- serverPrincipal: Kerberos ``principal`` configured by `kyuubi.kinit.principal` at the server side. ``serverPrincipal`` is available
since 1.7.0, for previous versions, use ``principal`` instead.
- kyuubiClientPrincipal: Kerberos ``principal`` for client authentication
- kyuubiClientKeytab: path of Kerberos ``keytab`` file for client authentication
- kyuubiServerPrincipal: Kerberos ``principal`` configured by `kyuubi.kinit.principal` at the server side. ``kyuubiServerPrincipal`` is available
as an alias of ``principal`` since 1.7.0, use ``principal`` for previous versions.
Authentication by Principal and TGT Cache
*****************************************
@ -183,7 +183,7 @@ does Kerberos authentication through the TGT cache.
.. code-block::
jdbc:kyuubi://host:port/schema;serverPrincipal=<serverPrincipal>
jdbc:kyuubi://host:port/schema;kyuubiServerPrincipal=<serverPrincipal>
Authentication by `Hadoop UserGroupInformation`_ ``doAs`` (programing only)
***************************************************************************
@ -195,7 +195,7 @@ Authentication by `Hadoop UserGroupInformation`_ ``doAs`` (programing only)
.. code-block::
String jdbcUrl = "jdbc:kyuubi://host:port/schema;serverPrincipal=<serverPrincipal>"
String jdbcUrl = "jdbc:kyuubi://host:port/schema;kyuubiServerPrincipal=<serverPrincipal>"
UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytab(clientPrincipal, clientKeytab);
ugi.doAs((PrivilegedExceptionAction<String>) () -> {
Connection conn = DriverManager.getConnection(jdbcUrl);
@ -207,7 +207,7 @@ Authentication by Subject (programing only)
.. code-block:: java
String jdbcUrl = "jdbc:kyuubi://host:port/schema;serverPrincipal=<serverPrincipal>;kerberosAuthType=fromSubject"
String jdbcUrl = "jdbc:kyuubi://host:port/schema;kyuubiServerPrincipal=<serverPrincipal>;kerberosAuthType=fromSubject"
Subject kerberizedSubject = ...;
Subject.doAs(kerberizedSubject, (PrivilegedExceptionAction<String>) () -> {
Connection conn = DriverManager.getConnection(jdbcUrl);

View File

@ -74,7 +74,7 @@ public class KyuubiJDBCDemo {
private static String driverName = "org.apache.kyuubi.jdbc.KyuubiHiveDriver";
private static String kyuubiJdbcUrlTemplate = "jdbc:kyuubi://localhost:10009/default;" +
"clientPrincipal=%s;clientKeytab=%s;serverPrincipal=%s";
"kyuubiClientPrincipal=%s;kyuubiClientKeytab=%s;kyuubiServerPrincipal=%s";
public static void main(String[] args) throws SQLException {
String clientPrincipal = args[0]; // Kerberos principal