Tkhemali Connector 1.X installation

NOTE
  • Starting with ADB 6.24.3.47 it is recommended to use the new two-way ADB ClickHouse Connector. Tkhemali Connector 1.X will continue to be supported in ADB 6, but the new functionality will not be added to it. Starting with ADB 7 only ADB ClickHouse Connector will remain.

  • The maximum supported version of ClickHouse/ADQM to work with Tkhemali Connector is 22.8.12.45. If you need to connect to later versions of ClickHouse/ADQM, use ADB ClickHouse Connector.

To install Tkhemali Connector 1.X, follow the steps:

  1. Make sure that PXF and Tkhemali services are installed. For information on how to add services to ADB clusters, see Add services.

  2. Add the new custom profile TKH to the PXF configuration file /var/lib/pxf/conf/pxf-profiles.xml on Master. To edit the file, you can use the vi or vim command:

    $ sudo vi /var/lib/pxf/conf/pxf-profiles.xml

    The content of the changed file can look as follows. In our case, the file does not contain other profiles:

    <profiles>
        <profile>
            <name>TKH</name>
            <description>Clickhouse</description>
            <plugins>
                <accessor>io.arenadata.tkh.pxf.TkhAccessor</accessor>
                <resolver>io.arenadata.tkh.pxf.TkhResolver</resolver>
            </plugins>
            <optionMappings>
                <!-- distribution parameters -->
                <mapping option="distribution" property="clickhouse.distribution"/>
                <mapping option="url" property="clickhouse.dist.simple.url"/>
                <mapping option="gp_url" property="clickhouse.dist.gp.url"/>
                <mapping option="gp_user" property="clickhouse.dist.gp.user"/>
                <mapping option="gp_password" property="clickhouse.dist.gp.password"/>
                <mapping option="gp_request" property="clickhouse.dist.gp.request"/>
                <!-- common parameters -->
                <mapping option="send_delay" property="clickhouse.send.delay"/>
                <mapping option="lines_batch_size" property="clickhouse.lines.batch.size"/>
                <mapping option="bytes_batch_size_mb" property="clickhouse.bytes.batch.size.mb"/>
                <!-- connection and query parameters -->
                <mapping option="send_compressed" property="clickhouse.connection.decompress"/>
                <mapping option="insert_distributed_sync" property="clickhouse.connection.insert_distributed_sync"/>
            </optionMappings>
        </profile>
    </profiles>
    NOTE

    The directory, where PXF configuration files are located, is defined by the $PXF_BASE environment variable. The default value is /var/lib/pxf. The path may differ in your environment.

  3. Login under the default user name gpadmin. All the commands listed in the subsequent steps should be performed on Master:

    $ sudo su - gpadmin
  4. Synchronize the PXF configuration on all hosts in the ADB cluster:

    $ pxf cluster sync

    The result:

    Syncing PXF configuration files from master host to standby master host and 2 segment hosts...
    PXF configs synced successfully on 3 out of 3 hosts
  5. Restart PXF:

    $ pxf cluster restart

    The result:

    Restarting PXF on master host, standby master host, and 2 segment hosts...
    PXF restarted successfully on 4 out of 4 hosts
  6. Connect to the database via psql (or any other client program):

    $ psql adb
  7. To check that the new extension gptkh is available, use the psql meta-command \dx:

    \dx

    The output contains the gptkh extension:

                                          List of installed extensions
       Name    | Version |   Schema   |                             Description
    -----------+---------+------------+---------------------------------------------------------------------
     dblink    | 1.1     | public     | connect to other PostgreSQL databases from within a database
     diskquota | 2.2     | public     | Disk Quota Main Program
     gptkh     | 0.14    | public     | gptkh
     kadb_fdw  | 0.16    | kadb       | Kafka-ADB foreign data wrapper
     plpgsql   | 1.0     | pg_catalog | PL/pgSQL procedural language
     postgis   | 2.5.4   | public     | PostGIS geometry, geography, and raster spatial types and functions
     pxf       | 2.0     | public     | Extension which allows to access unmanaged data
    (7 rows)
Found a mistake? Seleсt text and press Ctrl+Enter to report it