Ubuntu under JBoss Install and configure MySQL distributed data source for it

Source: Internet
Author: User
Tags jboss wildfly

Note: JBoss is renamed Wildfly after version 8.0, with JBoss named version up to 7.1.1.Final, but Jboss7.1.1.final does not support jdk1.8 or above, and if Jboss7.1.1.final is installed in jdk1.8, it will cause service to stay In the starting state
Taking Wildfly-8.2.1.final as an example
1.WildFly dependent JDK environment, installation of JDK environment self-check data
2.wildfly8.2.1.final:http://download.jboss.org/wildfly/8.2.1.final/wildfly-8.2.1.final.tar.gz
3. Personal habits to install the software in the/usr/local directory, so according to the following command to extract the downloaded wildfly to the/usr/local directory
Tar zxvf wildfly-8.2.1.final.tar.gz-c/usr/local
4. Configure the Jboss_home environment variable and add the following command to the/etc/profile
Export Jboss_home=/usr/local/wildfly-8.2.1.final
Export path= $JBOSS _home/bin: $PATH
5. Refresh Environment Variables
Source/etc/profile
6. By default, after JBoss is started, the management console GUI listens only to localhost, and if you deploy JBoss on a remote server, you need to enter the $jboss_home/standalone/configuration/directory
CD $JBOSS _home/standalone/configuration
7. Modify the Standalone.xml file
Vim Standalone.xml
8. Use VIM keyword matching ("/") to find interface keywords, create the following under the Interfaces tab
<interface name= "any" >
<any-ipv4-address/>
</interface>
9. Modify the immediately following
<socket-binding-group name= "Standard-sockets" default-interface= " Public"Port-offset=" ${jboss.socket.binding.port-offset:0} ">
<socket-binding name= "Management-http" interface= "Management"Port=" ${jboss.management.http.port:9990} "/>
<socket-binding name= "Management-https" interface= "Management"Port=" ${jboss.management.https.port:9993} "/>
For
<socket-binding-group name= "Standard-sockets" default-interface= " any"Port-offset=" ${jboss.socket.binding.port-offset:0} ">
<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} "/>
10. Then go into the $jboss_home and run./bin/standalone.sh can log in to the GUI management console after you turn on the service
ip:9990

11. Configure Wildfly to execute as a standalone user and start or close by service, first create a new user named Wildfly
Useradd wildfly-m-D/-s/usr/sbin/nologin
12. Copy the $jboss_home/bin/init.d/wildfly-init-debian.sh to the/ETC/INIT.D directory and rename it to Wildfly
CP $JBOSS _home/bin/init.d/wildfly-init-debian.sh/etc/init.d/wildfly
13. Create a soft connection to $jboss_home in the/OPT directory
Ln-s $JBOSS _home/opt/wildfly
14. Start the Wildfly service
Service Wildfly Start
15. Close the Wildfly service
Service Wildfly Stop

16. Configure MySQL Xadatasource for wildfly to enter the $jboss_home/module directory
CD $JBOSS _home/module
17. Create a new Mysql/main directory
Mkdir-p Mysql/main
18. Place the MySQL driver file in the new main folder, this example uses the Mysql-connector-java-5.1.38-bin.jar
19. New Module.xml
Vim Module.xml
and add the following content
<?xml version= "1.0" encoding= "UTF-8"?>
<module xmlns= "urn:jboss:module:1.1" Name= "MySQL"> (Note: The value of name is consistent with one of the following properties, which is the path to this module in modules, if the MySQL driver package is in Module/com/mysql/main, then this is Com.mysql)
<resources>
<resource-root path= "Mysql-connector-java-5.1.38-bin.jar"/>
</resources>
<dependencies>
<module name= "Javax.api"/>
<module name= "Javax.transaction.api"/>
<module name= "Javax.servlet.api" optional= "true"/>
</dependencies>
</module>
Save exit
20. Enter the $jboss_home/standalone/configuration/directory using Vim to edit the Standlone.xml file
21. Find <datasources> Tags
22. Add the following to the <datasources> tab
<xa-datasource jndi-name= "Java:jboss/mysqlxads" pool-name= "Mysqlxads" >
<driver>mysql</driver>
<xa-datasource-property name= "ServerName" >localhost</xa-datasource-property>
<xa-datasource-property name= "DatabaseName" >hibernate</xa-datasource-property> (own data table space)
<security>
<user-name>root</user-name>
<password>******</password> (* on behalf of your own password)
</security>
<validation>
<valid-connection-checker class-name= " Org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker "></valid-connection-checker>
<exception-sorter class-name= "Org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter" ></ Exception-sorter>
</validation>
</xa-datasource>
23. Find <drivers> Tags
24. In the <drivers> tab, add the following:
<driver name= "MySQL" module= "MySQL"> (Consistent with the name attribute value of the note mentioned above)
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
25. Save Exit
26. Start Wildfly Service, Configuration complete

Reference: http://blog.csdn.net/hanshileiai/article/details/46987859
Reference: http://blog.csdn.net/msz1992/article/details/8826754
Reference: http://blog.sina.com.cn/s/blog_5b7916e60102vpfm.html

Ubuntu under JBoss Install and configure MySQL distributed data source for it

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.