In this document, we will set a crontab to restart our managed server.
We will follow below steps :
1. Create a python script to stop the server.
2. Now create python script to start server.
3. Now create a shell script to run these python scripts.
4. Now create a script to run in crontab.
5. Now schedule the crontab as required.
1. Create a python script to stop the server as,
$mkdir -p /u01/oracle/scripts
$vim stopappsrvr.py
connect('weblogic','','t3://<WebLogic Admin Server IP>:<AdminPort')
exitonerror=false
print "** Starting App Server **"
shutdown('AppServer', 'Server', force="true")
exit()
:wq
2. Now create python script to start server as,
$vim startappsrvr.py
connect('weblogic','','t3://<WebLogic Admin Server IP>:<AdminPort')
print "** Starting App Server **"
start(name="AppServer", block="true")
exit()
3. Now create a shell script to run these python scripts as,
$vim rst.sh
#App server is going to stop
echo `date`
export FMW_HOME=/u01/app/oracle/Middleware/Oracle_Home
$FMW_HOME/oracle_common/common/bin/./wlst.sh /u01/app/oracle/scripts/stopappsrvr.py
echo `date`
sleep 300
echo `date`
$FMW_HOME/oracle_common/common/bin/./wlst.sh /u01/app/oracle/scripts/startappsrvr.py
echo `date`
:wq
4. Now create a script to run in crontab as,
$vim restartsrvr.sh
. /u01/app/rst.sh > restart_$(date +"%Y_%m_%d_%I_%M_%p").log
:wq
5. Now schedule the crontab as required,
$crontab -e
#to run at midnight daily
0 0 * * * /u01/app/./restartserver.sh
#to run at 1 PM daily
0 14 * * * /u01/app/./restartserver.sh
Wednesday, March 28, 2018
Ping request with time stamp in Linux
Sometimes for troubleshooting purpose, we need timestamp with ping results.
Normal ping result
$ping www.google.com
Reply from 216.58.196.196: bytes=32 time=4ms TTL=57
Reply from 216.58.196.196: bytes=32 time=8ms TTL=57
Reply from 216.58.196.196: bytes=32 time=6ms TTL=57
Reply from 216.58.196.196: bytes=32 time=5ms TTL=57
Reply from 216.58.196.196: bytes=32 time=4ms TTL=57
Reply from 216.58.196.196: bytes=32 time=5ms TTL=57
Reply from 216.58.196.196: bytes=32 time=1089ms TTL=57
Reply from 216.58.196.196: bytes=32 time=5ms TTL=57
Reply from 216.58.196.196: bytes=32 time=195ms TTL=57
Ping Result with time stamp
$ping www.google.com | while read pong; do echo "$(date): $pong"; done
Tue Mar 27 13:00:00 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24707 ttl=62 time=0.377 ms
Tue Mar 27 13:00:01 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24708 ttl=62 time=0.428 ms
Tue Mar 27 13:00:02 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24709 ttl=62 time=0.380 ms
Tue Mar 27 13:00:03 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24710 ttl=62 time=0.408 ms
Tue Mar 27 13:00:04 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24711 ttl=62 time=0.549 ms
Tue Mar 27 13:00:05 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24712 ttl=62 time=0.382 ms
Normal ping result
$ping www.google.com
Reply from 216.58.196.196: bytes=32 time=4ms TTL=57
Reply from 216.58.196.196: bytes=32 time=8ms TTL=57
Reply from 216.58.196.196: bytes=32 time=6ms TTL=57
Reply from 216.58.196.196: bytes=32 time=5ms TTL=57
Reply from 216.58.196.196: bytes=32 time=4ms TTL=57
Reply from 216.58.196.196: bytes=32 time=5ms TTL=57
Reply from 216.58.196.196: bytes=32 time=1089ms TTL=57
Reply from 216.58.196.196: bytes=32 time=5ms TTL=57
Reply from 216.58.196.196: bytes=32 time=195ms TTL=57
Ping Result with time stamp
$ping www.google.com | while read pong; do echo "$(date): $pong"; done
Tue Mar 27 13:00:00 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24707 ttl=62 time=0.377 ms
Tue Mar 27 13:00:01 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24708 ttl=62 time=0.428 ms
Tue Mar 27 13:00:02 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24709 ttl=62 time=0.380 ms
Tue Mar 27 13:00:03 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24710 ttl=62 time=0.408 ms
Tue Mar 27 13:00:04 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24711 ttl=62 time=0.549 ms
Tue Mar 27 13:00:05 IST 2018: 64 bytes from 216.58.196.196: icmp_seq=24712 ttl=62 time=0.382 ms
Q. What is Java?
Ans : Java is a programming language and computing platform.Java can be used to create complete applications that may run on a single computer or be distributed among servers and clients in a network. It can also be used to build a small application module or applet for use as part of a webpage.
Q. What are Java Servlets?
Ans : A servlet is a java program that executes on the server, accepting client requests and generating dynamic responses. Servlets do not just create HTML. Theses cal also be used to generate other MIME types, such as images.
Q. What is JSP (Java Server Pages)?
Ans : JSP are HTML documents that are interwoven with Java. JSP provides dynamic responses that is based on client request. JSP's are portable(write once, run everywhere). JSP's compile and run as servlets.
Q. What are EJBs (Enterprise Java Beans)?
Ans : EJBs are distributed components written in the java programming language.
EJBs provide distributable and deployable business services(Logic)to clients.
EJBs are reusable accross application servers.
EJBs execute within a container that provides management and control services.
Q. What is JDBC (Java Database Connectivity )?
Ans : Java Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a client may access a database.
It is the standard java interface for accessing heterogeneous databases.
Q. What is JNDI (Java Naming and Directory Interface)?
Ans : JNDI is a Java API for a directory service that allows Java software clients to discover and look up data and objects via a name.It is an Java API for accessing naming and directory services.It built as a layer over DNS,LDAP and so on.
Q. What is JTA (Java Transaction API)?
Ans : JTA is a standard JAVA API that enables distributed transactions to be done across multiple X/Open XA resources in a Java environment.Java Transaction API (JTA) specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.
Q. What is JMS (Java Messaging Service)?
Ans : The Java Message Service is a Java API that allows applications to create, send, receive, and read messages.The JMS API defines a common set of interfaces and associated semantics that allow programs written in the Java programming language to communicate with other messaging implementations.The JMS API minimizes the set of concepts a programmer must learn in order to use messaging products but provides enough features to support sophisticated messaging applications.
Q. WHat is JAAS (Java Authentication & Autherization)?
Ans : It is a java based security management framework that supports single sign-on and a pluggable authentication Module(PAM).
Q. What is JMX (Java Management Extension)?
Ans : It defines a standard infrastructure to manage a device from java programs.MBEANS are the building blocks of JMX.
Q. What is JCA (Java Connector Architecture)?
Ans : JCA connects Enterprise Info. System(EIS) with resource adapters and resource adapters can be deployed in a Resource Adapter Archive(RAR).
Q. What is Client Application ?
Ans : The client application interacts with WLS through JRMP/T3, IIOP and jCOM.
The types of clients include :
a) Standalone java applications.
b) Applets within a browser.
Q. What is Web Client?
Ans : A web client interacts with oracle WLS via HTTP using servlets and JSPs.
The types of web clients includes :
a) Browser
b) Web Service(SOAP over HTTP)
Q. What is Proxy Server?
Ans : It forwards the requests to other machines. It can also be used to load balance a system.
Q. What is T3 protocol in WebLogic?
Ans : T3 is an optimized protocol used to transport data between WLS and other java programs including clients and other WLS servers. WLS server keeps track of every JVM with which it connects and creates a single T3 connection to carry all traffic for a JVM.
T3 and T3s are proprietary protocols that are analogous to the industry standard HTTP or HTTPS protocols.
Ans : Java is a programming language and computing platform.Java can be used to create complete applications that may run on a single computer or be distributed among servers and clients in a network. It can also be used to build a small application module or applet for use as part of a webpage.
Q. What are Java Servlets?
Ans : A servlet is a java program that executes on the server, accepting client requests and generating dynamic responses. Servlets do not just create HTML. Theses cal also be used to generate other MIME types, such as images.
Q. What is JSP (Java Server Pages)?
Ans : JSP are HTML documents that are interwoven with Java. JSP provides dynamic responses that is based on client request. JSP's are portable(write once, run everywhere). JSP's compile and run as servlets.
Q. What are EJBs (Enterprise Java Beans)?
Ans : EJBs are distributed components written in the java programming language.
EJBs provide distributable and deployable business services(Logic)to clients.
EJBs are reusable accross application servers.
EJBs execute within a container that provides management and control services.
Q. What is JDBC (Java Database Connectivity )?
Ans : Java Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a client may access a database.
It is the standard java interface for accessing heterogeneous databases.
Q. What is JNDI (Java Naming and Directory Interface)?
Ans : JNDI is a Java API for a directory service that allows Java software clients to discover and look up data and objects via a name.It is an Java API for accessing naming and directory services.It built as a layer over DNS,LDAP and so on.
Q. What is JTA (Java Transaction API)?
Ans : JTA is a standard JAVA API that enables distributed transactions to be done across multiple X/Open XA resources in a Java environment.Java Transaction API (JTA) specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.
Q. What is JMS (Java Messaging Service)?
Ans : The Java Message Service is a Java API that allows applications to create, send, receive, and read messages.The JMS API defines a common set of interfaces and associated semantics that allow programs written in the Java programming language to communicate with other messaging implementations.The JMS API minimizes the set of concepts a programmer must learn in order to use messaging products but provides enough features to support sophisticated messaging applications.
Q. WHat is JAAS (Java Authentication & Autherization)?
Ans : It is a java based security management framework that supports single sign-on and a pluggable authentication Module(PAM).
Q. What is JMX (Java Management Extension)?
Ans : It defines a standard infrastructure to manage a device from java programs.MBEANS are the building blocks of JMX.
Q. What is JCA (Java Connector Architecture)?
Ans : JCA connects Enterprise Info. System(EIS) with resource adapters and resource adapters can be deployed in a Resource Adapter Archive(RAR).
Q. What is Client Application ?
Ans : The client application interacts with WLS through JRMP/T3, IIOP and jCOM.
The types of clients include :
a) Standalone java applications.
b) Applets within a browser.
Q. What is Web Client?
Ans : A web client interacts with oracle WLS via HTTP using servlets and JSPs.
The types of web clients includes :
a) Browser
b) Web Service(SOAP over HTTP)
Q. What is Proxy Server?
Ans : It forwards the requests to other machines. It can also be used to load balance a system.
Q. What is T3 protocol in WebLogic?
Ans : T3 is an optimized protocol used to transport data between WLS and other java programs including clients and other WLS servers. WLS server keeps track of every JVM with which it connects and creates a single T3 connection to carry all traffic for a JVM.
T3 and T3s are proprietary protocols that are analogous to the industry standard HTTP or HTTPS protocols.
Wednesday, January 31, 2018
Some useful shortcut commands for windows
1: lusrmgr.msc-------to see user and computer
2: compmgmt.msc------to see computer management
3: devmgmt.msc-------to see devices and driver
4: ncpa.cpl----------to see local area connection
5: appwiz.cpl--------to see control pannel
6: control-----------to see control pannel
7: sysdm.cpl---------to see my computer properties
8: dnsmgmt.msc-------to see DNS configuration.
9: dsa.msc-----------to see Active Directory User and Computer.
10: intcpl.cpl-------to see internet properties.
11: cleanmgr---------to clean c drive from unwanted junk files.
12: taskmgr.msc------to open task manager
13: eventvwr.msc----to see event viewer
14: regedit.msc-----to check registry info.
15: gpedit.msc------to configure Group oplicy on local PC
16: services.msc----to check services information.
17: secpol.msc------to check local security and policy.
18: msconfig--------to check startup running application.
19: osk-------------ON SCREEN KEYBOARD
2: compmgmt.msc------to see computer management
3: devmgmt.msc-------to see devices and driver
4: ncpa.cpl----------to see local area connection
5: appwiz.cpl--------to see control pannel
6: control-----------to see control pannel
7: sysdm.cpl---------to see my computer properties
8: dnsmgmt.msc-------to see DNS configuration.
9: dsa.msc-----------to see Active Directory User and Computer.
10: intcpl.cpl-------to see internet properties.
11: cleanmgr---------to clean c drive from unwanted junk files.
12: taskmgr.msc------to open task manager
13: eventvwr.msc----to see event viewer
14: regedit.msc-----to check registry info.
15: gpedit.msc------to configure Group oplicy on local PC
16: services.msc----to check services information.
17: secpol.msc------to check local security and policy.
18: msconfig--------to check startup running application.
19: osk-------------ON SCREEN KEYBOARD
Tuesday, December 5, 2017
Configure ssmtp to use gmail SMTP relay on CentOS
1. Install ssmtp rpm as,
#yum install ssmtp
2. Now edit ssmtp.conf file as,
#vim /etc/ssmtp/ssmtp.conf
root=XXX@gmail.com
mailhub=smtp.gmail.com:465
AuthUser=XXXX@gmail.com
AuthPass=<Password of gmail account>
FromLineOverride=YES
UseTLS=YES
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
3. After this, make ssmtp default mta as,
#alternatives --config mta
it will ask to choose mta, here select the ssmtp and enter.
4. Now send the mail as,
#mail -s "SUBJECT" xxxxx@abc.com
#yum install ssmtp
2. Now edit ssmtp.conf file as,
#vim /etc/ssmtp/ssmtp.conf
root=XXX@gmail.com
mailhub=smtp.gmail.com:465
AuthUser=XXXX@gmail.com
AuthPass=<Password of gmail account>
FromLineOverride=YES
UseTLS=YES
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
3. After this, make ssmtp default mta as,
#alternatives --config mta
it will ask to choose mta, here select the ssmtp and enter.
4. Now send the mail as,
#mail -s "SUBJECT" xxxxx@abc.com
Wednesday, November 8, 2017
javax.net.ssl.SSLKeyException in Node Manager status
Problem : Could not start node manager
Problem Explanation : I have changed my machine(It got currupted) and use the existing HDD partition to again run the machine. All was right but node manager was not running.
Error : javax.net.ssl.SSLKeyException
Solution : This issue has two solutions as,
A. Disable the hostname verification
B. Recreate the certificates
A. Disable the hostname verification ,
1. In the Admin console for your domain, go to Environment -> Servers -> AdminServer.
2. Click on the SSL tab.
3. Expand the “Advanced” section at the bottom.
4. Set Hostname Verification to None.
5. Save and activate the changes.
B. Recreate the certificates ,
1. First of all set the WLS enviornment varibales using,
$MIDDLEWARE_HOME/wlserver_10.3/server/bin/.setWLSEnv.sh
2. Backup the Demoidentity.jks keystore located in,
$MIDDLEWARE_HOME/wlserver_10.3/server/lib/DemoIdentity.jks
3. Generate the private key of the keystore using the following command:
java utils.CertGen -cn hostname -keyfilepass DemoIdentityPassPhrase -certfile newcert -keyfile newkey
Note : Here I got error "utils.CertGen not found"
Solution : For this we have need to set CLASSPATH manually as,
$export CLASSPATH=$CLASSPATH:/stage/oracle/middleware/wlserver_10.3/server/lib/weblogic.jar
After this run the above command again.
4. Import the generated key in the Demoidentity.jks using the following command:
java utils.ImportPrivateKey -keystore DemoIdentity.jks -storepass DemoIdentityKeyStorePassPhrase -keyfile newkey.pem -keyfilepass DemoIdentityPassPhrase -certfile newcert.pem -alias demoidentity.
5. Now restart the WebLogic Server.
Problem Explanation : I have changed my machine(It got currupted) and use the existing HDD partition to again run the machine. All was right but node manager was not running.
Error : javax.net.ssl.SSLKeyException
Solution : This issue has two solutions as,
A. Disable the hostname verification
B. Recreate the certificates
A. Disable the hostname verification ,
1. In the Admin console for your domain, go to Environment -> Servers -> AdminServer.
2. Click on the SSL tab.
3. Expand the “Advanced” section at the bottom.
4. Set Hostname Verification to None.
5. Save and activate the changes.
B. Recreate the certificates ,
1. First of all set the WLS enviornment varibales using,
$MIDDLEWARE_HOME/wlserver_10.3/server/bin/.setWLSEnv.sh
2. Backup the Demoidentity.jks keystore located in,
$MIDDLEWARE_HOME/wlserver_10.3/server/lib/DemoIdentity.jks
3. Generate the private key of the keystore using the following command:
java utils.CertGen -cn hostname -keyfilepass DemoIdentityPassPhrase -certfile newcert -keyfile newkey
Note : Here I got error "utils.CertGen not found"
Solution : For this we have need to set CLASSPATH manually as,
$export CLASSPATH=$CLASSPATH:/stage/oracle/middleware/wlserver_10.3/server/lib/weblogic.jar
After this run the above command again.
4. Import the generated key in the Demoidentity.jks using the following command:
java utils.ImportPrivateKey -keystore DemoIdentity.jks -storepass DemoIdentityKeyStorePassPhrase -keyfile newkey.pem -keyfilepass DemoIdentityPassPhrase -certfile newcert.pem -alias demoidentity.
5. Now restart the WebLogic Server.
Wednesday, November 1, 2017
To increase the heap size of a Managed server
1. Open Admin console, go to server-->server name-->Configuration-->server start.
2. Here in Arguments section, write the desired heap size as,
-Xms512m -Xmx512m
2. Here in Arguments section, write the desired heap size as,
-Xms512m -Xmx512m
Subscribe to:
Comments (Atom)