Skip to content

Commit 97d512b

Browse files
authored
HBASE-28063 Document how to configure TLS settings to ZooKeeper client (#5383)
Signed-off-by: [email protected]
1 parent 33e7e53 commit 97d512b

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

src/main/asciidoc/_chapters/zookeeper.adoc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,74 @@ This would avoid the need for a separate Hadoop jar that fixes link:https://issu
441441
442442
==== Elimination of `kerberos.removeHostFromPrincipal` and`kerberos.removeRealmFromPrincipal`
443443
444+
== TLS connection to ZooKeeper
444445
446+
Apache ZooKeeper also supports SSL/TLS client connections to encrypt the data in transmission. This is particularly
447+
useful when the ZooKeeper ensemble is running on a host different from HBase and data has to be sent
448+
over the wire.
449+
450+
=== Java system properties
451+
452+
The ZooKeeper client supports the following Java system properties to set up TLS connection:
453+
454+
[source,bourne]
455+
----
456+
zookeeper.client.secure=true
457+
zookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty
458+
zookeeper.ssl.keyStore.location="/path/to/your/keystore"
459+
zookeeper.ssl.keyStore.password="keystore_password"
460+
zookeeper.ssl.trustStore.location="/path/to/your/truststore"
461+
zookeeper.ssl.trustStore.password="truststore_password"
462+
----
463+
464+
Setting up KeyStore is optional and only required if ZooKeeper server requests for client certificate.
465+
466+
Find more detailed information in the link:https://cwiki.apache.org/confluence/display/ZOOKEEPER/ZooKeeper+SSL+User+Guide[ZooKeeper SSL User Guide].
467+
468+
[WARNING]
469+
These're standard Java properties which should be set in the HBase command line and are effective in
470+
the entire Java process. All ZooKeeper clients running in the same process will pick them up including
471+
co-processors.
472+
473+
[NOTE]
474+
Since ZooKeeper version 3.8 the following two properties are useful to store the
475+
keystore and truststore passwords in protected text files rather than exposing them in the command line.
476+
477+
[source,bourne]
478+
----
479+
zookeeper.ssl.keyStore.passwordPath=/path/to/secure/file
480+
zookeeper.ssl.trustStore.passwordPath=/path/to/secure/file
481+
----
482+
483+
=== HBase configuration
484+
485+
By adding link:https://issues.apache.org/jira/browse/HBASE-28038[HBASE-28038], ZooKeeper client TLS
486+
settings are also available in _hbase-site.xml_ via `hbase.zookeeper.property` prefix. In contrast
487+
to Java system properties this could be more convenient under some circumstances.
488+
489+
[source,xml]
490+
----
491+
492+
<configuration>
493+
<property>
494+
<name>hbase.zookeeper.property.client.secure</name>
495+
<value>true</value>
496+
</property>
497+
<property>
498+
<name>hbase.zookeeper.property.clientCnxnSocket</name>
499+
<value>org.apache.zookeeper.ClientCnxnSocketNetty</value>
500+
</property>
501+
<property>
502+
<name>hbase.zookeeper.property.ssl.trustStore.location</name>
503+
<value>/path/to/your/truststore</value>
504+
</property>
505+
...
506+
</configuration>
507+
----
508+
509+
[NOTE]
510+
These settings are eventually transformed into Java system properties, it's just a convenience feature.
511+
So, the same rules that mentioned in the previous point, applies to them as well.
445512
446513
ifdef::backend-docbook[]
447514
[index]

0 commit comments

Comments
 (0)