Reference Guide
...
SQL Proxy
Dynamic Data Masking

Hive - Zookeeper Configuration

In addition to the databases previously mentioned, Kron PAM SQL Proxy can be configured to work with Zookeeper databases. This section outlines the steps required to integrate Zookeeper databases into Kron PAM, including specific property configurations and host file modifications.

Modifying the /etc/hosts File for Zookeeper Nodes

To ensure that Kron PAM can resolve the hostnames of the Zookeeper nodes, you need to update the /etc/hosts file on the Kron PAM machine:

  1. Access the Kron PAM server via SSH.
  2. Open the /etc/hosts file with a text editor (e.g., vi /etc/hosts).
  3. Add the following entries to map the Zookeeper node IP addresses to their hostnames:
    • 172.191.43.234 hive-masternode-01
    • 172.173.226.15 hive-datanode-02
    • 52.170.134.60 hive-datanode-03
    • 40.114.55.184 hive-metanode-04
Document image


To connect Hive nodes user needs to upload the Hive jdbc files into pam/gui/lib in your PAM machine.



Adding Zookeeper as a Device

Firstly, add the Zookeeper database to Kron PAM as a device:

  1. Navigate to Devices > Inventory.
  2. Click the Add.
  3. Select Add Device.
  4. In the Information section, enter all the information below. Then enter the SQL Proxy Bind Port (last section in ‘add device’)
    • IP Address: It is the equivalent name of the IP address in the etc/hosts file.
    • Device Name: A unique name for the Hive node. It is not required
    • Port: The port number used by Hive (if not specified, the default port is used).
    • Access Protocol: Choose Hive.
    • Element Type: Choose Hive.
    • Enter SQL Proxy Bind Port (in this case 1019)
    • Save.
Document image


In the Information section, enter the required details:

  • IP Address: The IP address of the Zookeeper database.
  • Device Name: A unique name for the Zookeeper device.
  • Port: The port number used by Zookeeper
  • Access Protocol: Select the protocol appropriate for the Zookeeper.
  • Element Type: Choose Database.
  • Enter SQL Proxy Bind Port (in this case 1022)
  • Save.
Document image


Then return to the Hive node that you need to connect; (in this case, this will be our first defined Hive db named Hive datanode 3). Zookeeper requires specific properties to be set in Kron PAM to enable proper communication and metadata management:

  1. Click the Edit device then click the Edit Database button.
  2. Enter your Information on this screen.
Document image


In the device's Properties section, add the following parameters (the properties that were not written with bold are examples):

  • external.metastore.vendor mysql
  • external.metastore.host 40.114.55.184
  • external.metastore.port 3306
  • external.metastore.username hiveusr
  • external.metastore.name metastore_db
  • external.metastore.password.enc hivepassword
    • (Ensure the password is encrypted)
  • metadata.type EXTERNAL
Document image


After these configurations user should be defined as user groups, device groups, and policy groups like any other SQL Proxy. In this case, this document assumes you have knowledge. If not, You can check out SQL Proxy reminder knowledge.

Connecting to Zookeeper via Kron PAM SQL Proxy

Users can connect to the Zookeeper database through the Kron PAM SQL Proxy using an SQL client:

  1. Open an SQL client (e.g., DBeaver, DataGrip).
  2. Create a new connection and select the appropriate database type.
  3. Enter the following connection details:
    • Host: The IP address of the Kron PAM server. Please look at below example of the URL below that contains the host port and any etc.)
      • jdbc:hive2://10.20.42.159:1022/newdb;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;
    • Port: The SQL proxy port assigned to the Zookeeper device in Kron PAM.
    • Username: The username configured in Kron PAM (must match the database username).
    • Password: The corresponding password.
    • Database/Service Name: The name of the Zookeeper database as defined in Kron PAM.
Document image

  • Test the connection to ensure that it is successful.

It is recommended to use the Hive Zookeeper connection with version 23.1.2 of DBeaver.