Hay más de 125 archivos de scripts de shell incluidos en IBM WebSphere Application Server (WAS) cuando lo instala.
No todos son útiles, y si es un aprendiz, es posible que no conozca algunos de los poderosos scripts para usar en el trabajo diario.
He enumerado algunos de los scripts más útiles para facilitarle la vida como administrador de WebSphere.
Los siguientes scripts se prueban en el entorno IBM WAS ND 8.5.5 y no ven ninguna razón por la que no funcionen en ningún otro entorno.
Tabla de contenido
Detención e inicio del administrador de implementación, agente de nodo y JVM
stopManager.sh
Puede detener el Administrador de implementación usando el comando anterior.
[[email protected] bin]# ./stopManager.sh ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/stopServer.log ADMU0128I: Starting tool with the Dmgr01 profile ADMU3100I: Reading configuration for server: dmgr ADMU3201I: Server stop request issued. Waiting for stop status. ADMU4000I: Server dmgr stop completed. [[email protected] bin]#
Nota: esto debe ejecutarse en la ruta del perfil DMGR.
startManager.sh
Puede iniciar el Administrador de implementación usando el comando anterior.
[[email protected] bin]# ./startManager.sh ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/startServer.log ADMU0128I: Starting tool with the Dmgr01 profile ADMU3100I: Reading configuration for server: dmgr ADMU3200I: Server launched. Waiting for initialization status. ADMU3000I: Server dmgr open for e-business; process id is 9183 [[email protected] bin]#
Nota: esto debe ejecutarse en la ruta del perfil DMGR.
iniciarServidor.sh
Para iniciar la JVM, puede usar startServer.sh con el nombre del servidor como se muestra a continuación.
[[email protected] bin]# ./startServer.sh server1 ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU3100I: Reading configuration for server: server1 ADMU3200I: Server launched. Waiting for initialization status. ADMU3000I: Server server1 open for e-business; process id is 10633 [[email protected] bin]#
Nota: El agente de nodo debe iniciarse antes de iniciar JVM.
detenerServidor.sh
Puede apagar JVM ejecutando el comando anterior junto con el nombre de JVM.
[[email protected] bin]# ./stopServer.sh server1 ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU3100I: Reading configuration for server: server1 ADMU3201I: Server stop request issued. Waiting for stop status. ADMU4000I: Server server1 stop completed. [[email protected] bin]#
detenerNodo.sh
Para detener el agente de nodo respectivo, debe ir a ese perfil y ejecutar stopNode.sh para detener el agente de nodo.
[[email protected] bin]# ./stopNode.sh ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/stopServer.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU3100I: Reading configuration for server: nodeagent ADMU3201I: Server stop request issued. Waiting for stop status. ADMU4000I: Server nodeagent stop completed. [[email protected] bin]#
startNode.sh
Vaya al perfil respectivo y ejecute startNode.sh para iniciar el Agente de nodo.
[[email protected] bin]# ./startNode.sh ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/startServer.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU3100I: Reading configuration for server: nodeagent ADMU3200I: Server launched. Waiting for initialization status. ADMU3000I: Server nodeagent open for e-business; process id is 11363 [[email protected] bin]#
serverStatus.sh
Para averiguar el estado de JVM, puede usar este script con el argumento –all.
Esto debe ejecutarse en el nivel de perfil respectivo. Si ejecuta esto en el nivel de perfil de DMGR, solo mostrará el estado de DMGR.
[[email protected] bin]# ./serverStatus.sh -all ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/serverStatus.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU0503I: Retrieving server status for all servers ADMU0505I: Servers found in configuration: ADMU0506I: Server name: nodeagent ADMU0506I: Server name: server1 ADMU0508I: The Node Agent "nodeagent" is STARTED ADMU0508I: The Application Server "server1" is STARTED [[email protected] bin]#
Copia de seguridad de restauracion
backupConfig.sh
Una de las primeras cosas que debe aprender mientras trabaja en el soporte de producción es cómo realizar una copia de seguridad. Cuando nada funciona, la copia de seguridad ayuda.
Puede utilizar este script para realizar una copia de seguridad de la configuración de su entorno WebSphere. Como práctica recomendada, puede usar el argumento “–nostop”, por lo que realiza una copia de seguridad sin detener Deployment Manager.
[[email protected] bin]# ./backupConfig.sh -nostop ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/backupConfig.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU5001I: Backing up config directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config to file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/WebSphereConfig_2015-04-12.zip .................................................................................................................................................................................................................................................................... ADMU5002I: 933 files successfully backed up [[email protected] bin]#
restaurarConfig.sh
Si ha cambiado la configuración y las cosas no son como esperaba y hay un tiempo para restaurar su configuración. Bueno, puede usar el archivo de copia de seguridad para restaurar la configuración.
[[email protected] bin]# ./restoreConfig.sh WebSphereConfig_2015-04-12.zip -nostop ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/restoreConfig.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU5502I: The directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config already exists; renaming to /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config.old ADMU5504I: Restore location successfully renamed ADMU5505I: Restoring file WebSphereConfig_2015-04-12.zip to location /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config ......................................................................................................................................................................... ADMU5506I: 933 files successfully restored ADMU6001I: Begin App Preparation - ADMU6009I: Processing complete. ADMU6002I: Begin Asset Preparation - ADMU6009I: Processing complete. [[email protected] bin]#
¿Qué te parece hasta ahora? ¡Desplázate hacia abajo para más diversión!
Obtener información sobre la versión y el fixpack
versionInfo.sh
Para averiguar la versión WAS, el nivel de compilación, el paquete, la arquitectura y las características instaladas en su servidor.
[[email protected] bin]# ./versionInfo.sh WVER0010I: Copyright (c) IBM Corporation 2002, 2012; All rights reserved. WVER0012I: VersionInfo reporter version 1.15.1.48, dated 2/8/12 -------------------------------------------------------------------------------- IBM WebSphere Product Installation Status Report -------------------------------------------------------------------------------- Report at date and time April 12, 2015 3:18:41 AM PDT Installation -------------------------------------------------------------------------------- Product Directory /opt/IBM/WebSphere/AppServer Version Directory /opt/IBM/WebSphere/AppServer/properties/version DTD Directory /opt/IBM/WebSphere/AppServer/properties/version/dtd Log Directory /var/ibm/InstallationManager/logs Product List -------------------------------------------------------------------------------- NDTRIAL installed Installed Product -------------------------------------------------------------------------------- Name IBM WebSphere Application Server Network Deployment Version 8.5.5.0 ID NDTRIAL Build Level gm1319.01 Build Date 5/14/13 Package com.ibm.websphere.NDTRIAL.v85_8.5.5000.20130514_1044 Architecture x86-64 (64 bit) Installed Features IBM 64-bit WebSphere SDK for Java WebSphere Application Server Full Profile EJBDeploy tool for pre-EJB 3.0 modules Embeddable EJB container Stand-alone thin clients and resource adapters -------------------------------------------------------------------------------- End Installation Status Report -------------------------------------------------------------------------------- [[email protected] bin]#
Nota: puede estar interesado en seguir los argumentos admitidos.
- -fixpacks: para mostrar información de fixpacks
- -largo: para mostrar todos los fixpacks e ifixes
- -ifixes: para mostrar información de ifixes
getHistoryReport.sh
Si está realizando una auditoría o simplemente desea enumerar componentes, correcciones, paquete de actualización con fechas, puede ejecutar este comando, que generará historyReport.html en el directorio de trabajo actual, que generalmente es la carpeta bin.
getVersionReport.sh
Para mostrar la versión de compilación y la fecha de compilación de la instalación de WebSphere. A menudo, los chicos de soporte de IBM les piden que investiguen si hay algún problema sospechoso con una versión en particular.
Limpiando el caché
Puede haber varias razones para borrar el caché, la más obvia sería después de una actualización. Hay dos cachés que debería considerar borrar 1) JVM 2) OSGi.
clearClassCache.sh
Para borrar el caché de clase de JVM, puede ejecutar el script anterior.
Nota: las JVM deben detenerse antes de borrar las cachés de clases.
osgiCfgInit.sh
Ejecute el comando anterior para borrar el perfil OSGi y la memoria caché del servidor.
[[email protected] bin]# ./osgiCfgInit.sh OSGi profile cache successfully cleaned for /opt/IBM/WebSphere/AppServer/profiles/Dmgr01. OSGi server cache successfully cleaned for /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/servers/dmgr. [[email protected] bin]#
Nota: no olvide detener los procesos en ejecución antes de borrar los cachés.
Gestión de perfiles
administradk.sh
Puede alternar la versión si ha instalado varios SDK. También puede usar este script para averiguar el SDK asociado disponible para su perfil. El siguiente ejemplo muestra una lista de SDK disponibles.
[[email protected] bin]# ./managesdk.sh -listAvailable CWSDK1003I: Available SDKs : CWSDK1005I: SDK name: 1.6_64 CWSDK1001I: Successfully performed the requested managesdk task. [[email protected] bin]#
pmt.sh
PMT (herramienta de gestión de perfiles) se puede utilizar para crear perfiles de WebSphere en modo GUI. Crear perfiles usando PMT es muy fácil: todo lo que tiene que hacer es crear el nivel de perfil deseado y seguir el asistente. ¡Tienes que probarlo!
syncNode.sh
Por alguna razón, si no puede realizar la sincronización de nodos a través de la Consola de administración, puede usar syncNode.sh desde el nivel de perfil. Node Agent debe detenerse antes de usar este script.
Debe pasar un argumento para el host DMGR y el número de puerto SOAP.
[[email protected] bin]# ./syncNode.sh localhost 8879 ADMU0116I: Tool information is being logged in file /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/syncNode.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU0401I: Begin syncNode operation for node localhostNode01 with Deployment Manager localhost: 8879 ADMU0016I: Synchronizing configuration between node and cell. ADMU0402I: The configuration for node localhostNode01 has been synchronized with Deployment Manager localhost: 8879 [[email protected] bin]#
- localhost = nombre de host del administrador de implementación
- 8879 = Número de puerto SOAP de DMGR
Espero que los guiones anteriores sean útiles para su trabajo diario. Lleve su carrera a un nivel superior aprendiendo computación en la nube.