Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

************************************************************

DEMONSTRATION OF WAS 7 FEATURE - PROPERTY FILE CONFIGURATION


************************************************************

1) Extract Property files:


-----------------------------

for Adminagent property files:


-------------------------------
AdminTask.extractConfigProperties('-propertiesFileName adminagent.props
-configData Server=adminagent')

$ ls -rlt *.props
-rw------- 1 wassrvr websrvr 69650 Nov 7 13:21
adminagent.props

After modification:

AdminTask.validateConfigProperties('-propertiesFileName
adminagent.props -reportFileName adminagentPropsReport.txt')
*********************
ADMG0818I: Processing section TraceLog:TraceService.
ADMG0810I: Not changing value for this property fileName. New value
specified is same as current value ${SERVER_LOG_ROOT}/tra
ce.log.
ADMG0811I: Changing value for this property maxNumberOfBackupFiles. New
value specified is 10. Old value was 1.
ADMG0810I: Not changing value for this property rolloverSize. New value
specified is same as current value 20.
ADMG0819I: End Processing section TraceLog:TraceService.
*********************
ADMG0811I: Changing value for this property initialHeapSize. New value
specified is 256. Old value was 0.
ADMG0810I: Not changing value for this property
internalClassAccessMode. New value specified is same as current value
ALLOW.
ADMG0811I: Changing value for this property maximumHeapSize. New value
specified is 512. Old value was 0.
*********************

AdminTask.applyConfigProperties('-propertiesFileName adminagent.props')

AdminConfig.Save()

***********************************************************************

2) Deleting config objects:


---------------------------
$ ./wsadmin.sh -profileName AppSrv01 -lang jython

AdminTask.extractConfigProperties(‘-propertiesFileName threadPool.props
-configData Server=server01 -filterMechanism SELECTED_SUBTYPES -
selectedSubTypes [ThreadPool]')
Editing the threadpool.props
----------------------------
#
# SubSection 1.0.9.5 # Thread pools
#
ResourceType=ThreadPool
ImplementingResourceType=Server
ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!
{serverName}:ThreadPoolManager=ID#ThreadPoolManager_1183122130078:Thread
Pool=ID#ThreadPool_1183122130079
DELETE=true
#

#
#Properties
#
maximumSize=50 #integer
name=WebContainer
inactivityTimeout=60000 #integer
minimumSize=50 #integer
isGrowable=false #boolean

deleting threadpool config


----------------------------

wsadmin>AdminTask.deleteConfigProperties('-propertiesFileName
threadpool.props')
''

wsadmin>AdminConfig.save()
''
wsadmin>exit

***********************************************************************

3) Add a new configuration:


---------------------------
Adding a datasource
-------------------

wsadmin>AdminTask.extractConfigProperties('-propertiesFileName
datasource.props -configData Server=server01 -filterMechanism
SELECTED_SUBTYPES -selectedSubTypes [DataSource]')

**************************************
#
# Configuration properties file for cells/g03edtest001Node01Cell/nodes/
g03edtest001Node01/servers/server01|server.xml#
# Extracted on Sun Nov 07 16:17:30 GMT 2010
#

#
# Section 1.0_1.10 ## Cell=!{cellName}:Node=!{nodeName}:Server=!
{serverName}:JDBCProvider=ID#builtin_jdbcprovider:DataSource=
ID#DataSource_99999_
#

#
# SubSection 1.0.1.0 # DataSource attributes
#
ResourceType=DataSource
ImplementingResourceType=JDBCProvider
ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!
{serverName}:JDBCProvider=ID#builtin_jdbcprovider:DataSource=ID#DataSour
ce_99999
#

#
#Properties
#
name=testDataSource
category=default
datasourceHelperClassname=com.ibm.websphere.rsadapter.DerbyDataStoreHel
per
authMechanismPreference=BASIC_PASSWORD #ENUM(BASIC_PASSWORD|KERBEROS)
statementCacheSize=10 #integer
providerType=null #readonly
jndiName="jdbc/testDataSource"
relationalResourceAdapter=WebSphere Relational Resource Adapter
#ObjectName(J2CResourceAdapter)
xaRecoveryAuthAlias=null
diagnoseConnectionUsage=false #boolean
authDataAlias=null
manageCachedHandles=false #boolean
provider=Derby JDBC Provider (XA) #ObjectName(JDBCProvider),readonly
description=Default data source for WebSphere EJB Timer Service
logMissingTransactionContext=true #boolean

#
# SubSection 1.0.1.0.3 # DataSource Custom Properties
#
ResourceType=DataSource
ImplementingResourceType=JDBCProvider
ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!
{serverName}:JDBCProvider=ID#builtin_jdbcprovider:DataSource=ID#DataSour
ce_1000001
AttributeInfo=properties(name,value)
#

#
#Properties
#

#
#
EnvironmentVariablesSection
#
#
#Environment Variables
hostName2=${LOCALHOST_NAME}
hostName1=*
cellName=g03edtest001Node01Cell
nodeName=g03edtest001Node01
hostName=g03edtest001
serverName=server01
**************************************
wsadmin>AdminTask.validateConfigProperties('-propertiesFileName
datasource.props)
'true'
wsadmin>AdminTask.applyConfigProperties('-propertiesFileName
datasource.props')
''
wsadmin>AdminConfig.save()
''
wsadmin>

***********************************************************************

4) Creating a configuration Using Templates


--------------------------------------------

AdminTask.createPropertiesFileTemplates('-propertiesFileName app.props
–configType Application')

Content of app.props
---------------------

#ResourceType=Application
ImplementingResourceType=Application
ResourceId=Deployment=
SKIP=true
CreateDeleteCommandProperties=true

#
#Properties
#

EarFileLocation=location of earfile #required


Name=appName #required
TargetNode=targetNodeName #required
TargetServer=targetServerName #required

The above file needs to be updated and then execute the following
command to install the application

AdminTask.applyConfigProperties(‘-propertiesFileName app.props’)

AdminConfig.save()

You might also like