... |
The second step is executing the DDL to map Phoenix table to an existing HBase table, the DDL can either be executed via [Phoenix Command Line|http://phoenix.apache.org/download.html], or executed by JDBC. |
The Following is a example for mapping an existing HBase table, assume the Customer table is existing in HBase, it looks as below figure |
Test |
Primary purpose of this article including:
Configuring a Phoenix data source is nearly identical configuring a JDBC Data Sources, first step is deploying the Phoenix driver jar, the following command using the CLI to deploy Phoenix driver
deploy /path/to/phoenix-[version]-client.jar
The Driver jar can be download from phoenix document.
The second steps is creating the Data Source base on above deployed driver, also like creating JDBC Data Source, execute the following CLI command:
/subsystem=datasources/data-source=phoenixDS:add(jndi-name=java:/phoenixDS, driver-name=phoenix-[version].jar, driver-class=org.apache.phoenix.jdbc.PhoenixDriver, connection-url=jdbc:phoenix:{zookeeper quorum server},user-name={user}, password={password})
Please make sure the URL, Driver are configured correctly:
Mapping Phoenix table to an existing HBase table has 2 steps, the first step is installing phoenix-[version]-server.jar to the classpath of every HBase region server,an easy way to do this is to copy it into the HBase lib, more details please refer to phoenix document.
The second step is executing the DDL to map Phoenix table to an existing HBase table, the DDL can either be executed via Phoenix Command Line, or executed by JDBC.
The Following is a example for mapping an existing HBase table, assume the Customer table is existing in HBase, it looks as below figure
Test