Thursday, December 13, 2018

libstdc++.so.5: cannot open shared object file: No such file or directory

Description.

OS : centos 7
Mysql version : 5.1

Mysql server doesn't start at the initially just after install it. Contain the following error message in /usr/local/mysql/data/.err file.

181214 09:13:49 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
181214 09:13:49 mysqld_safe mysqld from pid file /usr/local/mysql/data/tap-insights-da.pid ended

>yum list compat-libstdc++-33

Installed Packages
compat-libstdc++-33.i686                                                  3.2.3-72.el7                               
compat-libstdc++-33.x86_64                                                3.2.3-72.el7                                                

"compat-libstdc" is 32 bit one. So  need to install 64 bit.

> yum install compat-libstdc++-33

Thursday, May 18, 2017

Resource temporarily unavailable

If you see a message like following while working on centos system, that means the particular user you are using has exceeded the open process limit.


bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable


So you need to increase it. Here is the way...

Login as root. Go to "limits.conf" file.

> vi /etc/security/limits.conf

Set a higher number of "nproc" value.
Add these two lines.
user          soft    nproc     65550
user          hard    nproc     65555

user - replace with your username

source : https://access.redhat.com/solutions/30316

Tuesday, May 16, 2017

Get "pretty" result always without typing .pretty() on mongo.

When executing mongo commands we put .pretty() at the end to get a readable out put.

Ex:
db.myTable.find({"id":"123"}).pretty()
However there is a way to avoid this command. Just enter the following line into "$HOME/.mongorc.js"
DBQuery.prototype._prettyShell = true
That will enable pretty print globally by default.

Thursday, April 6, 2017

Check Java application Memory consumption using jconsole

First add these JAVA OPTS to the application.

JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname="
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.useLocalHostname"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9010"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.local.only=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

Or to the wrapper.xml

wrapper.java.additional.14=-Djava.rmi.server.hostname=
wrapper.java.additional.15=-Djava.rmi.server.useLocalHostname
wrapper.java.additional.16=-Dcom.sun.management.jmxremote
wrapper.java.additional.17=-Dcom.sun.management.jmxremote.port=9010
wrapper.java.additional.18=-Dcom.sun.management.jmxremote.local.only=false
wrapper.java.additional.19=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.20=-Dcom.sun.management.jmxremote.ssl=false


Then start the java application.

Start jconsole. The java path should have setted.

> jconsole

Go to "Connection --> New connection".
Select "Remote" tab and give the IP and port, Click connect.
Go to "Memory" tab.



Thursday, December 29, 2016

Copy folder in linux without changing the existing permission.

 Sometimes we need to copy some folders without changing its permissions. But when we copy a folder to a new location, the new copy will have the copying person's permission. (Ex: If the copying person is 'root' then the new folder will have the permission only for root.
 One can copy the folder and then change the permission back to the original user. But this will difficult it the folder contains different permissions for different files or folders.
 So the solution for this is use "-pdR" options while copying.

> cp -pdR <file folder_name> <new_location>