Reference:
http://hegdesai.blogspot.com/2013/10/registering-db2-driver-with-jboss-711.html
For DB2: the command via cli is:
./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
/subsystem=datasources/jdbc-driver=db2:add(driver-name=db2,driver-module-name=com.ibm.db2,driver-xa-datasource-class-name=com.ibm.db2.jcc.DB2XADataSource, driver-class-name=com.ibm.db2.jcc.DB2Driver)
{"outcome" => "success"}
[standalone@localhost:9990 /]
to remove:
module remove --name=com.ibm.db2
For mariadb:
Setup DB Driver
./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] module add --name=org.mariadb --resources=/apps/installers/mariadb-java-client-2.5.3.jar --dependencies=javax.api,javax.transaction.api
[disconnected /] connect
[standalone@localhost:9990 /] /subsystem=datasources/jdbc-driver=mariadb:add(driver-name=mariadb,driver-module-name=org.mariadb,driver-xa-datasource-class-name=org.mariadb.jdbc.MySQLDataSource, driver-class-name=org.mariadb.jdbc.Driver)
{"outcome" => "success"}
[standalone@localhost:9990 /]
To setup multiple instance, I will copy the whole standalone folder and modify the .xml and .conf files inside
Directory:
standalone_UMP
standalone_UC
Add Datasource in Standalone.xml
(Difference between original and new copy)
165a166,180
> <datasource jta="true" jndi-name="java:/CampaignPartition1DS" pool-name="CampaignPartition1DS" enabled="true" use-ccm="false">
> <connection-url>jdbc:mariadb://rhel73.localdomain.com:3306/UCDB</connection-url>
> <driver-class>org.mariadb.jdbc.Driver</driver-class>
> <driver>mariadb</driver>
> <security>
> <user-name>UC</user-name>
> <password>P@ssw0rd</password>
> </security>
> <validation>
> <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
> <validate-on-match>true</validate-on-match>
> <background-validation>false</background-validation>
> <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
> </validation>
> </datasource>
522,528c537,543
< <socket-binding name="management-http" interface="any" port="${jboss.management.http.port:9990}"/>
< <socket-binding name="management-https" interface="any" port="${jboss.management.https.port:9993}"/>
< <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
< <socket-binding name="http" port="${jboss.http.port:8080}"/>
< <socket-binding name="https" port="${jboss.https.port:8443}"/>
< <socket-binding name="txn-recovery-environment" port="4712"/>
< <socket-binding name="txn-status-manager" port="4713"/>
---
> <socket-binding name="management-http" interface="any" port="${jboss.management.http.port:29990}"/>
> <socket-binding name="management-https" interface="any" port="${jboss.management.https.port:29993}"/>
> <socket-binding name="ajp" port="${jboss.ajp.port:28009}"/>
> <socket-binding name="http" port="${jboss.http.port:28080}"/>
> <socket-binding name="https" port="${jboss.https.port:28443}"/>
> <socket-binding name="txn-recovery-environment" port="24712"/>
> <socket-binding name="txn-status-manager" port="24713"/>
530c545
< <remote-destination host="localhost" port="25"/>
---
> <remote-destination host="localhost" port="26"/>
Adding JVM parameters in standalone.conf file
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Dclient.encoding.override=UTF-8"
War file to deployed via UI
Startup command:
standalone.sh -Djboss.server.base.dir=/apps/EAP-7.1.0/standalone_UMP
standalone.sh -Djboss.server.base.dir=/apps/EAP-7.1.0/standalone_UC
No comments:
Post a Comment