Previous | Home | Next
Managing profiles with the command line
You already saw how profiles are created with the Profile Management Tool and dmgr consoles. At the heart of these tool lays manageprofiles.sh, which can also be used to manage profiles directly. Using manageprofiles.sh, we can create, list, augment, or delete the profiles.
The manageprofiles command is in...
INSTALL_ROOT/bin
To get more information about using this command, type:
manageprofiles.sh -help
Listing profiles
To list all created profiles...
$ manageprofiles.bat -listProfiles
[Dmgr01, AppSrv01, Custom01, AdminAgent01, JobMgr01, AppSrv02]
Create profiles from templates
When creating a profile using manageprofiles.sh, specify a profile template, which is supplied with the product. WAS uses these templates as a base for creating a new profile. These templates are located in...
INSTALL_ROOT/profiletemplates
Each template consists of a set of files that provide the initial settings for the profile and a list of actions to perform after the profile is created.
The following profiles are defined by default for the WAS V8.5:
- Default (for application server profiles)
- Management (for deployment manager, job manager, and administrative agent profiles)
- Managed (for custom profiles)
- Cell (for cell profiles)
To create a deployment manager named Dmgr02 with enabled administrative security enabled.
manageprofiles.bat -create -templatePath /IBM/WAS/AppServer/profileTemplates.management -serverType DEPLOYMENT_MANAGER -profileName Dmgr02 -profilePath /IBM/WAS/AppServer/profiles/Dmgr02 -enableAdminSecurity true -adminUserName wasadmin -adminPassword passw0rd -cellName myHostCell01 -nodeName myHostCellManager01The log files created when you run manageprofiles.sh are located in:
INSTALL_ROOT/logs/manageprofile/profilename_action.log
For example:
/IBM/WAS/AppServer/logs/manageprofiles/Dmgr02_create.log
Additional log files are created in...
INSTALL_ROOT/logs/manageprofile/profile_name/
For example:
/IBM/WAS/AppServer/logs/manageprofiles/Dmgr02
Do not manually modify the files in...
INSTALL_ROOT/profileTemplates
Create profiles with non-default ports
During profile creation using manageprofiles.sh, we can accept the default port values, or we can specify our own port settings. To specify ports...
- Point to a file containing the port values
- Specify the starting port value
- Specify the default port values
During profile creation, manageprofiles.sh uses an automatically generated set of recommended ports. We can modify the port values using the following parameters on manageprofiles.sh:
defaultPorts Assigns default or base port value for the profile. startingPort Starting port number for generating and assigning all ports for the profile. If a port value in the sequence conflicts with an existing port assignment, the next available port value is used. portsFile Specifies a path to a file that defines port settings for the profile. Example contents of portdef.props file
IPC_CONNECTOR_ADDRESS=9636
CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS=9416
XDAGENT_PORT=7063
OVERLAY_UDP_LISTENER_ADDRESS=11011
WC_adminhost=9064
DataPowerMgr_inbound_secure=5556
DCS_UNICAST_ADDRESS=9357
BOOTSTRAP_ADDRESS=9812
SAS_SSL_SERVERAUTH_LISTENER_ADDRESS=9417
SOAP_CONNECTOR_ADDRESS=8884
CELL_DISCOVERY_ADDRESS=7279
ORB_LISTENER_ADDRESS=9103
STATUS_LISTENER_ADDRESS=9421
CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS=9418
OVERLAY_TCP_LISTENER_ADDRESS=11012
WC_adminhost_secure=9047
We can also use the validatePorts parameter, which specifies that ports must be validated to ensure they are not reserved or in use. This parameter helps identify ports that are not being used.
Create a stand-alone profile using the startingPort parameter
manageprofiles.bat -create -templatePath /IBM/WAS/AppServer/profileTemplates/default -profileName AppSrv05 -profilePath /IBM/WAS/AppServer/profiles/AppSrv05 -startingPort 22222 -cellName test5Cell01 -nodeName test5Node01To change the ports after the profile creation, use the updatePorts tool.
Deleting profiles
To properly delete a profile:
- If we are removing an application server profile that has not been federated to a cell:
- Stop the application server.
- Delete the profile...
manageprofiles -delete -profileName profile_name
- Clean the profile registry...
manageprofiles -validateAndUpdateRegistry
- Delete the PROFILE_HOME directory.
- If we are removing a custom profile or application server profile federated to a cell:
- Stop the profile server instance on this node.
- Remove the node from the cell using the dmgr console or the removeNode command.
This will not delete the node but only restore it to its pre-federated configuration.
- Delete the profile...
manageprofiles -delete -profileName profile_name.
- Clean the profile registry...
manageprofiles -validateAndUpdateRegistry
- Delete the PROFILE_HOME directory.
- If we are removing a deployment manager profile:
- Remove any nodes federated to the cell using the dmgr console or the removeNode command.
This will not delete the node but only restore it to its pre-federated configuration.
- Stop the deployment manager.
- Delete the deployment manager profile...
manageprofiles -delete -profileName profile_name
- Clean the profile registry...
manageprofiles -validateAndUpdateRegistry
- Delete the PROFILE_HOME directory.
In case of problems or errors while deleting the profiles, check the logs under:
INSTALL_ROOT/logs/manageprofile/profilename_delete.log
Deleting a profile using manageprofiles...
$ manageprofiles.bat -delete -profileName AppSrv05 INSTCONFSUCCESS: Success: The profile no longer exists. $ manageprofiles -validateAndUpdateRegistry []
Use the manageprofiles interactive utility
The manageprofile command takes many parameters and for complex WebSphere environments it can be difficult to use. There is an interactive tool called Manage Profiles Interactive that guides you through the important manageprofile use cases.
This command is not shipped with the WebSphere package, but it is available to download at no cost.
After we download the tool, unpack its content in...
INSTALL_ROOT/bin
After you unpack it, we can use two scripts to run it:
run_manageprofilesInteractive.sh
Listing profiles using the interactive manageprofiles tool
$ run_manageprofilesInteractive.bat $ CALL "/IBM/WAS/AppServer/bin/setupCmdLine.bat" manageprofilesInteractive-v70 V0.6.6 ~ 2011.05.10/Windows Server 2008 R2 MANAGEPROFILES - Command Menu 1 create 2 augment 3 delete 4 unaugment 5 unaugmentAll 6 deleteAll 7 listProfiles 8 listAugments 9 backupProfile 10 restoreProfile 11 getName 12 getPath 13 validateRegistry 14 validateAndUpdateRegistry 15 getDefaultName 16 setDefaultName 17 response 18 help Select number [press "q" to quit]: 7 listProfiles LISTPROFILES command summary: Press "b" to go back and make changes or "c" to continue: c Press "q" to quit, "r" add to response file, or "c" to run the command: c manageprofiles.bat -listProfiles Added command to /IBM/WAS/AppServer/logs/manageprofilesInteractive.logYou may check /IBM/WAS/AppServer/logs/manageprofiles/listProfiles.log for command status. [Dmgr01, AppSrv01, Custom01, AdminAgent01, JobMgr01, AppSrv02, Dmgr02] Elapse time: 4.954 seconds Done!
After the tool is launched, it prints the available operations. To select the operation, provide the operation number and follow any instructions to execute the command. Notice that this tool can also generate response files for the manageprofile command. The tool also records all invoked commands in a special manageprofilesInteractive.log file.
[6/25/12 6:55 PM] manageprofiles.bat -listProfiles