Thursday, 13 April 2017


Connect DRILL from JBOSS


AIM:  

Integrate DRILL and JBOSS.

STEPS:

1. Download JBOSS from http://jbossas.jboss.org/downloads (I used the following) 
http://download.jboss.org/jbossas/7.0/jboss-as-7.0.1.Final/jboss-as-web-7.0.1.Final.zip


2. Extract the zip file (Installed in my local windows machine)
Goto <JBOSS_HOME>\bin and run standalone.bat

3. Open the JBOSS administartor console in Web Browser
http://localhost:9990/console/App.html#server/datasources





4. Our DRILL is up and running in following node
http://<drillbit-node>:8047/
DRILL Server Version - 1.9r1 (MapR)
Make sure that we are using DRILL Server version which is newer or equal to following: (Earlier packages has a bug which will throw a 'NullPointerException' on DrillConnectionImpl.isReadOnly().



5. Add drill jdbc driver to this folder: $JBOSS_HOME/modules/org/apache/drill/main/
(Create folder 'org/apache/drill/main/' if it does not exist)
Added the following jar to specified location: drill-jdbc-all-1.9.0.jar
(The jar is available with DRILL installation under - '/opt/mapr/drill/drill-1.9.0/jars/jdbc-driver'  for MapR installtion for DRILL Server 1.9)

6. Add module.xml file to '$JBOSS_HOME/modules/org/apache/drill/main/' folder with the following content:

<module xmlns="urn:jboss:module:1.0" name="org.apache.drill">
    <resources>
         <resource-root path="drill-jdbc-all-1.9.0.jar"/> 
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="sun.jdk"/>
    </dependencies>
</module>

7. Change datasources part in the $JBOSS_HOME/standalone/configuration/standalone.xml file:
                
<datasource jta="true" jndi-name="java:jboss/datasources/DRILL-DS1" pool-name="DRILL-DS1" enabled="true" use-java-context="true" use-ccm="true">
                    <connection-url>jdbc:drill:drillbit=<drillbit-node>:31010</connection-url>
                    <driver>drill</driver>
                    <security>
                        <user-name><username></user-name>
                        <password><Password></password>
                    </security>
                    <validation>
                        <check-valid-connection-sql>select * from sys.version</check-valid-connection-sql>
                        <validate-on-match>false</validate-on-match>
                        <background-validation>false</background-validation>
                        <use-fast-fail>false</use-fast-fail>
                    </validation>
                </datasource>

8. Add the following in 'drivers' section inside standalone.xml
        <drivers>
          <driver name="drill" module="org.apache.drill" />
        </drivers>


9. Restart the JBOSS server. Once you restart, you will see DRILL-DS1 under 'Registered Datasources'




10. If you are using RED HAT' JBOSS' ENTERPROSE APPLICATION PLATFORM, then you should see something like below:


11. You can test the connection by clicking on the particular datasource (DRILL-DS1) and then on 'Test Connection'. 




12. If the connection is successful, then we will see following screen:






No comments:

Post a Comment