JMX -Java Monitoring Extension

Java Monitoring Extension

JMX is one of the most useful way in java environment to debug applications.

We can use different JMX tools to connect to the JMX  port and monitor the status of our application.

Information of the memory usage, the total number of instances, the object references etc can be tracked easily.

In tomcat we can use the startup scripts to set all kinds of parameters, or we can also enable JMX access by setting the CATALINA_OPTS environment variable.

On Unix machines we can create a file setenv.sh inside Tomcat’s bin   directory with the following content:

export CATALINA_OPTS="-Dcom.sun.management.jmxremote"

This is read automatically during the startup.

On Windows machine, this can be set via setenv.bat.

We can add username and password to secure this port

export CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=8090 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

After JMX port is setup we can connect to it using the jconsole tool or jvisualvm tool which is present in the jdk bin installation directory.

We can double click to lauch it or type “jconsole” or “jvisualvm” from the command prompt.

Once it is opened we can connect to it by typing the remote address and port number of the server.

If we have set the credentials at the server side then we need to provide them.

jconsole1

The JConsole interface in JDK is generally composed of the following six tabs:

Summary displays summary information on the JVM and monitored values.
Memory displays information about memory use.
Threads displays information about thread use.
Classes displays information about class loading.
MBeans displays information about MBeans.
VM displays information about the JVM.

jconsole

Jvisualvm tool has many feature as compared to jconsole. We can analyze a heap dump and take memory snapshots, thread dump.

We can also use sampling option to take some sample of the desired classes in the memory.

Using jvisualvm we can also load  heap dump of a any server and then analyze the heap dump offline.

jvisualvm

 

 

 

How to solve pg_tblspc problem in postgres

This blog will talk about How to solve pg_tblspc problem in postgres

pg_tblspc problem postgres

Sometime when we are doing some operation on Postgres database, we faced this error.

I faced  it,  when I  was  trying  to  get  values  from  database.

This issue throws error that could not open directory “pg_tblspc/<1234…x>”: No such file or directory

To  solve this  issue  you  first  have  to  create  dump  of  your  database. Steps are ahead …

 

  • psql -h localhost -p 6666 -U postgres -d <yourDBname>-f “E:/xyz/abc.p”

(It will create dump file of your database)

  • Then delete your old database after dumping it.

(dump database <yourDBname>)

  • Then again restore it from your dump file…

 

Or, Its better to use your backup file while restoring..

If  problem  is  still  there then we need  to first restore that <abc.p/abc.sql> file  on  our  local  machine

  • then  again  create  (.p)  file  as  dump  file
  • And restore your postgres by using this new dump file…

You will not come across this problem again……..

 

Another way:-

1) Backup data with pg_dump

 

pg_dump -i -h localhost -p 5432 -U postgres -F c -b -v -f

“/usr/local/backup/10.70.0.61.backup” old_db

 

To list all of the available options of pg_dump, please issue following command.

 

  • Ø pg_dump -?

 

-p, –port=PORT database server port number

-i, –ignore-version proceed even when server version mismatches

-h, –host=HOSTNAME database server host or socket directory

-U, –username=NAME connect as specified database user

-W, –password force password prompt (should happen automatically)

-d, –dbname=NAME connect to database name

-v, –verbose verbose mode

-F, –format=c|t|p output file format (custom, tar, plain text)

-c, –clean clean (drop) schema prior to create

-b, –blobs include large objects in dump

-v, –verbose verbose mode

-f, –file=FILENAME output file name

 

2) Restore data with pg_restore

 

pg_restore -i -h localhost -p 5432 -U postgres -d old_db -v

“/usr/local/backup/10.70.0.61.backup”

 

To list all of the available options of pg_restore, please issue following command.

 

  • Ø pg_restore -?

 

-p, –port=PORT database server port number

-i, –ignore-version proceed even when server version mismatches

-h, –host=HOSTNAME database server host or socket directory

-U, –username=NAME connect as specified database user

-W, –password force password prompt (should happen automatically)

-d, –dbname=NAME connect to database name

-v, –verbose verbose mode

 

Pushpraj Kumar,

Helical IT Solutions

Differences between Reporting and Analysis – Concepts

Differences between Reporting and Analysis – Concepts

Definition

       1.The process of orga­niz­ing data into infor­ma­tional sum­maries in order to mon­i­tor how dif­fer­ent areas of a busi­ness are per­form­ing.

Definition

        1.The process of explor­ing data and reports in order to extract mean­ing­ful insights, which can be used to bet­ter under­stand and improve busi­ness performance.

       2.Report­ing trans­lates raw data into infor­ma­tion

        2.Analy­sis trans­forms data and infor­ma­tion into insights.

       3.Good report­ing should raise ques­tions about the busi­ness from its end users

        3.The goal of analy­sis is to answer ques­tions by inter­pret­ing the data at a deeper level and pro­vid­ing action­able rec­om­men­da­tions

      4.Report­ing shows you what is hap­pen­ing

      4.Analy­sis focuses on explain­ing why it is hap­pen­ing and what you can do about it.

Tasks

       5.Reporting: Build­ing, con­fig­ur­ing, con­sol­i­dat­ing, orga­niz­ing, for­mat­ting, and sum­ma­riz­ing.

        5.Analy­sis:  focuses on dif­fer­ent tasks such as ques­tion­ing, exam­in­ing, inter­pret­ing, com­par­ing, and con­firm­ing.

Outputs/Approach

       6.Report­ing fol­lows a push approach

         6.Analy­sis fol­lows a pull approach

       7.Reports are pushed to users who are then expected to extract mean­ing­ful insights and take   appro­pri­ate actions for them­selves (i.e.,     self-serve).


8.Types

Dashboard: These custom-made reports com­bine dif­fer­ent KPIs and reports to pro­vide a com­pre­hen­sive, high-level view of busi­ness per­for­mance for spe­cific audi­ences. Dash­boards may include data from var­i­ous data sources and are also usu­ally fairly static.

7.Par­tic­u­lar data is pulled by an ana­lyst in order to answer spe­cific busi­ness ques­tions.

8.Types
Ad hoc responses
Analy­sis pre­sen­ta­tions

Approach of Reporting and Analysis

image