Skip to content

Commit

Permalink
TEIID-2816 adding phoenix example
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Jan 15, 2015
1 parent 2c012df commit 6943bda
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/kits/jboss-as7/docs/teiid/datasources/derby/readme.txt
Expand Up @@ -12,12 +12,12 @@ Step 1: Deploying the JDBC Driver
2) Overlay the "modules" directory on the "<jboss-as>/modules" directory

3) Then copy the derby database JDBC driver jar file "derbyclient.jar" into
"<jboss-as>/modules/com/apache/derby/main" directory.
"<jboss-as>/modules/org/apache/derby/main" directory.
4) start server

Step 2: Creating the datasource

Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "derby.xml"
Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "derby-ds.xml"
or "derby-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
to where your derby server is located and credentials you need to use to access it.

Expand Down
@@ -0,0 +1,4 @@
# note that driver-name could be driver's module name if you went module approach.
/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})

## If you are working in a clustered environment, prepend "/profile=ha" to all the above commands that start with "/subsystem=.."
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.apache.derby">
<resources>
<resource-root path="phoenix-[version].jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
19 changes: 19 additions & 0 deletions build/kits/jboss-as7/docs/teiid/datasources/phoenix/phoenix-ds.xml
@@ -0,0 +1,19 @@
<!-- Add the below contents under "datasources" subsystem in the standalone-teiid.xml or deploy as -ds.xml file -->
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:/derbyDS" pool-name="derbyDS">
<driver-class>org.apache.phoenix.jdbc.PhoenixDriver</driver-class>
<connection-url>jdbc:phoenix:{zookeeper quorum server}</connection-url>
<driver>phoenix-[version].jar</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>{user}</user-name>
<password>{password}</password>
</security>
</datasource>
</datasources>
</subsystem>
29 changes: 29 additions & 0 deletions build/kits/jboss-as7/docs/teiid/datasources/phoenix/readme.txt
@@ -0,0 +1,29 @@
There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
you can skip the deploying JDBC driver for the database, if you have previously already done this.

Note that all instances of [version] should be replaced by the appropriate phoenix version.

Step 1: Deploying the JDBC Driver

Option 1: use the JBoss CLI tool, and deploy the phoenix client jar by issuing the command
deploy phoenix-[version].jar

Option 2: (recommended)
1) Stop the server if it is running.

2) Overlay the "modules" directory on the "<jboss-as>/modules" directory

3) Then copy the phoenix database JDBC driver jar file into the
"<jboss-as>/modules/org/apache/phoenix/main" directory.
4) start server

Step 2: Creating the datasource

Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "phoenix-ds.xml"
file under the "datasources" subsystem. You may have to edit contents according to where your Hbase server
is located and credentials you need to use to access it.

Option 2: Take a look at create-phoenix-ds.cli script, and modify and execute using JBoss CLI tool as below

./Jboss-admin.sh --file create-phoenix-ds.cli

0 comments on commit 6943bda

Please sign in to comment.