Administration 이우진대리 Solution Engineer Solution Engineer 다우기술
Agenda AS Introduction WAS 구성 Installation 기본 Production o Tuning Monitoring Q / A
EAP Introduction
Community Project
Community & Enterprise Platform Enterprise Application Platform ORM, persistence, web 2.0 기반 application framework 및클러스터링을지원하는 Java EE 서버와통합되어있고, 자바애플리케이션을개발하고배포하고서비스하기위한플랫폼 Developer Studio 개발을목적으로하는 Enterprise Application Platform 과 Tools 를결합한제품 Enterprise SOA Platform Service Orchestration, business process automation, Enterprise Service Bus(ESB), rule engine 등과통합되어있는플랫폼 Enterprise Portal Platform Portal Framework, CMS workflow functionality 와통합되어있고포탈을개발하고배포하기위한플랫폼 Enterprise Framework Hibernate, Seam, jbpm, Rules MetaMatrix Enterprise Data Services Platform 분산되어있는다양한데이터소스를하나의데이터소스처럼사용할수있도록하는플랫폼
WAS 구성
Software/Hardware Topology 단일시스템토폴로지 단일시스템토폴로지 다중시스템토폴로지
단일시스템토폴로지 App1 App2 App3 LDAP Enterprise Application Platform Database Web Server Java Virtual Machine OS
다중시스템토폴로지 App1 App2 App3 Database Web Server OS Enterprise Application i Platform Java Virtual Machine OS OS LDAP OS
Software/Hardware Topology 고려사항 가격 / 예산 (Price) 성능 (Performance) 가용성 (Availability) 확장성 (Scalability) 어플리케이션 Architecture Hardware ( 서버대수, Switch, NIC,...) Instance 개수 어플리케이션배치 Load Balancing Fail-over Session Replication
Web+WAS 1 set 구성 EIS Web Server (Proxy module) 가장단순한구성 2 CPU 이상
Web+WAS 1 set 구성 (multiple instance) Web Server (Proxy module) EIS 고사양서버 (CPU / Memory) 서비스별로별도의 Instance VS. Instance를동일하게구성
Web+WAS 1 set 구성 (multiple instance) 서비스별 Instance Instance 동일구성 A A B C B A B C C A B C Single Sign On (SSO) Single Sign On (SSO) Load Balancing Fail-over Session Replication A B C Application
Web / WAS 분리 EIS Web Server (Proxy module) 보통 Instance 마다동일한서비스들을올림 Load Balancing, Fail-over, Session Replication
Web+WAS multiple set 구성 Web Server (Proxy module) L4 EIS Web Server (Proxy module) 웹서버이중화 L4 Load Balancing
Web / WAS 분리 (Load Balancing) L4 Web Server (Proxy module) EIS Web Server (Proxy module)
WAS (Servlet/JSP, EJB) 분리 Web Server (Proxy module) Servlet/JSP EJB L4 EIS Web Server (Proxy module) Servlet/JSP EJB
Web / WAS 분리 (Load Balancing / multiple instance) L4 Web Server (Proxy module) EIS Web Server (Proxy module) 동일서비스 Instance 들을 Clustering
Installation
설치전체크사항 OS 와 JDK Database 웹서버연동 / 서비스포트 클러스터구성 WAS Instance 수
EAP 인증플랫폼및구성 Java Virtual Machine Sun JDK 1.5.X BEA JRockit JDK 1.5.X HP-UX JDK 1.5.X IBM JDK 1.5.X Operating System OS Chip Architecture JVM RHEL v4.5, v5 x86, x86_64 Sun JDK 1.5.0_11, BEA JRockit JDK 1.5.0_08 Windows 2003 x86 Sun JDK 1.5.0_11, BEA JRockit JDK 1.5.0_10 Windows 2003 x86_64 Sun JDK 1.5.0_11, BEA JRockit JDK 1.5.0_08 Solaris 9, 10 SPARC Sun JDK 1.5.0_11 HP-UX i2 RISC, ia64 HP-UX JDK 1.5.0.06 Database Oracle 10gR2 Oracle 9i Database Microsoft SQL Server 2005 MySQL v5.0 Driver Oracle JDBC Driver v10.2.0.1, v10.2.0.2 Oracle JDBC Driver v10.2.0.1, v10.2.0.2 Microsoft SQL Server 2005 driver v1.1.1501.101 Mysql-connector-java v5.0.4 PostgreSQL v8.1 PostgreSQL v8.2 JDBC3 with SSL (build 504)
EAP 4.3.0 설치 Enterprise Application Platform https://network.jboss.com t Seam과매뉴얼포함 Java 5 필수 all, default, minimal, production 프로파일 zip 배포본 jboss-eap-4.3.0.ga-1.ep1.8.zip 430GA 18 기본적인보안설정적용되어있으나관리자계정이설정되어있지않음 관리자계정추가필요 Enterprise Installer java -jar enterprise-installer-4.3.0.ga-1.ep1.8.jar 설치시보안설정
EAP 기동 시작 cd ${JBOSS_HOME}/bin./run.sh -c default -b 203.231.14.5 기본으로 127.0.0.1에바인딩함, 별도 bind address 설정이없을경우외부에서접속못함 별도프로파일설정이없으면 production 이사용됨 별도의스크립트를작성 - nohup run.sh > /path/to/log 2>&1
EAP 기동 run parameters -c profile_name or --configuration=profile_name i fil 해당 profile 의 instance 를기동 -b bind_addr or --host=bind_addr 특정 ip 주소로 binding AS 4.0.X는기본으로 0.0.0.0에바인딩 AS 4.2.X는기본으로 127.0.0.1에바인딩 -g partition_namename or --partition=partition_name name Clustering시 partition 명 기본으로 DefaultPartition -u multicast_ipip or --udp=multicast multicast_ipip Clustering 시 multicast 주소 -Dproperty=value system property p 설정 -Djava.net.preferIPv4Stack=true -Djboss.home.dir=/home/jboss-4.2.1.GA -Djboss.server.base.dir=/home/jboss-4.2.1.GA/server -Djboss.server.home.dir=/home/jboss-4.2.1.GA/server/default -Djboss.server.config.url=/home/jboss-4.2.1.GA/server/default/conf -Djboss.server.lib.url=/home/jboss-4.2.1.GA/server/default/lib -Djboss.partition.name=partition_name name name -Djboss.partition.udpGroup=multicast_ip
EAP 기동 중지 cd ${JBOSS _ HOME}/bin./shutdown.sh -S -u userid -p password -s 203.231.14.5 bind address 를설정해기동한경우 -s bind_addr 로해당바인딩주소를명시해야함
Multiple Instance 여러 Instance 를동시에운영하려면 port 를변경해야함 서비스바인딩관리자 한서버에서여러개의 instance 를운영할때사용 서비스별포트를한파일에서설정할수있도록함 conf/jboss-service.xmlservice 에서 ServiceBindingManager 를활성화 <mbean code="org.jboss.services.binding.servicebindingmanager" name="jboss.system:service=servicebindingmanager"> <attribute name="servername">ports-01</attribute> <attribute name="storeurl">${jboss.home.url}/docs/examples/binding-manager/samplebindings.xml</attribute> <attribute name="storefactoryclassname"> org.jboss.services.binding.xmlservicesstorefactory </attribute> </mbean> StoreURL 서비스바인딩설정파일위치 ServerName 서비스바인딩설정명 ports-default, ports-01, ports-02, ports-03
기본 Production Tuning
OS 프로세스가사용할수있는 File Descriptor 수를 1024 이상으로 ulimit -n 8192 명령실행시 ulimit: exceeds allowable limit 발생? OS 의 hard limit it 값을올려줘야함 프로세스가생성할수있는 Thread 수를 512 이상으로 HP-UX 의경우 max_thread_proc 1024 nkthread 3635
Instance JVM Option global 설정 $JBOSS_HOME/bin/run.conf Instance 별설정 $JBOSS_HOME/server/<instance_name>/run.conf Windows 버전은 run.conf 를사용하지않음 run.bat 에설정 #MAX_FD="maximum #JAVA_HOME="/opt/java/jdk if [ "x$java_opts" = "x" ]; then JAVA_OPTS="-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 l -Dsun.rmi.dgc.server.gcInterval=3600000" fi
Instance JVM Option (cont.) Java Heap 크기설정 Heap 크기는 free memory 크기및어플리케이션특성에따라다르게설정 기본으로 512M 또는 1G 로설정 -Xms 와 -Xmx 값을동일하게설정 GC 로그설정 -verbose:gc -Xloggc:/path/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution i t ib ti Ctrl+Break (kill -3) 로 thread dump 를뜰때추가적으로클래스정보출력 -XX:+PrintClassHistogram JAVA_OPTS="-Xms512m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 - Dsun.rmi.dgc.server.gcInterval=3600000 -verbose:gc -Xloggc:/path/gc.log - XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution - XX:+PrintClassHistogram"
기본튜닝사항 - 로깅레벨을 INFO 로,CONSOLEappender 제거 conf/jboss-log4j.xml <root> <priority value="info" /> <!--<appender-ref ref="console"/> --> <appender-ref ref= ASYNC"/> </root> Deployment Scanner 를끄거나주기를아주길게조정 conf/jboss-service.xml <attribute name="scanenabled">false</attribute> <attribute name="scanperiod">60000</attribute>
기본튜닝사항 - 사용하지않는 Tomcat Connector 코멘트처리 deploy/jboss-webdeployer/server web.deployer/server.xml <!-- <Connector port="8009" address="${jboss.bind.address}" protocol="ajp/1.3" emptysessionpath="true" enablelookups="false" redirectport="8443" /> --> JSP 를 production 모드로설정 deploy/jboss-web.deployer/conf/web.xml <servlet> <servlet-name>jsp</servlet-name> <init-param> <param-name>development</param-name> <param-value>false</param-value> </init-param>
기타설정사항 System.out 출력을로그파일에남기지않도록 conf/jboss-service.xml <mbean code="org.jboss.logging.log4jservice" name="jboss.system:type=log4jservice,service=logging" xmbean-dd="resource:xmdesc/log4jservice-xmbean.xml"> <attribute name="configurationurl">resource:jboss-log4j.xml</attribute> <attribute name="log4jquietmode">true</attribute> <!-- How frequently in seconds the ConfigurationURL is checked for changes --> <attribute name="refreshperiod">60</attribute> <attribute name="catchsystemout">false</attribute> <attribute name="catchsystemerr">false</attribute> </mbean> Tomcat Connector 한글설정 deploy/jboss-web.deployer/server.xml <Connector port="8080" address="${jboss.bind.address}" maxthreads="250" maxhttpheadersize="8192" emptysessionpath="true" protocol="http/1.1" enablelookups="false" redirectport="8443" acceptcount="100" connectiontimeout="20000" disableuploadtimeout="true" URIEncoding="euc-kr"/>
Monitoring
서비스모니터링 Server Info web-console http://ip:port/web-console/serverinfo.jsp pp jp
서비스모니터링 JVM jmx-console jboss.system:type=serverinfo yp listmemorypool()
서비스모니터링 CPU Utilization jmx-console jboss.system:type=serverinfo yp listthreadcpuutilization()
서비스모니터링 Thread Dump jmx-console jboss.system:type=serverinfo yp listthreaddump()
서비스모니터링 Web Status web-console http://ip:port/web-console/status pp or http://ip:port/status pp
서비스모니터링 Web Thread Pool web-console - monitor System JMX MBeans jboss.web jboss.web:type=threadpool,name=http-127.0.0.1-8080
서비스모니터링 DB Connection Pool web-console - monitor System JMX MBeans jboss.jca j jboss.jca:service=managedconnectionpool,name=defaultds twiddle twiddle.sh get "jboss.jca:name=defaultds,service=managedconnectionpool" InUseConnectionCount ConnectionCount jboss.jca:name=<jdbc POOL NAME>,service=ManagedConnectionPool
Q/A