NODE MANAGER INSTALL/CONFIG IN WEBLOGIC


***********Uninstall / Reinstall NodeManager Service on WINDOWS***

This needs to be done if you installed Node Manager with the standard installer because by default Node Manager binds to localhost. So as more OS instances are added, it will be required to have Node Manager instances on the network communicate to each other. This can only happen if Node Manager binds to an network interface that is available remotely.

open cmd prompt
run D:\Oracle\wls11g\wlserver_10.3\server\bin\setWLSEnv.cmd
run D:\Oracle\wls11g\wlserver_10.3\server\bin\uninstallNodeMgrSvc.cmd
Make backup copy of installNodeMgrSvc.cmd
edit installNodeMgrSvc.cmd to bind to hostname for remote starts
set NODEMGR_HOST=jbayer-us
run D:\Oracle\wls11g\wlserver_10.3\server\bin\installNodeMgrSvc.cmd
start the service – mine is called “Oracle WebLogic NodeManager…” but on older versions it’s likely will start with “BEA …”
starting the NodeManager process should create the nodemanager.properties file we will edit next
CrashRecovery and StartupScriptEnabled (updated 01/10/2010)
We want to Enable NodeManager to restore servers to their last known state after a reboot.
Open nodemanager.properties from the directory D:\Oracle\wls11g\wlserver_10.3\common\nodemanager\
Change the CrashRecoveryEnabled property from false to true:
CrashRecoveryEnabled=true
Also, because the domain’s \bin\startWebLogic script already has classpath configured, which is especially helpful for use with SmartUpdate that manages WebLogic patches as those classpath’s are not trivial to understand, I strongly recommend setting StartupScriptEnabled=true StartScriptEnabled=true in nodemanager.properties (Thanks to Ray T for the typo fix 6/29/10)
stop/start node manager after making changes to nodemanager.properties
Set up the Machines
Go to the domain's AdminServer console
http://localhost:7001/console
If you need to start it, run \bin\startWebLogic.cmd
With the console navigate to -> Environment -> Machines
Create a new machine – I named mine after the hostname of the server - jbayer-us
If you have more than one OS instance, create one machine for each.
nm_machines

In console go to -> Environment -> Servers
Create a new server, example: managedServer1
Put in the listen address to the hostname you want to bind to, in my case jbayer-us
Change the port to 8001or another available port so as not to conflict with the 7001 port of the AdminServer
Assign managedServer1 it to the jbayer-us machine you just created - -> Enviornment -> Servers -> managedServer1
There should be a dropdown you can use to select the machine
Click the save button on this settings page (don't forget this step)
Now activate changes if required
We need to assign the machine for the AdminServer, this cannot be done while the AdminServer is running.

Stop AdminServer
Open the domain config, example - D:\Oracle\wls11g\user_projects\domains\my_domain\config\config.xml
Find the element used to assign the machine for managedServer1
jbayer-us
Copy that and paste that element right after the AdminServer element
If it is not already set, also specify the AdminServer listen address to be the hostname to bind to, by default it is blank which means bind to all network interfaces.
After these changes my config.xml snippet for the AdminServer looks like this:


AdminServer

jbayer-us

jbayer-us



Start the AdminServer again with the domain directory’s bin\startWebLogic.cmd
Check the console page -> Environment -> Servers to see that the servers are defined correctly as expected

Enroll the domain with Node Manager (updated 01/10/2010)
Navigate with a command prompt go to the domain directory
run bin\setDomainEnv.cmd
run java weblogic.WLST
connect to the AdminServer with your credentials:
connect('weblogic','welcome1','t3://jbayer-us:7001')
Make sure you use forward slashes instead of backslashes in Windows:
nmEnroll(domainDir='D:/Oracle/wls11g/user_projects/domains/my_domain',nmHome='D:/Oracle/wls11g/wlserver_10.3/common/nodemanager')
Now go back to the web console - http://localhost:7001, for each server in the environment, go to the server start tab and put in the appropriate values.
serverStartTabIf you are using StartScriptEnabled=true in nodemanager.properties, then the classpath and jvm arguments from the script will be used first and the values you specify on the Server Startup tab will get added to the end, so you only need to enter values that are unique to each server in the classpath and arguments section.
If you’re using Sun JDK instead of JRockit, then use –Xrs instead of –Xnohup refer to the official docs for more on this, but it has to do with handling OS signals properly.
7-2-10 update: Reader Ray T writes in with another tip:
“After some testing: starting, stopping servers, killing processes, rebooting etc after the configuration, I also found that I could not get the managed servers to shutdown cleanly - or at least the console would not recognize that they had. This had the added side effect of then not letting me start/restart a managed server via the console.

I found that also adding StopScriptEnabled=true solved that final problem.”



Click the image to enlarge – actual text values below:

Java Home

D:\Oracle\wls11g\jrockit_160_14_R27.6.5-32

Java Vendor

Oracle

BEA Home

D:\Oracle\wls11g

Root Directory

D:\Oracle\wls11g\user_projects\domains\my_domain

Classpath is empty as the script values are sufficient

Arguments

-Xnohup

Security Policy File

D:\Oracle\wls11g\wlserver_10.3\server\lib\weblogic.policy

User Name

weblogic

Password

welcome1

Confirm Password

welcome1

Save
Now do the same thing for each managed server.
Activate the changes if required

Node Manager Domain Username and Password
Set the Node Manager username/password for the domain in the console
Click in the console navigator
Select Security tab
Expand to the "Advanced" options about half-way down the page
Choose a Node Manager username/password and put it in the username/password/confirm boxes your credentials, these could be unique from your user used to start the AdminServer, but I chose to keep mine the same weblogic/welcome1.  If you change this user name and password, then you’ll need to specify both when using the command nmConnect().  Thanks Ray T for the catch - 6/29/10.

Decrease Log Verbosity For Standard OutnmCriticalLogSetting
In console, go to each server's Logging -> General page
Expand to the Advanced section half-way down the page
Change the standard out notice level to "Critical"
This log file that captures Standard Out does not roll over while a server is running, so it's really important to make sure this file doesn't get too large. Note that this is not the server log file, this is only standard out.



Have NodeManager Start and Stop the Servers
If it is running, shutdown the AdminServer
Start the AdminServer with NodeManager
Go to domain dir
run bin\setDomainEnv.cmd
run java weblogic.WLST
nmConnect(domainName='my_domain')  nmConnect(domainName=’my_domain’, username=’weblogic’, password=’welcome1’)  6/29/10 Updated thanks to Ray T who noticed that if you change the domain’s Node Manager user and password in the section above called “Node Manager Username and Password” that you’ll need to specify those values here otherwise the defaults of weblogic/welcome1 are used, which worked in my case, but not for others.
nmStart('AdminServer')
Go to console -> Environment -> Servers control tab and start the managed server from the console. It will send a command to Node Manager which actually performs the operation on the console's behalf.
Gotcha! – If you have never started the managed server ever before and you try to start it from Node Manager, you might get an error.  In the server log it mjght say something like: Booting as admin server, but servername, managedServer1, does not match the admin server name, AdminServer  To get around this, simply start the Managed Server for the first time using either the Admin Console Servers->Control tab or the startManagedWebLogic.cmd script.  Subsequent nmStart commands should not have this issue any longer.

Test Killing and Restarting
If the servers are started successfully by Node Manager, try and kill a process from task manager and see if it restarts.

Looking at the Node Manager directory in the domain for each Managed Server, you will be able to see the state - below is a screenshot of managedServer1's files. The PID and .state files should tell you what you need to know to see if the server recovered.  If it did not, the .out file in the server log directory should hopefully give you a clue why.

nmDir

If manual killing of the process restarts a Server then you are ready to test an operating system reboot. Reboot the machine without stopping the WebLogic Servers. Each server should be restored to the state that it was in when the OS was rebooted.

How to Enroll a Node Manager in weblogic?
========================================================================
Applies to:
Weblogic: 10.3.6 and later
========================================================================
nmEnroll is used to enroll a machine or a domain with the node manager.
Few of us may forget to configure NodeManager after installing Weblogic server. Follow below steps to enroll nodemanager manually in weblogic.
1. Create a Machine:
     • Login to weblogic console
     • Click on Lock & Edit button in change center.
     • Go to Environment -> Machines -> click New
     • Provide name and select machine OS
     • Click Next
     • Select type, provide host and port details for node manager and click Finish
     • Click Activate Changes.

2. Configure node manager username and password:
     • Login to weblogic console and take lock & edit.
     • Under domain Structure click on domain_name on left hand side.
     • Go to security tab and click on Advanced.
     • Configure/update NodeManager Username and password.
     • Click save and click Active Changes.

3. Enroll Node Manager:
     • Make sure admin server is up and running.
     • Login to host
     • Go to $ORACLE_HOME/oracle_common/common/bin and run ./wlst.sh
     • Use Connect command to connect to admin server
        connect('','','t3://:')
     • Run nmEnroll
        nmEnroll('', '')
        E.g.
        nmEnroll('/u01/Oracle/Middleware/user_projects/domains/base_domain',                '/u01/Oracle/Middleware/wlserver_10.3/common/nodemanager')
     • Once it is Successfully enrolled to machine with the domain directory check
        $WL_Home/common/nodemanager/nodemanager.domains file. It should have domain entry.
     • Set StartScriptEnabled=true and StopScriptEnabled=true in $WL_Home/common/nodemanager/nodemanager.properties file.
     • Restart the nodemanager and check the status in weblogic console if it is in active status or not.
     • Go to Environment -> Machines -> Click on Machine name
     • Go to Monitoring tab and verify Node Manager Status


Note 1 -

If you are getting below error during connect with node manager, then it means you haven't changed username,password for nodemanager from admin console ( above step 6 )

WLSTException: Error occured while performing nmConnect : Cannot connect to Node Manager. : Access to domain 'base_domain' for user 'weblogic' denied

Note 2 -

If you are getting below error during connect of node manager then it mean you haven't followed above defined steps OR haven't added your domain on nodemanager.domains


WLSTException: Error occured while performing nmConnect : Cannot connect to Node Manager. : Configuration error while reading domain directory

OPENVPN AS BASTON HOST IN AWS

ref:https://www.freecodecamp.org/news/how-you-can-use-openvpn-to-safely-access-private-aws-resources-f904cd24f890/


STEPS:
Create Linux server(ec2) as a private node
Create Openvpn server along with adding the linux server subnet id rannge in Security group
Once your openvpn server is ready then you can able to ssh from openvpn to your linux server




automation-healthcheck

Problem for automation

[user@server lk]$ CONCSUB apps/passwordofuser SYSADMIN 'System Administrator' SYSADMIN WAIT=N CONCURRENT FND FNDSCURS > req.txt
[user@server lk]$ cat req.txt
Submitted request 4632124 for CONCURRENT FND FNDSCURS

[user@server lk]$ awk '{print $3}' req.txt
4632124


SQL> SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[user@server lk]$ CONCSUB apps/passwordofuser SYSADMIN 'System Administrator' SYSADMIN WAIT=N CONCURRENT FND FNDSCURS > req.txt
[user@server lk]$ > req.txt
[user@server lk]$ cat req.txt
[user@server lk]$ CONCSUB apps/passwordofuser SYSADMIN 'System Administrator' SYSADMIN WAIT=N CONCURRENT FND FNDSCURS > req.txt
[user@server lk]$ cat req.txt
Submitted request 4632126 for CONCURRENT FND FNDSCURS

[user@server lk]$ sqlplus apps/passwordofuser << EOF
> spool healthcheck.txt
> set lines 300
> select a.user_concurrent_program_name , a.CONCURRENT_PROGRAM_ID , REQUEST_ID
> ,REQUEST_TYPE,PHASE_CODE  , STATUS_CODE , ACTUAL_START_DATE ,COMPLETION_TEXT
> from fnd_concurrent_programs_tl a, fnd_concurrent_requests b
> where a.concurrent_program_id=b.concurrent_program_id
> and program_application_id=0
> and REQUEST_ID=4632126;
> spool off;
> exit;
> EOF

SQL*Plus: Release 8.0.6.0.0 - Production on Wed Apr 1 07:41:10 2020

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SQL> SQL>   2    3    4    5    6
USER_CONCURRENT_PROGRAM_NAME                                                                                                               CONCURRENT_PROGRAM_ID REQUEST_ID R P S ACTUAL_ST
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------------------- ---------- - - - ---------
COMPLETION_TEXT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Active Users                                                                                                                               20641     4632126   C C 01-APR-20
Normal Running


***After few minits--we dont estimate the time***

SQL> SQL> SQL>   2    3    4    5    6
USER_CONCURRENT_PROGRAM_NAME                                                                                                               CONCURRENT_PROGRAM_ID REQUEST_ID R P S ACTUAL_ST
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------------------- ---------- - - - ---------
COMPLETION_TEXT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Active Users                                                                                                                               20641     4632126   C C 01-APR-20
Normal completion


when it get the status like completion then we need to conculde that reqeust has been completed and application is running fine




########################SOLUTION IS #######healthcheck report for oracle apps

#!/bin/sh
username=$1;
password=$2;
> req.txt;
> healthcheck.txt;
sd=`echo $TWO_TASK`
CONCSUB $1/$2 SYSADMIN 'System Administrator' SYSADMIN WAIT=N CONCURRENT FND FNDSCURS > req.txt
requid=`awk '{print $3}' req.txt`
echo $requid;
sqlplus $1/$2 << EOF
spool healthcheck.txt
set lines 300
select a.user_concurrent_program_name , a.CONCURRENT_PROGRAM_ID , REQUEST_ID
,REQUEST_TYPE,PHASE_CODE  , STATUS_CODE , ACTUAL_START_DATE ,COMPLETION_TEXT
from fnd_concurrent_programs_tl a, fnd_concurrent_requests b
where a.concurrent_program_id=b.concurrent_program_id
and program_application_id=0
and REQUEST_ID=$requid;
spool off;
exit;
EOF
####REQSTATUS####
a=`cat healthcheck.txt|grep Normal|wc -l`
while [ $a -le 1 ]
do
> healthcheck.txt
echo "$requid is running"
sleep 2
sqlplus $1/$2 << EOF
spool healthcheck.txt
set lines 300
select a.user_concurrent_program_name , a.CONCURRENT_PROGRAM_ID , REQUEST_ID
,REQUEST_TYPE,PHASE_CODE  , STATUS_CODE , ACTUAL_START_DATE ,COMPLETION_TEXT
from fnd_concurrent_programs_tl a, fnd_concurrent_requests b
where a.concurrent_program_id=b.concurrent_program_id
and program_application_id=0
and REQUEST_ID=$requid;
spool off;
exit;
EOF
a=`cat healthcheck.txt|grep Normal|wc -l`
done
rm -rf healthcheck.txt
>outfile.txt
echo REQUESTID=$requid > outfile.txt
echo PROGRAMNAME="Active users" >>outfile.txt
echo STATUS="COMPLETED" >> outfile.txt
echo PHASE="NORMAL" >> outfile.txt
###DBSTATUS#####
###spool DB.txt
sqlplus $1/$2 << EOF
spool DB.txt
conn $1/$2
select * from global_name;
spool off;
exit;
EOF
b=`cat DB.txt|grep Connected|wc -l`
if [$b -ge 1 ]
then
rm -rf DB.txt
echo DATABASENAME=$sd >> outfile.txt
echo DBSTATUS="UP AND RUNNING" >> outfile.txt
fi
########APACHE STATUS#############
as=`pwd`
rm -rf apache.txt
cd $COMMON_TOP/admin/scripts/$TWO_TASK*
rm -rf apache.txt
sh adapcctl.sh status > apache.txt
chmod -R 777 apache.txt
cp -r apache.txt $as
cd $as
p=`cat apache.txt|grep not|wc -l`
if [$p -ge 1 ]
then
echo APACHESTATUS="APACHE IS NOT RUNNING"  >> outfile.txt
else
echo APACHESTATUS="APACHE IS UP AND  RUNNING" >> outfile.txt
fi