阅读背景:

JavaÓ¦Ó÷þÎñÆ÷WildFly

来源:互联网 

ºìñ¹«Ë¾Ðû²¼JBoss ASµÄ¼ÌÈÎÕßWildFly£¬WildFly½«Íƶ¯ÏÂÒ»´úÓ¦Ó÷þÎñÆ÷¼¼ÊõµÄ·¢Õ¹£¬
Õâ¸öÏîÄ¿µÄÃû×ÖÊÇJBoss.orgÉçÇø³ÉÔ±ÔÚ2012Äêµ×ͶƱ²úÉú¡£
WildFly½«¼ÌÐø±£Áô JBoss ÆóÒµÓ¦ÓÃÆ½Ì¨²¢¶¨Î»Ò»Ð©¹Ø¼üµÄÖмä¼þ¼¼Êõ£¬
°üÀ¨¸üÁé»îºÍ¸üÏȽøµÄÓ¦Óÿª·¢£¬ÊµÏÖ¿ª·Å»ìºÏÔÆºÍ Java EE 7.
¸ÃÏîÄ¿Ê׸öµü´ú°æ±¾WildFly 8½«Ê×ÏÈͨ¹ýJava EE 7ÈÏÖ¤£¬
´øÀ´¸ü¼ò»¯¡¢±ê×¼»¯ºÍǶÈëÊ½ÌØÐÔ£¬ÊʺÏÔÆ¼ÆËãºÍÒÆ¶¯¿ª·¢³¡¾°¡£
ºìñÒѾ­ÑÝʾÁ˺ܶàÏîÄ¿£¬°üÀ¨ JBoss AS 7¡¢InfinispanÒÔ¼°ÔËÐÐÔÚRaspberry Pi¡¢Ç¶ÈëʽÉ豸ºÍÒÆ¶¯µç»°ÉÏ¡£
WildFlyÔøÓÃÃû£ºJBoss Application Server

Ò»¡¢»ù´¡»·¾³
1¡¢½ÇÉ«¡¢ip¡¢°æ±¾¡¢ÄÚºË
serverA 10.1.10.185 3.2.0-4-amd64 7.8 jdk wildfly
clientB win7
wildfly-9.0.1.Final.zip
jdk-8u51-linux-x64.tar.gz

2¡¢°²×°»ù´¡°ü
apt-get -y install axel unzip

¶þ¡¢°²×°java»·¾³
1¡¢ÏÂÔØ
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "https://download.oracle.com/otn-pub/java/jdk/8u51-b16/jdk-8u51-linux-x64.tar.gz"

2¡¢´´½¨Ä¿Â¼
mkdir -p /opt/java

3¡¢½âѹ
tar zxvf jdk-8u51-linux-x64.tar.gz -C /opt/java/

4¡¢ÅäÖÃjavaµÄ»·¾³±äÁ¿
cat /etc/profile
export JAVA_HOME=/opt/java/jdk1.8.0_51
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

5¡¢ÉúЧ
source /etc/profile

6¡¢²é¿´java°æ±¾
1)java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

7¡¢Ê¹ÓÃjpsÃüÁî²é¿´Ïà¹ØjavaÐÅÏ¢
1)jps -mlv
11885 sun.tools.jps.Jps -mlv -Denv.class.path=.:/opt/java/jdk1.8.0_51/lib/dt.jar:/opt/java/jdk1.8.0_51/lib/tools.jar -Dapplication.home=/opt/java/jdk1.8.0_51 -Xms8m
2)²ÎÊý˵Ã÷
-m  Displays the arguments passed to the main method.The output may be null for embedded JVMs(Êä³ömain methodµÄ²ÎÊý) 
-l  Displays the full package name for the application s main class or the full path name to the application s JAR file(Êä³öÍêÈ«µÄ°üÃû£¬Ó¦ÓÃÖ÷ÀàÃû£¬jarµÄÍêȫ·¾¶Ãû) 
-v  Displays the arguments passed to the JVM(Êä³öjvm²ÎÊý) 

Èý¡¢°²×°wildfly
1¡¢ÏÂÔØwildfly-9.0.1.Final.zip
axel -n 10 https://download.jboss.org/wildfly/9.0.1.Final/wildfly-9.0.1.Final.zip

2¡¢½âѹ
unzip wildfly-9.0.1.Final.zip -d /opt/

3¡¢¸ÄÃû
mv /opt/wildfly-9.0.1.Final/ /opt/wildfly

4¡¢²é¿´ÏÂĿ¼½á¹¹
ll /opt/wildfly-9.0.1.Final/
total 424
drwxr-xr-x 3 root root   4096 Jul 23 21:01 appclient
drwxr-xr-x 5 root root   4096 Jul 23 21:01 bin
-rw-r--r-- 1 root root   2451 Jul 23 21:01 copyright.txt
drwxr-xr-x 4 root root   4096 Jul 23 21:01 docs
drwxr-xr-x 5 root root   4096 Jul 23 21:01 domain
-rw-r--r-- 1 root root 366323 Jul 23 21:01 jboss-modules.jar
-rw-r--r-- 1 root root  26530 Jul 23 21:01 LICENSE.txt
drwxr-xr-x 3 root root   4096 Jul 23 21:01 modules
-rw-r--r-- 1 root root   2531 Jul 23 21:01 README.txt
drwxr-xr-x 6 root root   4096 Jul 23 21:01 standalone
drwxr-xr-x 2 root root   4096 Jul 23 21:01 welcome-content

5¡¢¸´ÖÆÅäÖÃÎļþ
cp /opt/wildfly/standalone/configuration/standalone.xml /opt/wildfly/standalone/configuration/standalone.xml.bak

6¡¢ÐÞ¸ÄÅäÖÃ
sed -i "s/127.0.0.1/10.1.10.185/" /opt/wildfly/standalone/configuration/standalone.xml

7¡¢Ìí¼ÓwildflyÓû§ÓÃÓÚÆô¶¯½Å±¾µÄ
adduser --system --group --no-create-home --home /opt/wildfly/ --disabled-login wildfly
Adding system user wildfly (UID 102) ...
Adding new group wildfly (GID 104) ...
Adding new user wildfly (UID 102) with group wildfly ...
Not creating home directory /opt/wildfly/.

8¡¢¸ü¸ÄĿ¼ȨÏÞ
chown wildfly /opt/wildfly/ -R

9¡¢¸´ÖÆÆô¶¯½Å±¾
cp /opt/wildfly/bin/init.d/wildfly-init-debian.sh /etc/init.d/wildfly

10¡¢Æô¶¯·þÎñ
/etc/init.d/wildfly start
[ ok ] Starting WildFly Application Server: wildfly.

11¡¢²é¿´¶Ë¿ÚºÍ½ø³Ì
1)²é¿´¶Ë¿Ú
netstat -tupnl |grep java
tcp        0      0 10.1.10.185:8080        0.0.0.0:*               LISTEN      2874/java       
tcp        0      0 10.1.10.185:9990        0.0.0.0:*               LISTEN      2874/java   
2)²é¿´½ø³Ì
ps -ef |grep stan
wildfly    2796      1  0 11:20 pts/1    00:00:00 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml
wildfly    2874   2796  3 11:20 pts/1    00:00:06 /opt/java/jdk1.8.0_51/bin/java -D[Standalone] -server -XX:+UseCompressedOops -server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/wildfly/standalone/log/server.log -Dlogging.configuration=file:/opt/wildfly/standalone/configuration/logging.properties -jar /opt/wildfly/jboss-modules.jar -mp /opt/wildfly/modules org.jboss.as.standalone -Djboss.home.dir=/opt/wildfly -Djboss.server.base.dir=/opt/wildfly/standalone -c standalone.xml

12¡¢²é¿´Ïà¹ØÈÕÖ¾
cat /opt/wildfly/standalone/log/server.log
2015-09-29 11:20:30,338 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested.
2015-09-29 11:20:30,408 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
2015-09-29 11:20:30,412 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0019: Host default-host stopping
2015-09-29 11:20:30,426 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with driver-name = h2
2015-09-29 11:20:30,433 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0008: Undertow HTTP listener default suspending
2015-09-29 11:20:30,438 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0007: Undertow HTTP listener default stopped, was bound to /127.0.0.1:8080
2015-09-29 11:20:30,441 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0004: Undertow 1.2.9.Final stopping
2015-09-29 11:20:30,463 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0050: WildFly Full 9.0.1.Final (WildFly Core 1.0.1.Final) stopped in 83ms
2015-09-29 11:20:37,185 INFO  [org.jboss.modules] (main) JBoss Modules version 1.4.3.Final
2015-09-29 11:20:37,726 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
2015-09-29 11:20:37,819 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 9.0.1.Final (WildFly Core 1.0.1.Final) starting
2015-09-29 11:20:37,831 DEBUG [org.jboss.as.config] (MSC service thread 1-2) Configured system properties:
    [Standalone] = 
    awt.toolkit = sun.awt.X11.XToolkit
    file.encoding = UTF-8
    file.encoding.pkg = sun.io
    file.separator = /
    java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
    java.awt.headless = true
    java.awt.printerjob = sun.print.PSPrinterJob
    java.class.path = /opt/wildfly/jboss-modules.jar
    java.class.version = 52.0
    java.endorsed.dirs = /opt/java/jdk1.8.0_51/jre/lib/endorsed
    java.ext.dirs = /opt/java/jdk1.8.0_51/jre/lib/ext:/usr/java/packages/lib/ext
    java.home = /opt/java/jdk1.8.0_51/jre
    java.io.tmpdir = /tmp
    java.library.path = /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
    java.net.preferIPv4Stack = true
    java.runtime.name = Java(TM) SE Runtime Environment
    java.runtime.version = 1.8.0_51-b16
    java.specification.name = Java Platform API Specification
    java.specification.vendor = Oracle Corporation
    java.specification.version = 1.8
    java.util.logging.manager = org.jboss.logmanager.LogManager
    java.vendor = Oracle Corporation
    java.vendor.url = https://java.oracle.com/
    java.vendor.url.bug = https://bugreport.sun.com/bugreport/
    java.version = 1.8.0_51
    java.vm.info = mixed mode
    java.vm.name = Java HotSpot(TM) 64-Bit Server VM
    java.vm.specification.name = Java Virtual Machine Specification
    java.vm.specification.vendor = Oracle Corporation
    java.vm.specification.version = 1.8
    java.vm.vendor = Oracle Corporation
    java.vm.version = 25.51-b03
    javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder
    javax.xml.datatype.DatatypeFactory = __redirected.__DatatypeFactory
    javax.xml.parsers.DocumentBuilderFactory = __redirected.__DocumentBuilderFactory
    javax.xml.parsers.SAXParserFactory = __redirected.__SAXParserFactory
    javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory
    javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory
    javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory
    javax.xml.transform.TransformerFactory = __redirected.__TransformerFactory
    javax.xml.validation.SchemaFactory:https://www.w3.org/2001/XMLSchema = __redirected.__SchemaFactory
    javax.xml.xpath.XPathFactory:https://java.sun.com/jaxp/xpath/dom = __redirected.__XPathFactory
    jboss.home.dir = /opt/wildfly
    jboss.host.name = debian
    jboss.modules.dir = /opt/wildfly/modules
    jboss.modules.system.pkgs = org.jboss.byteman
    jboss.node.name = debian
    jboss.qualified.host.name = debian
    jboss.server.base.dir = /opt/wildfly/standalone
    jboss.server.config.dir = /opt/wildfly/standalone/configuration
    jboss.server.data.dir = /opt/wildfly/standalone/data
    jboss.server.deploy.dir = /opt/wildfly/standalone/data/content
    jboss.server.log.dir = /opt/wildfly/standalone/log
    jboss.server.name = debian
    jboss.server.persist.config = true
    jboss.server.temp.dir = /opt/wildfly/standalone/tmp
    line.separator = 
    logging.configuration = file:/opt/wildfly/standalone/configuration/logging.properties
    module.path = /opt/wildfly/modules
    org.jboss.boot.log.file = /opt/wildfly/standalone/log/server.log
    org.jboss.resolver.warning = true
    org.xml.sax.driver = __redirected.__XMLReaderFactory
    os.arch = amd64
    os.name = Linux
    os.version = 3.2.0-4-amd64
    path.separator = :
    sun.arch.data.model = 64
    sun.boot.class.path = /opt/java/jdk1.8.0_51/jre/lib/resources.jar:/opt/java/jdk1.8.0_51/jre/lib/rt.jar:/opt/java/jdk1.8.0_51/jre/lib/sunrsasign.jar:/opt/java/jdk1.8.0_51/jre/lib/jsse.jar:/opt/java/jdk1.8.0_51/jre/lib/jce.jar:/opt/java/jdk1.8.0_51/jre/lib/charsets.jar:/opt/java/jdk1.8.0_51/jre/lib/jfr.jar:/opt/java/jdk1.8.0_51/jre/classes
    sun.boot.library.path = /opt/java/jdk1.8.0_51/jre/lib/amd64
    sun.cpu.endian = little
    sun.cpu.isalist = 
    sun.io.unicode.encoding = UnicodeLittle
    sun.java.command = /opt/wildfly/jboss-modules.jar -mp /opt/wildfly/modules org.jboss.as.standalone -Djboss.home.dir=/opt/wildfly -Djboss.server.base.dir=/opt/wildfly/standalone -c standalone.xml
    sun.java.launcher = SUN_STANDARD
    sun.jnu.encoding = UTF-8
    sun.management.compiler = HotSpot 64-Bit Tiered Compilers
    sun.os.patch.level = unknown
    user.country = US
    user.dir = /opt/wildfly
    user.home = /opt/wildfly/
    user.language = en
    user.name = wildfly
    user.timezone = Asia/Shanghai
2015-09-29 11:20:37,832 DEBUG [org.jboss.as.config] (MSC service thread 1-2) VM Arguments: -D[Standalone] -XX:+UseCompressedOops -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/wildfly/standalone/log/server.log -Dlogging.configuration=file:/opt/wildfly/standalone/configuration/logging.properties 
2015-09-29 11:20:39,982 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 17) WFLYCTL0028: Attribute "job-repository-type" in the resource at address "/subsystem=batch" is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
2015-09-29 11:20:39,984 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 12) WFLYCTL0028: Attribute "enabled" in the resource at address "/subsystem=datasources/data-source=ExampleDS" is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
2015-09-29 11:20:40,084 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
2015-09-29 11:20:40,127 INFO  [org.xnio] (MSC service thread 1-2) XNIO version 3.3.1.Final
2015-09-29 11:20:40,163 INFO  [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.3.1.Final
2015-09-29 11:20:40,256 INFO  [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 4.0.9.Final
2015-09-29 11:20:40,339 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 38) WFLYCLINF0001: Activating Infinispan subsystem.
2015-09-29 11:20:40,341 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 37) WFLYIO001: Worker "default" has auto-configured to 2 core threads with 16 task threads based on your 1 available processors
2015-09-29 11:20:40,414 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
2015-09-29 11:20:40,427 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 46) WFLYNAM0001: Activating Naming Subsystem
2015-09-29 11:20:40,453 INFO  [org.jboss.as.connector] (MSC service thread 1-2) WFLYJCA0009: Starting JCA Subsystem (IronJacamar 1.2.4.Final)
2015-09-29 11:20:40,475 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 53) WFLYSEC0002: Activating Security Subsystem
2015-09-29 11:20:40,493 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
2015-09-29 11:20:40,435 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 44) WFLYJSF0007: Activated the following JSF Implementations: [main]
2015-09-29 11:20:40,539 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 56) WFLYWS0002: Activating WebServices Extension
2015-09-29 11:20:40,566 INFO  [org.jboss.as.security] (MSC service thread 1-1) WFLYSEC0001: Current PicketBox version=4.9.2.Final
2015-09-29 11:20:40,617 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = h2
2015-09-29 11:20:40,725 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0003: Undertow 1.2.9.Final starting
2015-09-29 11:20:40,765 INFO  [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
2015-09-29 11:20:40,733 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0003: Undertow 1.2.9.Final starting
2015-09-29 11:20:40,782 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
2015-09-29 11:20:41,211 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path /opt/wildfly/welcome-content
2015-09-29 11:20:41,397 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
2015-09-29 11:20:41,707 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting
2015-09-29 11:20:41,737 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on /10.1.10.185:8080
2015-09-29 11:20:42,175 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
2015-09-29 11:20:42,209 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly/standalone/deployments
2015-09-29 11:20:42,510 INFO  [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBoss Web Services - Stack CXF Server 5.0.0.Final
2015-09-29 11:20:42,890 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on https://10.1.10.185:9990/management
2015-09-29 11:20:42,893 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on https://10.1.10.185:9990
2015-09-29 11:20:42,894 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 9.0.1.Final (WildFly Core 1.0.1.Final) started in 6225ms - Started 203 of 379 services (210 services are lazy, passive or on-demand)

ËÄ¡¢²âÊÔ(clientB)
1¡¢ÊäÈë10.1.10.185:8080ºó¿´µ½Ò³Ãæ³öÀ´Á˺ìñ¹«Ë¾Ðû²¼JBoss ASµÄ¼ÌÈÎÕßWildFly£¬WildFly½«Íƶ¯




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: