1. 개요

WildFly 실행에 대한 내용이다.


2. 자바

WildFly 10은 자바 1.8을 필요로 한다. 먼저 자바 1.8 환경을 설정한다. 자바는 보통 Oracle 혹은 OpenJDK를 설치한다.

$ export JAVA_HOME=/app/jdk1.8.0_60
$ echo $JAVA_HOME

자바는 32bit와 64bit 중 선택 가능하며, 32bit인 경우 보통 4GB의 메모리 제한이 있으며, 이 중 자바 Heap 영역에 할당 가능한 공간은 3GB 정도이다. (Linux 기준)


3. standalone 실행

자바 환경이 설정되었으면 다음과 같이 bin/standalone.sh를 실행한다.

$ ./standalone.sh
=========================================================================
 
  JBoss Bootstrap Environment
 
  JBOSS_HOME: /app/wildfly
 
  JAVA: /app/jdk1.8.0_60/bin/java
 
  JAVA_OPTS:  -server -Xms64m -Xmx512m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
 
=========================================================================
 
09:46:08,671 INFO  [org.jboss.modules] (main) JBoss Modules version 1.4.4.Final
09:46:09,433 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
09:46:09,593 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 10.0.0.CR2 (WildFly Core 2.0.0.CR5) starting
09:46:12,960 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 22) 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.
09:46:13,124 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
09:46:13,199 INFO  [org.xnio] (MSC service thread 1-2) XNIO version 3.3.2.Final
09:46:13,224 INFO  [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.3.2.Final
09:46:13,367 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 38) WFLYCLINF0001: Activating Infinispan subsystem.
09:46:13,451 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 46) WFLYNAM0001: Activating Naming Subsystem
09:46:13,432 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 44) WFLYJSF0007: Activated the following JSF Implementations: [main]
09:46:13,483 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.
09:46:13,524 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 53) WFLYSEC0002: Activating Security Subsystem
09:46:13,610 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 56) WFLYWS0002: Activating WebServices Extension
09:46:13,687 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
09:46:13,701 INFO  [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 4.0.14.Final
09:46:14,023 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0003: Undertow 1.3.0.CR2 starting
09:46:14,015 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
09:46:14,164 INFO  [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=4.9.3.Final
09:46:14,153 INFO  [org.jboss.as.connector] (MSC service thread 1-1) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.0.Final)
09:46:14,201 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0003: Undertow 1.3.0.CR2 starting
09:46:14,390 INFO  [org.jboss.as.naming] (MSC service thread 1-1) WFLYNAM0003: Starting Naming Service
09:46:14,514 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
09:46:14,515 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = h2
09:46:14,673 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path '/app/wildfly/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
09:46:14,986 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
09:46:15,202 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 16 (per class), which is derived from thread worker pool sizing.
09:46:15,202 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 4 (per class), which is derived from the number of CPUs on this host.
09:46:15,510 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting
09:46:15,554 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
09:46:16,149 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
09:46:16,188 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory /app/wildfly/standalone/deployments
09:46:16,667 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBoss Web Services - Stack CXF Server 5.1.0.Final
09:46:17,239 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
09:46:17,240 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:46:17,245 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.CR2 (WildFly Core 2.0.0.CR5) started in 9266ms - Started 211 of 490 services (315 services are lazy, passive or on-demand)

started in .... ms가 나오면 정상 기동된 것이다. 기본 HTTP 포트는 "Undertow HTTP listener default listening on 127.0.0.1:8080" 로그에서 알 수 있듯이 8080이다. 기본 포트인 8080이 LISTEN 상태인지 확인한다.

$ netstat -an | grep 8080
tcp        0      0 127.0.0.1:8080              0.0.0.0:*                   LISTEN

 WildFly 10은 자바 1.8을 필요로 한다. 만약 자바 1.7 환경에서 WildFly 10을 기동하면 다음과 같은 에러가 발생한다.

$ ./standalone.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /app/wildfly

  JAVA: java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

This application requires Java specification version 1.8 or later to run (this Java virtual machine implements specification version 1.7)

4. Thread

WildFly 기본 배포 버전의 내부 Thread 종류는 다음과 같다.

  • Attach Listener (daemon thread)
  • ServerService Thread Pool -- *
  • ejb-client-context-tasks-2-thread-* (daemon thread)
  • XNIO-1 I/O-*
  • DeploymentScanner-threads
  • Transaction Reaper Worker * (daemon thread)
  • Transaction Reaper (daemon thread)
  • Periodic Recovery
  • Transaction Expired Entry Monitor (daemon thread)
  • Timer-*
  • ConnectionValidator (daemon thread)
  • IdleRemover (daemon thread)
  • default I/O-*
  • Remoting "[호스트명]:MANAGEMENT" I/O-*
  • DeploymentScanner-threads - *
  • DestroyJavaVM
  • ServerDeploymentRepository-temp-threads - * (daemon thread)
  • MSC service thread 1-*
  • Reference Reaper #* (daemon thread)
  • Service Thread" #* (daemon thread)
  • C1 CompilerThread* (daemon thread)
  • Signal Dispatcher (daemon thread)
  • Finalizer (daemon thread)
  • Reference Handler (daemon thread)
  • VM Thread
  • VM Periodic Task Thread