h1. Phoenix Data Sources |
|
Primary purpose of this article including: * Configuring a Phoenix data source in JBoss/WildFly Container(later than JBoss AS 7) * Mapping Phoenix table to an existing HBase table * Creaing Phoenix table for creating a new HBase table h1. Configuring a Phoenix data source in JBoss/WildFly Container(later than JBoss AS 7) Configuring a Phoenix data source is nearly identical configuring a [TEIID: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.|http://phoenix.apache.org/] The second steps is creating the Data Source base on above deployed driver, also like creating [JDBC Data Source|TEIID:JDBC Data Sources], execute the following CLI command: /subsystem=datasources/data-source=phoenixDS:add(jndi-name=java:/phoenixDS, driver-name=phoenix-\[version\]-client.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: * jndi-name - The JNDI name need to match the JNDI name you used in VDB * driver-name - The Driver name need to match the driver you deployed in above steps * driver-class - The Driver Class, the value should be org.apache.phoenix.jdbc.PhoenixDriver * connection-url - The URL need to match the HBase zookeeper quorum server, the format like jdbc:phoenix \[ :<zookeeper quorum> \[ :<port number> \] \[ :<root node> \] \], 'jdbc:phoenix:127.0.0.1:2181' is a example * user-name/password - The user credentials for Phoenix Connection h1. Mapping Phoenix table to an existing HBase table 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|http://phoenix.apache.org/download.html]. 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 |
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]-client.jar, driver-class=org.apache.phoenix.jdbc.PhoenixDriver, connection-url=jdbc:phoenix:
,user-name=
, 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