Tuesday, July 31, 2012

GUI for CentOS 6.2 minimal install Edition

yum groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"
yum groupinstall basic-desktop desktop-platform x11 fonts 

Once the minimal installation is done & then you are installing the 
Deskstop Packages changing Default runlevel from 3 to 5 does not start 
Xorg for GUI hence we need to add “exec /etc/X11/prefdm -nodaemon” in 
/etc/inittab file.
 

Thursday, July 12, 2012

base.bind.h ealing Lost connection to xxxt(GC). Running in disconnec ted mode: unlatch

Jul 12 19:14:52 pimage1-rl adclient[1986]: INFO  base.bind.h
ealing Lost connection to xxxt(GC). Running in disconnec
ted mode: unlatch
Jul 12 19:14:52 pimage1-rl adclient[1986]: INFO  base.bind.h
ealing Reconnected to xxxxxxxxxxt(GC).  Running in connected
mode.
Jul 12 19:45:22 pimage1-rl adclient[1986]: INFO  base.bind.h
ealing Lost connection to xxxxxxxxxx(GC). Running in disconn
ected mode: unlatch
Jul 12 19:45:22 pimage1-rl adclient[1986]: INFO  base.bind.h
ealing Reconnected to xxxxxxxxxx(GC).  Running in connected mo
de.





"adreload" and even "centrifydc restart"

In ADUC, right click on the Computer object, select "Reset Account"

On client side:

Run the command "adkeytab -C" or "adkeytab -r" as root


restart adclient one more time. If it still continues to be in disconnected mode,  "adinfo -g " check the output for examination. 

Friday, July 6, 2012

mysql question


>how much the expected data base size would be
>what/what kind of application is going to deploy
> connection type b/n application & data base (is application using connection pool etc etc)
>Security of data base (users in database eg. root pwd secure in database & connect only thru localhost)
>What mysql table engine preferred (myISAM or Innodb ) ==> how is our applicaiton (e.g if more insert and select then go with myISAM
and if more update and select then go with innodb
and if more insert + delete + select then go with innodb
and if one time bulk insert + one time delete + select then myisam
>reason               myisam -- lock table level
innodb -- locks table in row level
If databases have majority of innodb table then
setup server with following parameter
innodb_buffer_size s/b 65-75 % of available RAM and so on
>Before that I need to know the config of the system

                - RAM
                - What processor
                - What media (SATA or SAS or SSD)

Wednesday, July 4, 2012

How to delete all the root mail in linux by mutt + root mailbox full or 5.2.2: Permanent Failure: Mailbox Status: Mailbox full

How to delete all the root mail in linux by mutt

#mutt
/root/Mail does not exist. Create it? ([yes]/no):
yes

Then press "D"
At the bottom it asks "Delete messages matching:"
 ~s .*

-*-Mutt: /var/spool/mail/root [Msgs:46339 New:46339 Del:46339 48M]---(date/date)-

press "q" to quit and "y" to confirm

Monday, July 2, 2012

Too many files open

No. of Open Files
# lsof | wc -l

[root@aqua ~]# sysctl fs.file-max
fs.file-max = 10000
[root@aqua ~]# sysctl fs.file-max
fs.file-max = 10000

File Descriptor in Kernal memory
[root@aqua ~]# sysctl fs.file-nr
fs.file-nr = 2928       0       10000

a. 2828 is no. of allocated file handles
b. 0 no. of unused but alloted handles
c. 10000 system wide maximum number of file handles

No. of file handles used by a process xxx
#lsof -p xxx|wc -l
 
=================
Too Many files open

use lsof command
ps aux
ps aux | grep jetty
lsof -p 1105
lsof -p 1105 | wc -l
ll /proc/11105/fd
ll /proc/1105/fd | sort -g +10 -10

To sort by the Name column
lsof -p 1105 | sort +10 -10 >/tmp/openFiles.txt

The FD column is the File Descriptor column. It is either the number of the file or one of the following:

    cwd current working directory
    Lnn library references (AIX)
    err FD information error (see NAME column)
    jld jail directory (FreeBSD)
    ltx shared library text (code and data)
    Mxx hex memory-mapped type number xx
    m86 DOS Merge mapped file
    mem memory-mapped file
    mmap memory-mapped device
    pd parent directory
    rtd root directory
    tr kernel trace file (OpenBSD)
    txt program text (code and data)
    v86 VP/ix mapped file

Determine the limit

Each user has a limit for the number of open files. This limit applies to each process run by the user. For example say the limit is 1024 and the user has three processes running, each process can open 1024 files for a total of 3072.

To determine the soft limit:
ulimit -Sn
1024

To determine the hard limit:
ulimit -Hn
2048

ulimit -n shows you the soft limit. The soft limit is the limit applied for opening files. The hard limit is the limit you can increase the soft limit to.

Increase the Limit

To increase the limit to 10000 use the following command:

ulimit -Sn 10000

You can change the hard limit too, ulimit -Hn 10000. ulimit -n 10000 changes both the soft and hard limits to the same value.

Note: Once you reboot the limit is reset.
You cannot determine the limit of the root user using ulimit. For example:

sudo ulimit -n
sudo: ulimit: command not found
To make the limits bigger and to make the change permanent, edit your configuration file and reboot.

You can use * in the limit.conf file instead of a user name to specify all users, however this does not apply to the root!

    soft nofile 10000
    hard nofile 10000
    
    The limit.conf file is applied during the boot process. 
    
    
    You cannot start a process late enough in the boot process! For example: “sudo update-rc.d tomcat defaults 99 01″ is at the end and it is still too late.

The work around is to force the limit to be set before starting the process. Put “ulimit -n 4000″ before starting your process, then the limit.conf file is processed here.

There is another file limit in the system, the total number of files that can be opened by all processes.

To see the file max value:
sysctl -a | grep fs.file-max
fs.file-max = 170469 
  
 
File descriptor can be limited in both system level and shell level.
 
To check maximum number of fd in system type 'cat /proc/sys/fs/file-max'.
730437
 
If u want to set it add 'fs.file-max = 200000' to /etc/sysctl.conf
 
 
To check shell level limit
 
Shell level 'ulimit -n' 

1024

In /etc/security/limits.conf
* soft nofile 2048
* hard nofile 2048
 
 
To get total number of handle that a process use
 
lsof -p PID |wc -l
 
 
For File Descriptors == >  Easy way to edit the file
 
echo "#### Custom Addedlines ####">> /etc/security/limits.conf 
echo "* soft nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "* hard nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "root soft nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "root hard nofile 32768" | sudo tee -a /etc/security/limits.conf
 
 
For User limits  == > 

* soft nofile 32768
* hard nofile 32768
root soft nofile 32768
root hard nofile 32768
* soft memlock unlimited
* hard memlock unlimited
root soft memlock unlimited
root hard memlock unlimited
* soft as unlimited
* hard as unlimited
root soft as unlimited
root hard as unlimited
 
 
In addition, you may need to be run the following command:
sysctl -w vm.max_map_count=131072
The command enables more mapping. It is not in the limits.conf file.



Disable Swap

Disable swap entirely. This prevents the Java Virtual Machine (JVM) from responding poorly because it is buried in swap and ensures that the OS OutOfMemory (OOM) killer does not kill


sudo swapoff --all

 
 
OR
 
echo "*   soft    nofile  131070" >> /etc/security/limits.conf
echo "*   hard    nofile  131070" >> /etc/security/limits.conf

echo 0 > /proc/sys/vm/swappiness
echo "vm.swappiness=0" >> /etc/sysctl.conf


Note
Both the “hard” and the “soft” ulimit affect MongoDB’s performance. The “hard” ulimit refers to the maximum number of processes that a user can have active at any time. This is the ceiling: no non-root process can increase the “hard” ulimit. In contrast, the “soft” ulimit is the limit that is actually enforced for a session or process, but any process can increase it up to “hard” ulimit maximum.
A low “soft” ulimit can cause can't create new thread, closing connection errors if the number of connections grows too high. For this reason, it is extremely important to set both ulimit values to the recommended values
 
 OR
sudo vim /etc/security/limits.conf

*           soft    nofile         10000
*           hard    nofile         20000
Modify the common-session file with the following: sudo vim /etc/pam.d/common-session
session required pam_limits.so
==
you can set system wide limits by editing /etc/security/limits.conf and /etc/pam.d/common-session, however, this only applies interactive and non-interactive shells (and processes started by them).
If you want to try system wide limits, then add a line like the following to /etc/security/limits.conf:
*  -  nofile 65000

In /etc/pam.d/common-session, enable the limits module by adding:
session required pam_limits.so

Keep in mind that all this really does is have PAM set the limit for 
interactive and non-interactive shells when loaded. Processes then 
pickup these limits when started from shells/scripts. You should 
probably do a restart to fully enact these settings. 


and reboot the system.

The option with wildcard *didn’t work for me , because I used root accout to run my programms and wildcard option doesn’t affect the superuser.

 
 

Sunday, July 1, 2012

CentOS 6.2 + Qpidd

When CentOS 6.2 is installed in GUI mode then it install Qpidd by default.


Tasks: 700 total,   5 running, 695 sleeping,   0 stopped,   0 zombie
Cpu(s): 12.2%us, 19.5%sy,  0.0%ni, 67.3%id,  0.0%wa,  0.0%hi,  1.1%si,  0.0%st
Mem:  32866212k total,  5185096k used, 27681116k free,   365688k buffers
Swap: 33554424k total,        0k used, 33554424k free,  3212884k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4358 root      20   0 4428m  68m  10m S 338.7  0.2   6291:59 dsm_om_connsvcd
 3310 root      20   0 5574m 885m  10m S 146.8  2.8   3095:24 java
 3259 root      20   0  113m 8316 4612 S 99.8  0.0   3155:52 java
 3554 qpidd     20   0 1960m  12m 3108 S 23.5  0.0 620:13.01 qpidd


# rpm -qa | grep qpid
qpid-cpp-server-0.14-14.el6_2.x86_64
qpid-cpp-client-0.14-14.el6_2.x86_64
qpid-cpp-client-ssl-0.14-14.el6_2.x86_64
qpid-qmf-0.14-7.el6_2.x86_64
qpid-cpp-server-ssl-0.14-14.el6_2.x86_64

It has dependecy on

Dependencies Resolved

===========================================================================================================================================
 Package                                 Arch                       Version                             Repository                    Size
===========================================================================================================================================
Removing:
 qpid-cpp-client                         x86_64                     0.14-14.el6_2                       @updates                     4.0 M
 qpid-cpp-client-ssl                     x86_64                     0.14-14.el6_2                       @updates                     341 k
 qpid-cpp-server                         x86_64                     0.14-14.el6_2                       @updates                     3.3 M
 qpid-cpp-server-ssl                     x86_64                     0.14-14.el6_2                       @updates                     147 k
 qpid-qmf                                x86_64                     0.14-7.el6_2                        @updates                     1.4 M
Removing for dependencies:
 matahari                                x86_64                     0.4.4-12.el6_2                      @updates                      18 k
 matahari-agent-lib                      x86_64                     0.4.4-12.el6_2                      @updates                      81 k
 matahari-broker                         x86_64                     0.4.4-12.el6_2                      @updates                      32 k
 matahari-host                           x86_64                     0.4.4-12.el6_2                      @updates                     102 k
 matahari-network                        x86_64                     0.4.4-12.el6_2                      @updates                      72 k
 matahari-service                        x86_64                     0.4.4-12.el6_2                      @updates                     126 k
 matahari-sysconfig                      x86_64                     0.4.4-12.el6_2                      @updates                      54 k

Transaction Summary
===========================================================================================================================================
Remove       12 Package(s)


[root@imonitor etc]# rpm -qa | grep matahari
matahari-broker-0.4.4-12.el6_2.x86_64
matahari-0.4.4-12.el6_2.x86_64
matahari-network-0.4.4-12.el6_2.x86_64
matahari-sysconfig-0.4.4-12.el6_2.x86_64
matahari-lib-0.4.4-12.el6_2.x86_64
matahari-host-0.4.4-12.el6_2.x86_64
matahari-service-0.4.4-12.el6_2.x86_64
matahari-agent-lib-0.4.4-12.el6_2.x86_64

To stop it use
# /etc/init.d/qpidd stop

To Remove it & its dependency completely

#yum remove qpid-*

Running Transaction
  Erasing    : matahari-0.4.4-12.el6_2.x86_64                                                                                         1/12
  Erasing    : matahari-broker-0.4.4-12.el6_2.x86_64                                                                                  2/12
  Erasing    : qpid-cpp-server-ssl-0.14-14.el6_2.x86_64                                                                               3/12
  Erasing    : matahari-host-0.4.4-12.el6_2.x86_64                                                                                    4/12
  Erasing    : matahari-network-0.4.4-12.el6_2.x86_64                                                                                 5/12
  Erasing    : matahari-service-0.4.4-12.el6_2.x86_64                                                                                 6/12
  Erasing    : matahari-sysconfig-0.4.4-12.el6_2.x86_64                                                                               7/12
  Erasing    : matahari-agent-lib-0.4.4-12.el6_2.x86_64                                                                               8/12
  Erasing    : qpid-qmf-0.14-7.el6_2.x86_64                                                                                           9/12
  Erasing    : qpid-cpp-client-ssl-0.14-14.el6_2.x86_64                                                                              10/12
  Erasing    : qpid-cpp-server-0.14-14.el6_2.x86_64                                                                                  11/12
  Erasing    : qpid-cpp-client-0.14-14.el6_2.x86_64                                                                                  12/12

Removed:
  qpid-cpp-client.x86_64 0:0.14-14.el6_2         qpid-cpp-client-ssl.x86_64 0:0.14-14.el6_2     qpid-cpp-server.x86_64 0:0.14-14.el6_2
  qpid-cpp-server-ssl.x86_64 0:0.14-14.el6_2     qpid-qmf.x86_64 0:0.14-7.el6_2

Dependency Removed:
  matahari.x86_64 0:0.4.4-12.el6_2              matahari-agent-lib.x86_64 0:0.4.4-12.el6_2    matahari-broker.x86_64 0:0.4.4-12.el6_2
  matahari-host.x86_64 0:0.4.4-12.el6_2         matahari-network.x86_64 0:0.4.4-12.el6_2      matahari-service.x86_64 0:0.4.4-12.el6_2
  matahari-sysconfig.x86_64 0:0.4.4-12.el6_2


or

#yum erase matahari-lib matahari-agent-lib matahari-broker matahari-host matahari-service matahari-sysconfig matahari-network matahari qpid-cpp-client qpid-cpp-client-ssl qpid-cpp-server-ssl qpid-cpp-server sigar polkit dbus qpid-qmf boost ConsoleKit eggdbus boost-filesystem boost-program-options boost-graph boost-date-time boost-serialization boost-test boost-thread boost-regex boost-wave  boost-signals boost-iostreams boost-python ConsoleKit-libs libicu