WebSphere8 控制台管理和wsadmin腳本管理和日誌

WebSphere通過一個Admin服務提供管理功能,既可以通過瀏覽器訪問WebSphere console來管理,也可以通過wsadmin腳本來管理,

WebSphere Console管理方式:

可以通過如下兩種方式訪問WebSphere console:

http://ip地址:9060/ibm/console

https://ip地址:9043/ibm/console

注意:9060和9043是WebSphereconsole默認端口,但是如果集群環境或者用戶自己改動過端口,就使用相應的端口。

wsadmin管理方式:

WebSphere的wsadmin有以下5個對象用於提供管理功能:

Help:提供通用的幫助信息,同時提供當前正在運行的被管理對象動態在線信息。

AdminConfig:用來調用配置命令,創建或更改WebSphere應用服務器的配置。

AdminControl:用來調用操作命令,操作WebSphere應用服務器中正在運行的對象。

AdminApp:用於安裝,修改和管理應用程序。

AdminTask:用於執行管理命令。

WebSphere的wsadmin支持JACL和jython兩種方式,WebSphere推薦使用jython方式:

JACL:

/opt/IBM/WebSphere/AppServer/bin/wsadmin.sh啟動wsadmin,默認使用的的JACL。

$Help help:輸出幫助信息。

$AdminApp list:列出所有已安裝的應用。

$AdminTask listServers:列出WebSphere中的應用服務器,包括Web server和Application server。

$AdminConfig list Cell:列出Cell的配置。

$eixt:退出wsadmin。

jython方式:

/opt/IBM/WebSphere/AppServer/bin/wsadmin.sh-lang jython:以jython方式啟動wsadmin。

print AdminControl.getCell():獲取Cell信息。

print AdminControl.getNode():獲取Node信息。

print AdminControl.help():獲取幫助信息。

printAdminConfig.list(‘JDBCProvider’):列出JDBC驅動提供者。

print AdminConfig.list(‘DataSource’):列出數據源。

安裝應用程序:

AdminApp.install(‘/tmp/HelloWorld.war’,'[ -contextroot /helloworld -nopreCompileJSPs -distributeApp-nouseMetaDataFromBinary -nodeployejb -appname HelloWorld_war-createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn-noprocessEmbeddedConfig -filepermission.*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude-noallowServiceRemoteInclude -MapWebModToVH [[ HelloWorldHelloWorld.war,WEB-INF/web.xml default_host ]]]’ )

AdminConfig.save()

啟動應用程序:

$AdminControl queryNamestype=ApplicationManager,*

$AdminControl invokeWebSphere:name=ApplicationManager,process=server1,platform=dynamicproxy,node=netactNode01,version=8.0.0.0,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=netactNode01Cell,spec=1.0startApplication DefaultApplication

停止應用程序:

$AdminControl queryNamestype=ApplicationManager,*

$AdminControl invokeWebSphere:name=ApplicationManager,process=server1,platform=dynamicproxy,node=netactNode01,version=8.0.0.0,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=netactNode01Cell,spec=1.0stopApplication DefaultApplication

退出wsadmin:exit

啟動HTTP Server兩種方式:

方式1:

/opt/IBM/HTTPServer/bin/adminctlstart

/opt/IBM/HTTPServer/bin/apachectlstart

方式2:

/opt/IBM/HTTPServer/bin/adminctlstart

然後通過WebSphere console啟動Webserver,Servers->Server Types->Web servers,選中WebServer點擊start。

測試HTTP server是否正常啟動,使用瀏覽器訪問:http://ip地址/snoop

 

啟動Application Server:

非集群環境又以下兩種啟動方式:

opt/IBM/WebSphere/AppServer/profiles/<profileName>/bin/startServer.sh<servername>

/opt/IBM/WebSphere/AppServer/bin/startServer.sh<servername> -profilename <profilename>

集群環境中:

/opt/IBM/WebSphere/AppServer/profiles/<DeploymengManagerProfile>/bin/startManager.sh

/opt/IBM/WebSphere/AppServer/profiles/<profileName>/bin/startNode.sh

/opt/IBM/WebSphere/AppServer/profiles/<profileName>/bin/startServer.sh<servername>

或者

/opt/IBM/WebSphere/AppServer/bin/startServer.sh<servername> -profilename <profilename>

測試Application Server啟動:

http://ip地址:9080/snoop

https://ip地址:9443/snoop

 

停止Application server:

非集群環境又以下兩種停止方式:

/opt/IBM/WebSphere/AppServer/profiles/<profileName>/bin/stopServer.sh<servername>

/opt/IBM/WebSphere/AppServer/bin/stopServer.sh<servername> -profilename <profilename>

集群環境中:

/opt/IBM/WebSphere/AppServer/profiles/<DeploymengManagerProfile>/bin/stopManager.sh

/opt/IBM/WebSphere/AppServer/profiles/<profileName>/bin/stopNode.sh

/opt/IBM/WebSphere/AppServer/profiles/<profileName>/bin/stopServer.sh<servername>

或者

/opt/IBM/WebSphere/AppServer/bin/stopServer.sh<servername> -profilename <profilename>

 

WebSphere的常用log:

HTTP服務器日誌:

/opt/IBM/WebSphere/Plugins/logs/webserver1/http_plugin.log

應用服務器日誌:/opt/IBM/WebSphere/AppServer/profiles/<profileName>/logs/<servername>/

SystemOut.log和SystemErr.log:應用服務器JVM日誌。

startServer.log和stopServer.log:應用服務器啟動和停止日誌。

activity.log:歷史事件日誌。

trace.log:輸出的診斷trace。

native_stdout.log和native_stderr.log:應用服務器JVM調用操作系統的底層日誌。

 

以下文章點擊率最高

Loading…

     

如果這文章對你有幫助,請掃左上角微信支付-支付寶,給於打賞,以助博客運營