richardantal commented on code in PR #2467:
URL: https://github.com/apache/phoenix/pull/2467#discussion_r3225567218
##########
bin/phoenix_utils.py:
##########
@@ -126,6 +127,21 @@ def setPath():
# Try to provide something valid
hbase_conf_dir = '.'
+ global zk_tls_args
+ root = ET.parse(os.path.join(hbase_conf_dir, "hbase-site.xml")).getroot()
+ zk_hbase_prefix = "hbase.zookeeper.property."
+ zkcfg = {
+ prop.find("name").text[len(zk_hbase_prefix):]: prop.find("value").text
+ for prop in root.findall("property")
+ if prop.find("name").text.startswith(zk_hbase_prefix)
+ }
+ if zkcfg.get('client.secure').lower() == 'true':
+ zk_tls_args = '-Dzookeeper.client.secure=true ' + \
+ '-Dzookeeper.clientCnxnSocket=' + zkcfg['clientCnxnSocket'] + ' '
+ \
+ '-Dzookeeper.ssl.trustStore.location=' +
zkcfg['ssl.trustStore.location'] + ' ' + \
+ '-Dzookeeper.ssl.trustStore.type=' + zkcfg['ssl.trustStore.type']
+ ' ' + \
+ '-Dzookeeper.ssl.trustStore.password=' +
zkcfg['ssl.trustStore.password'] + ' '
+
Review Comment:
Can you please add Exception handling to this?
We want to continue if there is some problem with parsing the zookeeper
parameters.
Please add a default "" value to zk_tls_args in case we don't have
hbase.zookeeper.property.client.secure property.
##########
bin/sqlline.py:
##########
@@ -94,6 +94,7 @@ def kill_child():
java_cmd = phoenix_utils.java + ' ' + phoenix_utils.jvm_module_flags + \
' ' + opts + \
+ ' ' + getattr(phoenix_utils, "zk_tls_args", "") + \
Review Comment:
If we make sure zk_tls_args has some value, we could have
`phoenix_utils.zk_tls_args` here
--
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]