利用命令的方式在服務器節點1查看當前已經創建的DM和Node,然後刪除DM和節點,再重新創建DM、Node;
如下圖所示
cd $WAS_HOME\bin
查看當前的DM、Node
./manageprofiles.sh -listProfiles
刪除profile
./manageprofiles.sh -delete -profileName AppSrv01
./manageprofiles.sh -delete -profileName Dmgr01
創建新profile前,需要刪除文件夾!!!
利用模板創建profile dmgr
./manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/dmgr -profileName Dmgr01 -profilePath /opt/IBM/WebSphere/AppServer/profiles/Dmgr01
利用模板創建profile server
./manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default -profileName AppSrv01 -profilePath /opt/IBM/WebSphere/AppServer/profiles/AppSrv01
利用模板創建NODE1
./manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/managed -profileName AppSrv01 -profilePath /opt/IBM/WebSphere/AppServer/profiles/node1
在服務器節點2和3上查看、刪除原有的Profiles,然後創建新的Profiles(這兩個節點只創建應用服務器);
查看當前的Node
manageprofiles.bat -listProfiles
刪除profile
manageprofiles.bat -delete -profileName AppSrv01
利用模板創建profile server
d:\IBM\WebSphere\AppServer\profiles\AppSrv01\bin
manageprofiles.bat -create -templatePath d:\IBM\WebSphere\AppServer\profileTemplates\default -profileName AppSrv01 -profilePath d:\IBM\WebSphere\AppServer\profiles\AppSrv01
同理進入管理控制檯刪除默認的server
manageprofiles 此命令在 websphere Application Server Network Deployment v6.1之上纔有,之前的版本採用的命令爲wasprofile.sh,這個需要特別注意。。
在Unix的機器上(包括AIX、HPUX)安裝websphere64位的話,想要建立Profile是沒有圖形化界面的,需要使用manageprofiles命令,下面就詳細描述一下如何使用這個命令。
1、建立DM的profile,使用的模版在{install_root}/profileTemplates/dmgr下
句法爲:
manageprofile.sh -create –templatePath {install_root}/profileTemplates/dmgr
調用參數爲:
-create 建立一個profile. (必選)
-templatePath 指定使用模版的路徑. (必選) 建立DM的路徑爲{install_root}/profileTemplates/dmgr
-profileName 指定profile的名字. (可選)
-profilePath 指定proflile需要建立的路徑. (可選)
-hostName 指定profile對應的主機名稱. (可選)
-nodeName 指定profile對應的node的名稱. 此名稱必須在同一cell中唯一. (可選)
-cellName 指定profile對應的cell的名稱. 每一個profile的cell名稱必須唯一. (可選)
-isDefault 講此profile指定爲缺省的profile,在運行命令期間不需要使用profileName的參數. (可選)
-omitAction 附加條件. (可選)
-adminUserName 在指定administrative security選項後的管理員名稱. (可選)
-adminPassword 在指定administrative security選項後的管理員密碼. (可選)
-portsFile 指定profile的端口設定文件. 此參數和-startingPort或-defaultPorts參數衝突. (可選)
-startingPort 制度建立profile是的所有的端口的起始的端口號. 同-portsFile或者-defaultPorts參數衝突. (可選)
-defaultPorts 對新建立的profile使用缺省的端口號. 同-portsFile 或 -startingPort 參數衝突. (可選)
-validatePorts 進行端口號驗證,保證使用的端口號沒有已經被用或者被保留. (可選)
-enableAdminSecurity 新建立的profile使用用戶密碼方式認證,使用此參數後面跟 true. (可選)
-enableService 作爲Linux的service使用,使用此參數後面跟 true. (可選)
-serviceUserName 指定作爲service使用時的用戶. (可選)
-webServerType 指定Web server的類型. (可選)
-webServerOS 指定Web server的操作系統的類型. (可選)
例子:
export WAS_HOME=d:\IBM
export PRO_HOME=d:\IBM\WebSphere\AppServer\profiles
以上指定websphere的安裝路徑和profile的路徑,或者輸入命令時替換
manageprofiles.sh -create \
-templatePath $WAS_HOME/profileTemplates/dmgr \
-profilePath $PRO_HOME/Dmgr01 \
-nodeName "nodename" \
-cellName "cell name" \
-enableAdminSecurity true \
-adminUserName wasadmin \
-adminPassword password \
-profileName Dmgr01 \
-hostName `hostname` \
2、建立custom的profile,使用的模版爲{install_root}/profileTemplates/managed
句法爲:
manageprofile.sh -create -templatePath {install_root}/profileTemplates/managed
調用參數同上:
要聯合到DM的例子
manageprofiles.sh -create \
-templatePath $WAS_HOME/profileTemplates/managed \
-profileName AppSrv01 \
-profilePath $PRO_HOME/AppSrv01 \
-nodeName test01 \
-hostName `hostname` \
-cellName test1 \
-dmgrHost 192.168.1.100 \
-dmgrPort 8879 \
-dmgrAdminPassword password \
-dmgrAdminUserName wasadmin
不用聯合到DM,而後用addNode.sh聯合的例子
manageprofiles.sh -create \
-templatePath $WAS_HOME/profileTemplates/managed \
-profilePath $PRO_HOME/AppSrv02 \
-nodeName test02 \
-cellName test2 \
-profileName AppSrv02 \
-hostName `hostname`
addNode.sh 192.168.1.100:8879 -username wasadmin -password password
3、建立appsrv的profile,使用的模版在install_root/profileTemplates/default
句法爲:
manageprofile.sh -create -templatePath install_root/profileTemplates/default
調用參數同上:例子麼也就那樣
4、對於集羣來說,建立DM profile,然後建立多個custom的profile,addNode進去即可。或者把現有的app profile addNode到DM的概要文件中,然後通過克隆建立集羣。