EOS自带的JBOSS和目前的JBOSS版本是有不小的区别的本文主要介绍EOS部署在JBOSS以上版本的配置技巧
ERROR: invalid console appender config detected console stream is looping
配置介绍
日志的配置
JBOSS集成了logj所以在启动eos后发现日志出现一下错误ERROR invalid console appender config detected console stream is looping
这主要是EOS应用自己的 logj和jboss集成的logj沖突解决方法是
使用jboss的logj转移eos的log配置到jboss的 server/default/conf/logjxml里类似以下配置
<appender class=orgjbossloggingappenderRollingFileAppender name=R>
<errorHandler class=orgjbossloggingutilOnlyOnceErrorHandler/>
<param name=File value=${EOS_HOME}/logs/eosloglog/>
<param name=Append value=true/>
<param name=MaxFileSize value=KB/>
<param name=MaxBackupIndex value=/>
<layout class=orgapachelogjPatternLayout>
<param name=ConversionPattern value=%d %p [%c] %m%n/>
</layout> </appender>
<logger name=service>
<level value=DEBUG />
<appenderref ref=R />
</logger>
修改server/default/conf/jbossservicexml
<mbean code=orgjbossloggingLogjService
name=jbosssystemtype=LogjServiceservice=Logging
xmbeandd=resourcexmdesc/LogjServicexmbeanxml>
<attribute name=ConfigurationURL>resourcelogjxml</attribute>
<attribute name=CatchSystemOut>false</attribute>
<!—— Set the orgapachelogjhelpersLogLogsetQuiteMode As of logj
this needs to be set to avoid a possible deadlock on exception at the
appender level See bug#
——>
<attribute name=LogjQuietMode>true</attribute>
<!—— How frequently in seconds the ConfigurationURL is checked for changes ——>
<attribute name=RefreshPeriod></attribute>
</mbean>
修改server/default/deploy/jbosswebtomcatsar/METAINF/jbossservicexml
<attribute name=JavaClassLoadingCompliance>true</attribute>
<!—— A flag indicating if the JBoss Loader should be used This loader
uses a unified class loader as the class loader rather than the tomcat
specific class loader
The default is false to ensure that wars have isolated class loading
for duplicate jars and jsp files
——>
<attribute name=UseJBossWebLoader>true</attribute>
事务控制的配置
Jboss事务处理也有相应配置server/default/conf/jbossservicexml
<mbean code=orgjbosstmTransactionManagerService
name=jbossservice=TransactionManager
xmbeandd=resourcexmdesc/TransactionManagerServicexmbeanxml>
<attribute name=TransactionTimeout></attribute> <!—— set to false to disable transaction demarcation over IIOP ——>
<attribute name=GlobalIdsEnabled>true</attribute>
<depends optionalattributename=XidFactory>jbossservice=XidFactory</depends>
<!—— Transaction Integrity Checking ——>
<!—— Force a rollback if another thread is associated with the transaction at commit ——>
<!——depends optionalattributename=TransactionIntegrityFactory
proxytype=orgjbosstmintegrityTransactionIntegrityFactory> <mbean code=orgjbosstmintegrityFailIncompleteTransaction
name=jbossservice=TransactionManagerplugin=TransactionIntegrity/>
</depends——> </mbean>
如果要一台机器使用多个jboss server那么需要修改的文件server/default/conf/jbossservicexml server/default/deploy/jbosswebtomcatsar/serverxml
server/default/deploy/jbosswebtomcatsar/serverxml配置要点
<Connector port= address=${jbossbindaddress}
maxThreads= strategy=ms maxHttpHeaderSize=
emptySessionPath=true
enableLookups=false redirectPort= acceptCount=
connectionTimeout= disableUploadTimeout=true URIEncoding=GBK/>
注acceptCount是排队请求的数量应该将线程数(最大线程数)设置比最大预期负载(同时并发的点击)多%(经验规则)应该将minSpareThread设置比正常负载多一些
应该将maxSpareThread设置比峰值负载多一些
minSpareThread指启动以后总是保持该数量的线程空闲等待
maxSpareThread指如果超过了minSpareThread然后总是保持该数量的线程空闲等待
删除不需要的valve和日志如果不使用JBoss的安全删除JBoss的安全valve预编译JSP(内置的编译器编译速度相当快对于小的站点就没有必要预先编译了)
关闭sever/slim/jbosswebtomcatsar/conf/webxml中的development模式URIEncoding=GBK 基本解决了乱码问题
安全连接配置
<!—— SSL/TLS Connector configuration using the admin devl guide keystore ——>
<Connector port= address=${jbossbindaddress}
maxThreads= strategy=ms maxHttpHeaderSize=
emptySessionPath=true
scheme=https secure=true clientAuth=false
keystoreFile=${jbossserverhomedir}/conf/chapkeystore
keystorePass=changeit sslProtocol = TLS />