Information Technology, Linux, Tips and Tricks

Linux: Monitor CPU / Disk with iostat , mountstats, nfstats

iostat – Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions

>iostat 5
avg-cpu: %user %nice %system %iowait %steal %idle
 5.78 0.00 1.88 0.31 0.00 92.03

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sdb 1.26 68.00 32.90 105270469 50926556
sda 1.39 43.58 12.47 67460402 19299785
dm-0 1.94 40.91 7.21 63322457 11161776
dm-1 1.98 2.67 5.25 4128376 8121048
dm-2 2.22 68.00 32.90 105268573 50926556

 

mountstats – Displays various NFS client per-mount statistics

> mountstats iostat /mount_point 5

NFS:/location mounted on /mount_point:

ops/s rpc bklog
 13.615 0.000

read: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms)
 5.474 45.247 8.266 11701 (0.1%) 11.996 14.131
write: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms)
 4.505 39.113 8.682 460703 (6.6%) 201.364 5441.623

 

nfstats – list NFS statistics

> nfsstat
Server rpc stats:
calls badcalls badclnt badauth xdrcall
0 0 0 0 0

Client rpc stats:
calls retrans authrefrsh
24265079 347644 24265126

Client nfs v3:
null getattr setattr lookup access readlink
0 0% 133828 0% 1204 0% 2083 0% 24992 0% 4 0%
read write create mkdir symlink mknod
8474389 34% 6977161 28% 1203 0% 18 0% 0 0% 0 0%
remove rmdir rename link readdir readdirplus
447 0% 0 0% 3 0% 0 0% 29 0% 1254 0%
fsstat fsinfo pathconf commit
8648025 35% 10 0% 5 0% 424 0%
Advertisements
Big Data, Information Technology, Tips and Tricks

Install MongoDB on CentOS 6.4

MongoDB can be easily to be installed on CentOS 6.4 (64 bits) with with the following 2 steps:

  1. Add/Create 10 gen repo into the system#> vi /etc/yum.repos.d/10gen.repo

    [10gen]
    name=10gen Repository
    baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
    gpgcheck=0
    enabled=1

  2. Install Packages#> yum install mongo-10gen mongo-10gen-server

Note: You may need to be root to do the installation.

Once the download complete, your MongoDB is ready to be used. You can start/stop MongoDB instance with the following command:

# >  service mongod start
# >  service mongod stop

and, to restart

# > service mongod start

You may want to let the MongoDB auto start when the system up, with the following command:

#> chkconfig mongod on

Now, your MongoDB is installed and ready to use. You can start to using MongoDB shell, with the following command:

# > mongo

Happy trying and using with it.