Menu

8 Ocak 2013 Salı

Weblogic Node Manager

    Merhaba, bu makalemizde weblogic yazi dizimizin devami olan Node Manager nedir, nasil kurulur ve nasil kullanilir bunu goruyor olacagiz.
  
1.  Node Manager nedir. 
    Once sunu belirmeliyim ki, Node Manager weblogic serveri urun(production) ortaminda zorunlu degildir. Yani Node manager olmadan,  weblogic server`inizi, admin server, managed server ve cluster`larinizi yonetebilirsiniz. Peki, Node Manager olmadan, biz bunlari yapabiliyorsak Node Manager`a neden ihtiyac duyuyoruz.? diye bir soru akillara gelecektir. 
Bunu ornekle aciklayalim.
  Dusunun ki, Weblogic Serverimiz ve bunun icinde birden fazla domain ve machine`lar var ve bunlarda ayri ayri lokasyonlarda, bu durumda bunlari idare etmemiz, bu domainle iliskili olan Admin Server ve Managed Servleri nasil start, stop ve monitor etmek zor bir durum olacaktir. Iste bu noktada Node Manager aklimiza geliyor. Hatirlayalim, Node Manager, fiziksel makine uzerinde calisan bir processdir. Bize uzakdan Admin server, Managed Server`larimizi start, stop ve monitor etmemize yarar. 
  Node Manager, spesifik bir domain ile iliskili degildir, fiziksel bir makine ile iliskilidir. Ve machine logical bir yapidir.

Yukaridaki sekilde WLST kullanarak Node Manager`a baglandikdan sonra Serverlarin yonetilmesini gosterir

2. Node Manager nasil kurulur.
 Node Manager, iki sekilde kullanilabilir. Java-based ve Script based.
 Guvenlik acisindan Node Manager`i java-based olarak kullanmak script based`dan daha guvenlidir. Bu makalemizde, daha anlasilir olmasi acisindan script tabanli olacaktir.
 a. Oncelikle Admin console acarak, Environmets -> Machines -> bolumunden machine yoksa, yeni bir nachine olusturup, bu machine uzerinde node manager olustururak servlerimizi yonetecez.


 Save diyerek, Node Manager`imizi olusturuyoruz.

3. Nasil Kullanilir.
  Yukarida Node Manager`in ne oldugundan bahsettikden, daha sonra, nasil olusturulacagini gorduk, simdide nasil kullanicagimizi ve Admin ve managed serverlerimizi nasil start, stop ve monitor edecegimizi gorecegiz.
- Ortam degiskenlerimizi set ediyoruz.
    /u01/app/oracle/Middleware/wlserver_12.1/bin/setWLSEnv.cmd    
- WLST baslatiyoruz.
java weblogic.WLST
-   Node Manager`i baslatiyoruz.
startNodeManager(verbose='true', NodeManagerHome='/u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/', ListenPort='5556', ListenAddress='localhost')
- Node Manager`a baglaniyoruz.
nmConnect('weblogic','wadmin12','localhost','5556','lab_domain','/u01/app/oracle/Middleware/user_projects/domains/lab_domain/','ssl') 
- Admin server eklenmesi icin, boot.properties dosyasini ekliyoruz.

/u01/app/oracle/Middleware/user_projects/domains/lab_domain/servers/AdminServer/security/ 
   boot.properties
   
Bu dosyayi, /u01/app/oracle/Middleware/user_projects/domains/lab_domain/servers/AdminServer/security/
altindan kopyalayip ekleyebiliriz.

- connect('weblogic','wadmin12','t3://localhost:7001')
- Admin Server`i start etmek icin,
nmStart('AdminServer')
-  Admin Server statusunu ogrenmek icin
nmServerStatus('AdminServer')
- Admin Server`i durdurmak icin
nmKill('AdminServer')
- Managed serverlarida ayni Admin Server gibi start, stop edebiliriz.
 nmStart('j2eeServer')
 nmStart('portalServer')
 nmKill('j2eeServer')
- Node Manager`i start ve stop etmek icin
startNodeManager()
stopNodeManager() 
 - Admin consol uzerinde, machine inactive veya unreachable olarak gorunurse, asagidakini eklememiz gerekmektedir.  
   nmEnroll('/u01/app/oracle/Middleware/user_projects/domains/lab_domain/','/u01/app/oracle/Middleware/wlserver_12.1/common/')

Ornek bir demo yaparsak;


[ertugrula@easlan ~]$ cd /u01/app/oracle/Middleware/wlserver_12.1/common/bin/
[ertugrula@easlan bin]$ ./wlst.sh 
CLASSPATH=/u01/app/oracle/Middleware/patch_wls1211/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/Middleware/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/java/jdk1.7.0_07/lib/tools.jar:/u01/app/oracle/Middleware/wlserver_12.1/server/lib/weblogic_sp.jar:/u01/app/oracle/Middleware/wlserver_12.1/server/lib/weblogic.jar:/u01/app/oracle/Middleware/modules/features/weblogic.server.modules_12.1.1.0.jar:/u01/app/oracle/Middleware/wlserver_12.1/server/lib/webservices.jar:/u01/app/oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/u01/app/oracle/Middleware/utils/config/10.3/config-launch.jar::/u01/app/oracle/Middleware/wlserver_12.1/common/derby/lib/derbynet.jar:/u01/app/oracle/Middleware/wlserver_12.1/common/derby/lib/derbyclient.jar:/u01/app/oracle/Middleware/wlserver_12.1/common/derby/lib/derbytools.jar::

Initializing WebLogic Scripting Tool (WLST) ...


Welcome to WebLogic Server Administration Scripting Shell


Type help() for help on available commands


wls:/offline> startNodeManager(verbose='true', NodeManagerHome='/u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/', ListenPort='5556', ListenAddress='localhost')

Launching NodeManager ... 
 Properties: {ListenAddress=localhost,ListenPort=5556,NodeManagerHome=/u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/,} 
 Command: /usr/java/jdk1.7.0_07/jre/bin/java -classpath /usr/java/jdk1.7.0_07/jre/lib/rt.jar:/usr/java/jdk1.7.0_07/jre/lib/i18n.jar:/u01/app/oracle/Middleware/patch_wls1211/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/Middleware/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/java/jdk1.7.0_07/lib/tools.jar:/u01/app/oracle/Middleware/wlserver_12.1/server/lib/weblogic_sp.jar:/u01/app/oracle/Middleware/wlserver_12.1/server/lib/weblogic.jar:/u01/app/oracle/Middleware/modules/features/weblogic.server.modules_12.1.1.0.jar:/u01/app/oracle/Middleware/wlserver_12.1/server/lib/webservices.jar:/u01/app/oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/u01/app/oracle/Middleware/utils/config/10.3/config-launch.jar:/u01/app/oracle/Middleware/wlserver_12.1/common/derby/lib/derbynet.jar:/u01/app/oracle/Middleware/wlserver_12.1/common/derby/lib/derbyclient.jar:/u01/app/oracle/Middleware/wlserver_12.1/common/derby/lib/derbytools.jar weblogic.NodeManager -v
NMProcess:
NMProcess: Jan 08, 2013 4:18:01 PM weblogic.nodemanager.server.NMServerConfig initDomainsMap
NMProcess: INFO: Loading domains file: /u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/nodemanager.domains
NMProcess:
NMProcess: Jan 08, 2013 4:18:02 PM weblogic.nodemanager.server.SSLConfig loadKeyStoreConfig
NMProcess: INFO: Loading identity key store: FileName=/u01/app/oracle/Middleware/wlserver_12.1/server/lib/DemoIdentity.jks, Type=jks, PassPhraseUsed=true
NMProcess:
NMProcess: Jan 08, 2013 4:18:02 PM weblogic.nodemanager.server.NMServer
NMProcess: INFO: Loaded node manager configuration properties from '/u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/nodemanager.properties'
NMProcess: Node manager v10.3
NMProcess: 
NMProcess: Configuration settings:
NMProcess: 
NMProcess: NodeManagerHome=/u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/
NMProcess: ListenAddress=localhost
NMProcess: ListenPort=5556
NMProcess: ListenBacklog=50
NMProcess: SecureListener=true
NMProcess: AuthenticationEnabled=true
NMProcess: NativeVersionEnabled=true
NMProcess: CrashRecoveryEnabled=false
NMProcess: JavaHome=/usr/java/jdk1.7.0_07/jre
NMProcess: StartScriptEnabled=true
NMProcess: StopScriptEnabled=false
NMProcess: StartScriptName=startWebLogic.sh
NMProcess: StopScriptName=
NMProcess: LogFile=/u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/nodemanager.log
NMProcess: LogLevel=INFO
NMProcess: LogLimit=0
NMProcess: LogCount=1
NMProcess: LogAppend=true
NMProcess: LogToStderr=true
NMProcess: LogFormatter=weblogic.nodemanager.server.LogFormatter
NMProcess: DomainsFile=/u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager/nodemanager.domains
NMProcess: DomainsFileEnabled=true
NMProcess: StateCheckInterval=500
NMProcess: QuitEnabled=true
NMProcess: UseMACBroadcast=false
NMProcess: DomainRegistrationEnabled=false
NMProcess: DomainsDirRemoteSharingEnabled=false
NMProcess: 
NMProcess: Domain name mappings:
NMProcess: 
NMProcess: lab_domain -> /u01/app/oracle/Middleware/user_projects/domains/lab_domain
NMProcess: 
NMProcess:
NMProcess: Jan 08, 2013 4:18:02 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Startup configuration properties loaded from "/u01/app/oracle/Middleware/user_projects/domains/lab_domain/servers/portalServer/data/nodemanager/startup.properties"
NMProcess:
NMProcess: Jan 08, 2013 4:18:03 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Resume monitoring of active server process (pid = 23650)
NMProcess: < Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@4260904e : with config : weblogic.nodemanager.common.StartupConfig@51a212ed>
NMProcess: Jan 08, 2013 4:18:03 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO:  Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@4260904e : with config : weblogic.nodemanager.common.StartupConfig@51a212ed
NMProcess:
NMProcess: Jan 08, 2013 4:18:03 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Resume monitoring of active server process (pid = 21293)
NMProcess: < Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@572c4a12 : with config : weblogic.nodemanager.common.StartupConfig@1cb31074>
NMProcess: Jan 08, 2013 4:18:03 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO:  Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@572c4a12 : with config : weblogic.nodemanager.common.StartupConfig@1cb31074
NMProcess:
NMProcess: Jan 08, 2013 4:18:03 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Startup configuration properties loaded from "/u01/app/oracle/Middleware/user_projects/domains/lab_domain/servers/j2eeServer/data/nodemanager/startup.properties"
NMProcess:
NMProcess: Jan 08, 2013 4:18:03 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Resume monitoring of active server process (pid = 23510)
NMProcess: < Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@1b0b2fd9 : with config : weblogic.nodemanager.common.StartupConfig@7b725d6d>
NMProcess: Jan 08, 2013 4:18:03 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO:  Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@1b0b2fd9 : with config : weblogic.nodemanager.common.StartupConfig@7b725d6d
NMProcess:
NMProcess: Jan 08, 2013 4:18:04 PM weblogic.nodemanager.server.SSLListener run
NMProcess: INFO: Secure socket listener started on port 5556, host localhost/127.0.0.1
Successfully launched the Node Manager.
The Node Manager process is running independent of the WLST process.
Exiting WLST will not stop the Node Manager process. Please refer 
to the Node Manager logs for more information.
The Node Manager logs will be under /u01/app/oracle/Middleware/wlserver_12.1/common/nodemanager
Node Manager starting in the background
wls:/offline> 
wls:/offline> 
wls:/offline> nmConnect('weblogic','wadmin12','localhost','5556','lab_domain','/u01/app/oracle/Middleware/user_projects/domains/lab_domain/','ssl')
Connecting to Node Manager ...
 
 
Successfully Connected to Node Manager.
wls:/nm/lab_domain> 
wls:/nm/lab_domain> 
wls:/nm/lab_domain> connect('weblogic','wadmin12','t3://localhost:7001')
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'lab_domain'.

Warning: An insecure protocol was used to connect to the 

server. To ensure on-the-wire security, the SSL port or 
Admin port should be used instead.

wls:/lab_domain/serverConfig> 

wls:/lab_domain/serverConfig> 
wls:/lab_domain/serverConfig> nmKill('AdminServer')
Killing server AdminServer ...
WLST lost connection to the WebLogic Server that you were 
connected to, this may happen if the server was shutdown or 
partitioned. You will have to re-connect to the server once the 
server is available.
Disconnected from weblogic server: AdminServer
NMProcess:
NMProcess: Jan 08, 2013 4:19:05 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Server was killed
Successfully killed server AdminServer ...
wls:/nm/lab_domain> nmStart('AdminServer')
Starting server AdminServer ...
NMProcess:
NMProcess: Jan 08, 2013 4:19:13 PM weblogic.nodemanager.server.LogFileRotationUtil log
NMProcess: INFO: Rotated server output log to "/u01/app/oracle/Middleware/user_projects/domains/lab_domain/servers/AdminServer/logs/AdminServer.out00005"
NMProcess:
NMProcess: Jan 08, 2013 4:19:13 PM weblogic.nodemanager.server.LogFileRotationUtil log
NMProcess: INFO: Server error log also redirected to server log
NMProcess:
NMProcess: Jan 08, 2013 4:19:13 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Starting WebLogic server with command line: /u01/app/oracle/Middleware/user_projects/domains/lab_domain/bin/startWebLogic.sh 
NMProcess:
NMProcess: Jan 08, 2013 4:19:13 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Working directory is '/u01/app/oracle/Middleware/user_projects/domains/lab_domain'
NMProcess:
NMProcess: Jan 08, 2013 4:19:13 PM weblogic.nodemanager.server.AbstractServerManager log
NMProcess: INFO: Server output log file is '/u01/app/oracle/Middleware/user_projects/domains/lab_domain/servers/AdminServer/logs/AdminServer.out'
Successfully started server AdminServer ...
wls:/nm/lab_domain> 
wls:/nm/lab_domain> 
wls:/nm/lab_domain> 
wls:/nm/lab_domain> help()

WLST is a command line scripting tool to configure and administer WebLogic Server. Try:


    help('all')              List all WLST commands available.

    help('browse')           List commands for browsing the hierarchy.
    help('common')           List the most commonly used commands.
    help('control')          List commands for controlling the domain/server.
    help('deployment')       List commands for deploying applications.
    help('diagnostics')      List commands for performing diagnostics.
    help('editing')          List commands for editing the configuration.
    help('information')      List commands for displaying information.
    help('lifecycle')        List commands for managing life cycle.
    help('nodemanager')      List commands for using Node Manager.
    help('offline')          List all offline commands available.
    help('online')           List all online commands available.
    help('storeadmin')       List all store admin commands.
    help('trees')            List commands use to navigate MBean hierarchy.
    help('variables')        List all global variables available.

wls:/nm/lab_domain> help('nodemanager')


Use Node Manager.

    help('nm')                  Determine whether WLST is connected to Node Manager.
    help('nmConnect')           Connect WLST to Node Manager.
    help('nmDisconnect')        Disconnect WLST from a Node Manager session.
    help('nmEnroll')            Enroll the machine with Node Manager.
    help('nmGenBootStartupProps')   Generate boot and startup properties
    help('nmKill')              Kill the specified server instance.
    help('nmLog')               Return the Node Manager log.
    help('nmServerLog')         Return the server output log.
    help('nmServerStatus')      Return the status of the server.
    help('nmStart')             Start a server using Node Manager.
    help('nmVersion')           Return the Node Manager server version.
    help('startNodeManager')    Start Node Manager.
    help('stopNodeManager')     Stop Node Manager.

wls:/nm/lab_domain> exit()

Exiting WebLogic Scripting Tool.
[ertugrula@easlan bin]$ 

7 yorum:

  1. Hello! Ѕomeone in my Mуspaсe gгoup
    shaгеԁ this websitе with us so I сamе to cheсk
    іt οut. I'm definitely enjoying the information. I'm bookmaгking and ωill
    bе tweеting this to my followers!
    Supeгb blog and brilliant stуlе and design.


    Αlso viѕit my homeρаgе -
    http://www.elephantconveyorbelt.com/blog/2012/02/steel-cord-conveyor-belt/

    YanıtlaSil
  2. Just want to say your aгticle is as amаzing.
    The clеarness for your publіsh is just nice and that і cоuld think you're an expert on this subject. Well together with your permission let me to take hold of your feed to stay up to date with imminent post. Thank you a million and please continue the rewarding work.

    Here is my webpage; Fazer Site

    YanıtlaSil
  3. Simplу wish to ѕay your artiсle is as аmazing.

    The cleaгness to уour publish is јust сool and i can suppose you are a professional in thіs
    subject. Fіne ωith уour permiѕsion allow me
    to grаb your RЅS feed to stay up to date with forthcоming post.

    Thanks 1,000,000 and please kеep up the enjoyable worκ.


    Ηеrе іs my web site; comprar dominio

    YanıtlaSil
  4. Ηello there! I just wаnt to offer you а big thumbs up for your great info
    you have gοt гight herе on thiѕ ρoѕt.
    I'll be coming back to your blog for more soon.

    My blog - www.bookzseo.com

    YanıtlaSil
  5. First off I wοuld likе to saу ѕuperb blog!
    ӏ hаd a quiсk question which I'd like to ask if you don't mind.

    I waѕ сuriouѕ to find out how you center yourself аnd
    сlear уour mіnd ρriοr tο writіng.
    I've had trouble clearing my thoughts in getting my thoughts out there. I truly do enjoy writing however it just seems like the first 10 to 15 minutes are generally lost just trying to figure out how to begin. Any ideas or tips? Cheers!

    Here is my webpage; alojamiento web

    YanıtlaSil
  6. Wοnԁerful worκ! Тhis іs the type
    of infοrmation thаt are supposed to bе
    shared arοund the nеt. Diѕgracе
    οn Goоgle for nо longer poѕitioning this publiѕh upper!

    Come on ovег and vіsit my web ѕіte
    . Thanκs =)

    My blοg pοѕt; CréEr Site

    YanıtlaSil
  7. Çok aceleci yazılmış gibi kopukluklar yaşadım örnek içinde.. bazı komutlarda neden yapıldığı belirtilmemesini eksiklik olarak görüyorum.

    YanıtlaSil