1. 程式人生 > >04_Weblogic之受管伺服器:配置受管伺服器,啟動受管伺服器,解決因為強制關閉Weblogic之後導致啟動有問題的問題,配置boot.properties

04_Weblogic之受管伺服器:配置受管伺服器,啟動受管伺服器,解決因為強制關閉Weblogic之後導致啟動有問題的問題,配置boot.properties


  1. 配置受管伺服器,

先啟動WebLogic伺服器,啟動方式如下:

  1. WebLogic控制檯中的開發模式”---“鎖定並編輯模式下,點選“Server(伺服器)”然後進行配置。(進入控制檯的方式是在瀏覽器地址中輸入:.

點選登入,然後進入登入頁面。

3 開始配置,暫開“環境”----“伺服器,進入圖形化的介面進行配置:

點選”NEW(新建)”

點選新建後進入如下的介面:

點選下一步

點選“完成”,進入以下介面:

點選定製此表,讓表格中顯示的資訊更全一些。

點選下方的應用,接著就可以看到下面的表格列中顯示了監聽地址列。

點選Customize this table,讓這個表顯示的詳細一些

點選”Apply”,表格變成如下的:

注意:如果沒有寫監聽地址,預設的地址是Linux監聽的本機地址。

4.再建立一臺server,注意Name名稱不能相同。

點選下一步,並完成

這時候還沒有啟用更改,這時候配置資訊時儲存在pending檔案中,使用Notepad開啟Linux上的檔案,所有的配置資訊都是在config目錄裡面,pending目錄只是存沒有啟用的更改。

pending中的config.xml配置檔案的內容:

點選“啟用更新”後,就將pending目錄下的配置檔案儲存到了

config目錄下了.

點選後的效果:

config目錄下的config.xml配置檔案的內容如下:

5 啟動Oracle WebLogic受管伺服器

可以下列方式啟動受管伺服器:

--DOMAIN_DIR/bin/startManagedWebLogic.sh

--weblogic.Server

--WLST和節點管理器

--管理控制檯

----要求每臺計算機上都有節點管理器

----需要進行其它配置。例項:

--- 使用者名稱和口令

--- 監聽埠

--- CLASSPATHJAVA_HOME

--- 安全型別(簡單型別與SSL型別)

注意:啟動的時候要指定要啟動的

Server的名字:

例如:

注意:

一、如果管理伺服器和受管伺服器在同一臺機器上,在執行./startManagedWebLogic.sh Server0的時候後面不用再加上鍊接地址。

二、在生產模式下,啟動受管伺服器需要輸入“自己”設定的管理伺服器使用者名稱密碼。截圖如下:

好久沒使用weblogic,使用命令(./startManagedWebLogic.sh Server2)啟動weblogic的受管服務Server2時報錯,好像是說我輸入的使用者許可權問題。

奇怪的是,剛剛輸入的使用者名稱和密碼登入weblogic的控制檯,卻可以正常登入。執行上面的命令時,輸入那個使用者名稱和密碼,就是不能啟動那個服務。懷疑是受管服務本身的問題,刪除了重新建,還是報一樣的錯誤。

解決辦法是:

刪除了原來的受管服務,新建了受管服務Server2,並按以下命令方式啟動服務:

(注意:startManagedWebLogic.shwindows目錄下的wlsserver_10.3/common/bin目錄下也有這個檔案。)

其中後面是我的管理伺服器端的IP及埠。可以正常啟動,並在servers目錄下生成了以受管服務Server2命令的目錄,進入該目錄並新建security目錄,進入security目錄,建立boot.properties檔案,輸入如下資訊(注意:這裡的使用者名稱和密碼和管理伺服器的相同)

username=weblogic

password=toto123456

儲存後退出。使用上面的命令重啟受管服務時,不再要求輸入使用者及密碼。

 

不需要輸入使用者名稱和祕密後,就可以使用nohup後臺啟動服務了

nohup sh bin/startManagedWebLogic.sh Server2 http://192.168.6.25:7001/ &

非後臺啟動的效果圖如下:

在瀏覽器中控制檯中的狀態是:

6、如果出現以下問題:

問題截圖如下:

解決辦法是:

Follow the following steps:  

1: remove the boot.properties file completely from the managed server directory.  

2: remove the ManagedServerDir/data/ldap directory completely.  

3: Always keep backup of files before removing it.  

4: Now try to start the server from the command prompt and provide the username/password used to login to the Admin Console.  

./startManagedWebLogic.sh Server0 http://192.168.6.25:7001

7.有時候因為強制關閉伺服器,會出現一些問題,問題現象是:

15-5-23 下午022258 CST><Info> <Management> <BEA-141281> <unable to get file lock,will retry ...>

網友的解決辦法是(我已試過,可以解決問題):

A-141281> <unable to get file lock, will retry ...>  
http://gdutlzh.blog.163.com/blog/static/164746951201291903824812/

I ran into this error the first time I restarted Weblogic on one of my installs, the only reference that I was able to find is the error description below:

BEA-141281

Info: unable to get file lock, will retry …

Description

This message indicates that WLS can not get file lock because other process still holds the lock. W LS will try again before timeout.
Cause

This is an information-level message only.
Action

If WLS fails to start due to unable to get file lock, then lock files need to be removed manually before restart WLS.
The funny thing is that it tells you to remove the locks but doesn’t provide their location, if you are running OBIEE 11g you can remove AdminServer.lok from:

d:\oracle\fmw\user_projects\domains\bifoundation_domain\servers\AdminServer\tmp


If you are not using Weblogic in the context of Oracle Busines Intelligence you can do a file search for any lok files under your middleware home (d:\oracle\fmw).
------------------------------------------------
概述由於先前伺服器直接down掉了,所有程序都非正常的進行關閉了,也就導致了下次啟動weblogic的時候報了以下錯誤:
<2012-3-2
下午050834 CST> <Info> <Management> <BEA-141281> <unable to get file lock, will retry …> 
<2012-3-2
下午050844
CST> <Info> <Management> <BEA-141281> <unable to get file lock, will retry …>
解決辦法
.刪掉Domain下的*.lok檔案
1.
刪除edit.lok
進入到domain_home下:

cd /u01/Oracle/Middleware/user_projects/domains/idm_domain
edit.lok檔案刪掉
rm edit.lok
2.
刪除config.lok
進入到domain_home/config下:

cd /u01/Oracle/Middleware/user_projects/domains/idm_domain/config/
config.lok檔案刪掉

rm config.lok

3.
刪除AdminServer.lok

cd /u01/Oracle/Middleware/user_projects/domains/idm_domain/servers/AdminServer/tmp

rm AdminServer.lok

4.
刪除
EmbeddedLDAP.lok

/u01/Oracle/Middleware/user_projects/domains/idm_domain/servers/AdminServer/data/ldap/ldapfiles

rm EmbeddedLDAP.lok

.刪掉Domain下的*.DAT檔案:
進入到domain_home當中

cd /u01/Oracle/Middleware/user_projects/domains/idm_domain

找到檔案刪掉

[oracle@idm idm_domain]$ find servers/ -name "*.DAT" 
servers/AdminServer/data/store/diagnostics/WLS_DIAGNOSTICS000000.DAT 
servers/AdminServer/data/store/default/_WLS_ADMINSERVER000000.DAT

重新啟動weblogic,搞定!

8受管伺服器在啟動的時候會從管理伺服器上下載一些配置資訊.

9WebLogic的工作目錄是:

/root/Oracle/Middleware/user_projects/domains/base_domain/servers

10、啟動受管伺服器的時候可以建立引導標識檔案

DOMAIN_NAME/servers/<server_name>/security目錄中建立一個名為boot.properties的檔案,其中包含下列兩行:

username=username

password=password

第一次啟動伺服器時,伺服器會讀取引導標識檔案並以使用者名稱和口令的加密版本覆蓋該檔案。(上面寫的是明文,當啟動受管伺服器啟動之後,boot.properties檔案中使用者名稱和密碼就被重新加密了,要注意的是,這個檔案檔案不能拷貝到其它受管伺服器上的相應目錄下。)

此後,伺服器將在後續啟動週期中記住該身份證明。

配置方式在上文中已說明。

11.通過控制檯遠端關閉一個伺服器:

點選[鎖定並編輯]à[伺服器]-à點選受管伺服器。

控制面板下面有以下列表:可以關閉伺服器和強制關閉伺服器。