<html>
<head>
<base href="https://docs.jboss.org/author">
<link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://docs.jboss.org/author/display/TEIID/Phoenix+Data+Sources">Phoenix Data Sources</a></h2>
<h4>Page <b>edited</b> by <a href="https://docs.jboss.org/author/display/~kylin">Kylin Soong</a>
</h4>
<br/>
<h4>Changes (2)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-added-lines" style="background-color: #dfd;">h1. Phoenix Data Sources <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">Primary purpose of this article including: <br>* Configuring a Phoenix data source in JBoss/WildFly Container(later than JBoss AS 7) <br> <br>* Mapping Phoenix table to an existing HBase table <br> <br>* Creaing Phoenix table for creating a new HBase table <br> <br>h1. Configuring a Phoenix data source in JBoss/WildFly Container(later than JBoss AS 7) <br> <br>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 <br> <br>deploy /path/to/phoenix-\[version\]-client.jar <br> <br>The Driver jar can be download from [phoenix document.|http://phoenix.apache.org/] <br> <br>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: <br> <br>/subsystem=datasources/data-source=phoenixDS:add(jndi-name=java:/phoenixDS,&nbsp; 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}) <br> <br>Please make sure the URL, Driver are configured correctly: <br> <br>* jndi-name - The JNDI name need to match the JNDI name you used in VDB <br> <br>* driver-name - The Driver name need to match the driver you deployed in above steps <br> <br>* driver-class - The Driver Class, the value should be org.apache.phoenix.jdbc.PhoenixDriver <br> <br>* 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 <br> <br>* user-name/password - The user credentials for Phoenix Connection <br> <br>h1. Mapping Phoenix table to an existing HBase table <br> <br>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]. <br> <br>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. <br> <br>The Following is a example for mapping an existing HBase table <br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<h1><a name="PhoenixDataSources-PhoenixDataSources"></a>Phoenix Data Sources</h1>
<p>Primary purpose of this article including:</p>
<ul>
        <li>Configuring a Phoenix data source in JBoss/WildFly Container(later than JBoss AS 7)</li>
</ul>
<ul>
        <li>Mapping Phoenix table to an existing HBase table</li>
</ul>
<ul>
        <li>Creaing Phoenix table for creating a new HBase table</li>
</ul>
<h1><a name="PhoenixDataSources-ConfiguringaPhoenixdatasourceinJBoss%2FWildFlyContainer%28laterthanJBossAS7%29"></a>Configuring a Phoenix data source in JBoss/WildFly Container(later than JBoss AS 7)</h1>
<p>Configuring a Phoenix data source is nearly identical configuring a <a href="/author/display/TEIID/JDBC+Data+Sources" title="JDBC Data Sources">JDBC Data Sources</a>, first step is deploying the Phoenix driver jar, the following command using the CLI to deploy Phoenix driver</p>
<p>deploy /path/to/phoenix-[version]-client.jar</p>
<p>The Driver jar can be download from <a href="http://phoenix.apache.org/" class="external-link" rel="nofollow">phoenix document.</a></p>
<p>The second steps is creating the Data Source base on above deployed driver, also like creating <a href="/author/display/TEIID/JDBC+Data+Sources" title="JDBC Data Sources">JDBC Data Source</a>, execute the following CLI command:</p>
<p>/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:</p>
<div class="error"><span class="error">Unknown macro: {zookeeper quorum server}</span> </div>
<p>,user-name=</p>
<div class="error"><span class="error">Unknown macro: {user}</span> </div>
<p>, password=</p>
<div class="error"><span class="error">Unknown macro: {password}</span> </div>
<p>)</p>
<p>Please make sure the URL, Driver are configured correctly:</p>
<ul>
        <li>jndi-name - The JNDI name need to match the JNDI name you used in VDB</li>
</ul>
<ul>
        <li>driver-name - The Driver name need to match the driver you deployed in above steps</li>
</ul>
<ul>
        <li>driver-class - The Driver Class, the value should be org.apache.phoenix.jdbc.PhoenixDriver</li>
</ul>
<ul>
        <li>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</li>
</ul>
<ul>
        <li>user-name/password - The user credentials for Phoenix Connection</li>
</ul>
<h1><a name="PhoenixDataSources-MappingPhoenixtabletoanexistingHBasetable"></a>Mapping Phoenix table to an existing HBase table</h1>
<p>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 <a href="http://phoenix.apache.org/download.html" class="external-link" rel="nofollow">phoenix document</a>.</p>
<p>The second step is executing the DDL to map Phoenix table to an existing HBase table, the DDL can either be executed via <a href="http://phoenix.apache.org/download.html" class="external-link" rel="nofollow">Phoenix Command Line</a>, or executed by JDBC.</p>
<p>The Following is a example for mapping an existing HBase table</p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;" class="grey">
<a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
<span style="padding: 0px 5px;">|</span>
<a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
<a href="https://docs.jboss.org/author/display/TEIID/Phoenix+Data+Sources">View Online</a>
|
<a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=88866974&revisedVersion=2&originalVersion=1">View Changes</a>
|
<a href="https://docs.jboss.org/author/display/TEIID/Phoenix+Data+Sources?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>