Kmaiti

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 30 December 2010

unable connect to socket: No route to host (113)

Posted on 02:50 by Unknown
Guys,

This error message usually comes when you try to access remote linux desktop using vncviewer. Please check the firewall in the linux server. It's causing this error messages. First stop the firewall and test it once again. Please allow the ports 5801,5901 and 6001 in the iptables or firewall. Then restart the firewall and try to connect to the server. It'll work.

Try :)
Read More
Posted in | No comments

How to install frysk on linux rhel5?

Posted on 00:38 by Unknown
Install frysk :

frysk : It's debugging and monitoring tool of the system.

===========
yum install -y \
antlr jdom junit gcc-java gcc-c++ \
libglade-java-devel libvte-java-devel \
automake xmlto transfig eclipse-ecj dogtail \
sharutils git audit-libs-devel binutils-devel \
yelp libtool make
===========

Try :)
Read More
Posted in | No comments

Flow diagram of systemtap debugging scripting tool?

Posted on 00:19 by Unknown



===========================
What is systemtap?


Ans : Scripting tool to debug and monitor the whole system processes or any events.

How to install it on linux machine ?


Ans :
yum install kernel-devel
yum install kernel-debuginfo
yum install systemtap

Tool to do the job :

Ans : stap

Syntax to use it :


-------------
probe {handler}

Where event is kernel.function, process.statement, timer.ms, begin, end etc

and handler can be filtering/control statement and
helper function : log, printf, pid etc
-------------

Example :


[root@vm80 systamexample]# cat hellworld.stp
probe begin
{
print("This is hello world\n")
exit()
}

[root@vm80 systamexample]

Execution :


[root@vm80 systamexample]# stap hellworld.stp
This is hello world
[root@vm80 systamexample]#

[root@vm80 systamexample]# cat primecheck.stp
function isprime (x) {
if (x < 2) return 0
for (i = 2; i < x; i++) {
if (x % i == 0) return 0
if (i * i > x) break
}
return 1
}

probe begin {
for (i = 0; i < 50; i++)
if (isprime (i)) printf("%d\n", i)
exit()
}


stap-authorize-signing-cert stap-report
[root@vm80 systamexample]# stap primecheck.stp
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
[root@vm80 systamexample]#
==============================

Try :)
Read More
Posted in | No comments

Tuesday, 28 December 2010

How to remotely access the linux desktop from any linux or windows machine?

Posted on 22:11 by Unknown
Guys,

I referred the following steps :

=======================
1. On server-linux(Which will be accessed) : yum install vnc*

2. On client-linux(who will access the remote desktop of the server ) : yum install vncviewer


Note : You can install the tigerVNC instead of yum. Just download the package and install it on both client and server. Here is the URL :

----------
http://sourceforge.net/projects/tigervnc/files/
----------


3. On server :
Enter command : vncpasswd
now setup a password to connect it via vnc

4. vi /etc/sysconfig/vncservers

Do the following (You can setup another user):

VNCSERVERS="1:root"

PS : here user is root

5. chkconfig vncserver on
6. service vncserver start
7. allow port 5901 at firewall

8. restart vncserver like " service vncserver restart

9. vi /root/.vnc/xstartup and comment following lines :

----
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
----

Note : In case of tigerVNC you don't need to do this.

10. On client :

Execute command : vncviewer
Enter IP of the server and password of the server. Now remote desktop will appear. OR you can access the rdesktop like :

-----
[kmaiti@kmaiti ~]$ vncviewer 10.65.211.80:1
-----

Here 10.65.211.80 is the IP of the remote linux server and 1 is the 1st user which is root.

To access the server from windows machine please install vncviewer on it and execute the binary. Then put IP of the server and password. that's it.

Here are the content of the files on linux server.

----------------

[root@vm80 /]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# .

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.

VNCSERVERS="1:root"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

[root@vm80 /]#
[root@vm80 /]# cat /root/.vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
#twm &
[root@vm80 /]#

----------------
========================

Try :)
Read More
Posted in | No comments

How to install luci and ricci for managing the clustering infrastructure?

Posted on 00:04 by Unknown
Luci and ricci are two softwares to manage the clustering infrastructure of the high availability services. Luci connects to the agent ie ricci which must have installed on each clustered nodes to deliver the messages. You can install the luci on any machine(may be clustered node or without clustered node).

Here are the steps that I followed :

==========
[root@kmaiti src]# wget ftp://ftp.pbone.net/mirror/ftp.centos.org/5.5/updates/x86_64/RPMS/luci-0.12.2-12.el5.centos.4.x86_64.rpm
[root@kmaiti src]# rpm -ivh luci-0.12.2-12.el5.centos.4.x86_64.rpm
warning: luci-0.12.2-12.el5.centos.4.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
error: Failed dependencies:
stunnel is needed by luci-0.12.2-12.el5.centos.4.x86_64
[root@kmaiti src]# yum install stunnel
Loaded plugins: changelog, downloadonly, protect-packages, refresh-packagekit, rhnplugin, tmprepo, verify, versionlock
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package stunnel.x86_64 0:4.29-2.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing:
stunnel x86_64 4.29-2.el6 production-rhel-x86_64-workstation-6 121 k

Transaction Summary
=============================================================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)

Total download size: 121 k
Installed size: 0
Is this ok [y/N]: y
Downloading Packages:
stunnel-4.29-2.el6.x86_64.rpm | 121 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : stunnel-4.29-2.el6.x86_64 1/1

Installed:
stunnel.x86_64 0:4.29-2.el6

Complete!

[root@kmaiti src]#
[root@kmaiti src]# rpm -ivh luci-0.12.2-12.el5.centos.4.x86_64.rpm
warning: luci-0.12.2-12.el5.centos.4.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
Preparing... ########################################### [100%]
1:luci ########################################### [100%]
[root@kmaiti src]#
[root@kmaiti src]# service luci start

The admin user password must be set before the luci can start
To set it, execute (as root):
luci_admin password

[root@kmaiti src]# luci_admin password
The luci site has not been initialized.
To initialize it, execute
/usr/sbin/luci_admin init
[root@kmaiti src]# /usr/sbin/luci_admin init
Initializing the luci server


Creating the 'admin' user

Enter password:
Confirm password:

Please wait...
[root@kmaiti src]#

---------
/etc/rc.d/init.d/luci
/etc/sysconfig/luci


[root@localhost src]# service luci start
Starting luci: Generating https SSL certificates... done
[ OK ]

Point your web browser to https://localhost:8084 to access luci

[root@localhost src]#

Note : You can use " yum install luci "command to do the same.

[root@localhost src]# /usr/sbin/luci_admin init
Initializing the luci server


Creating the 'admin' user

Enter password:
Confirm password:

Please wait...
The admin password has been successfully set.
Generating SSL certificates...
The luci server has been successfully initialized


You must restart the luci server for changes to take effect.

Run "service luci restart" to do so

[root@localhost src]# service luci restart
Shutting down luci: [ OK ]
Starting luci: [ OK ]

Point your web browser to https://localhost:8084 to access luci

[root@localhost src]
==========


RICCI installation :

==========

yum install ricci

Dependencies Resolved

=============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing:
ricci x86_64 0.12.2-12.el5_5.4 rhel-x86_64-server-cluster-5 1.2 M
Installing for dependencies:
cman x86_64 2.0.115-61.el5 rhel-x86_64-server-5-beta 736 k
modcluster x86_64 0.12.1-2.el5 rhel-x86_64-server-cluster-5 333 k
oddjob x86_64 0.27-11.el5 rhel-x86_64-server-5-beta 61 k
oddjob-libs x86_64 0.27-11.el5 rhel-x86_64-server-5-beta 44 k
openais x86_64 0.80.6-28.el5 rhel-x86_64-server-5-beta 400 k
perl-Net-Telnet noarch 3.03-5 rhel-x86_64-server-5 56 k
perl-XML-LibXML x86_64 1.58-6 rhel-x86_64-server-5 229 k
perl-XML-LibXML-Common x86_64 0.13-8.2.2 rhel-x86_64-server-5 16 k
perl-XML-NamespaceSupport noarch 1.09-1.2.1 rhel-x86_64-server-5 15 k
perl-XML-SAX noarch 0.14-8 rhel-x86_64-server-5 77 k
pexpect noarch 2.3-3.el5 rhel-x86_64-server-5 214 k
python-pycurl x86_64 7.15.5.1-8.el5 rhel-x86_64-server-5-beta 73 k

Transaction Summary
=============================================================================================================================================
Install 13 Package(s)
Upgrade 0 Package(s)

Total download size: 3.4 M
Is this ok [y/N]:y
==========

then service ricci start.

Check the port 11111(ricci) which will have to be opened.

Try :)
Read More
Posted in | No comments

Saturday, 25 December 2010

How to configure a High Availability Cluster (Heartbeat) On Linux?

Posted on 03:43 by Unknown
Guys,

You can refer the following steps :

Number of nodes : Two (node1 and node2)
Clustering software : Heart Beat
Service to be high available : http
IP : 192.168.1.1 to be configured on node1
192.168.1.2 to be configured on node2
192.168.1.3 for Heart Beat clustering enabled services(http etc)


==================
1. setup the above two IP on the server and make it sure that uname -n returns node1 or node2
2. yum install heartbeat
make sure that you installed :

heartbeat
heartbeat-pils
heartbeat-stonith

3. configure heartbeat on two node cluster. We will deal with three files. These are:

authkeys
ha.cf
haresources

Now moving to our configuration. But there is one more thing to do, that is to copy these files to the /etc/ha.d directory. In our case we copy these files as given below:

cp /usr/share/doc/heartbeat-2.1.2/authkeys /etc/ha.d/
cp /usr/share/doc/heartbeat-2.1.2/ha.cf /etc/ha.d/
cp /usr/share/doc/heartbeat-2.1.2/haresources /etc/ha.d/

4. Now let's start configuring heartbeat. First we will deal with the authkeys file, we will use authentication method 2 (sha1). For this we will make changes in the authkeys file as below.

vi /etc/ha.d/authkeys

Then add the following lines:

auth 2
2 sha1 test-ha

Change the permission of the authkeys file:

chmod 600 /etc/ha.d/authkeys

5. Moving to our second file (ha.cf) which is the most important. So edit the ha.cf file with vi:

vi /etc/ha.d/ha.cf

Add the following lines in the ha.cf file:

logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
bcast eth0
udpport 694
auto_failback on
node node1
node node2

Note: node1 and node2 are the output generated by

uname -n

6. The final piece of work in our configuration is to edit the haresources file. This file contains the information about resources which we want to highly enable. In our case we want the webserver (httpd) highly available:

On node 1 :-

vi /etc/ha.d/haresources
Add the following line:
node1 192.168.1.3 httpd

On node 2 :-

vi /etc/ha.d/haresources
Add the following line:
node2 192.168.1.3 httpd

7. Copy the /etc/ha.d/ directory from node1 to node2 :

scp -r /etc/ha.d/ root@node2:/etc/

8. As we want httpd highly enabled let's start configuring httpd :

vi /etc/httpd/conf/httpd.conf

Add this line in httpd.conf:

Listen 192.168.1.3:80

9. Copy the /etc/httpd/conf/httpd.conf file to node2:

scp /etc/httpd/conf/httpd.conf root@node2:/etc/httpd/conf/

10. Create the file index.html on both nodes (node1 & node2):

On node1:

echo "node1 apache test server" > /var/www/html/index.html

On node2:

echo "node2 apache test server" > /var/www/html/index.html

11. Now start heartbeat on the primary node1 and slave node2:

/etc/init.d/heartbeat start

12. Open web-browser and type in the URL:

http://192.168.1.3

It will show node1 apache test server.

13. Now stop the hearbeat daemon on node1:

/etc/init.d/heartbeat stop

In your browser type in the URL http://192.168.1.3 and press enter.

It will show node2 apache test server.

14. We don't need to create a virtual network interface and assign an IP address (192.168.1.3) to it. Heartbeat will do this for you, and start the service (httpd) itself. So don't worry about this.

==================

PS : Made it available.

Try :)
Read More
Posted in | No comments

Wednesday, 22 December 2010

How to configure autofs with NFS4?

Posted on 02:43 by Unknown
First install NFS server on the machine.

On NFS client machine do the following :

1. yum install autofs
2. vi /etc/auto.master
and put like :

[root@kmaiti alltestfiles]# cat /etc/auto.master |grep home
/home /etc/auto.home --timeout=60
[root@kmaiti alltestfiles]#

3. Put following in /etc/auto.home :

* -fstype=nfs,rw,nosuid,soft,fsid=0 IPof_nfs_server:/home/&

4. /etc/init.d/autofs start

That's it.

PS: You need to restart the system to view the mounted partitions. df -TH

Try :)
Read More
Posted in | No comments

Tuesday, 21 December 2010

How to install and configure NFSv4 server and client on linux machine?

Posted on 04:03 by Unknown
Guys,

I referred the following steps :

NFS server configure for NFSv4 :

How NFS Works?

NFS consists of at least two main parts: a server and one or more clients. The client remotely accesses the data that is stored on the server machine. In order for this to function properly a few processes have to be configured and running.

The server has to be running the following daemons:

Daemon Description :

nfsd The NFS daemon which services requests from the NFS clients.
mountd The NFS mount daemon which carries out the requests that nfsd(8) passes on to it.
rpcbind This daemon allows NFS clients to discover which port the NFS server is using.

The client can also run a daemon, known as nfsiod. The nfsiod daemon services the requests from the NFS server. This is optional, and improves performance, but is not required for normal and correct operation. See the nfsiod(8)[man 8 nfs] manual page for more information.

Note : I have done it on NFS server RHEL5.x64 and NFS client RHEL6.x64.

NFS server configuration for nfs4 :


[root@vm12 alltestfiles]#yum install nfs-utils nfs4-acl-tools portmap

[root@vm12 alltestfiles]# cat /etc/exports
/var/nfs4testing/ 10.65.211.15(rw,sync,fsid=0) //Share File System /var/nfs4testing
[root@vm12 alltestfiles]#

ps : fsid is very important here.

[root@vm12 alltestfiles]# chkconfig nfs on
[root@vm12 alltestfiles]# chkconfig portmap on
[root@vm12 alltestfiles]# chkconfig --list | grep nfs
nfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@vm12 alltestfiles]# chkconfig --list | grep portmap
portmap 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@vm12 alltestfiles]#

[root@vm12 alltestfiles]# vi /etc/sysconfig/iptables
[root@vm12 alltestfiles]# cat /etc/sysconfig/iptables | grep 10.65.211
-A RH-Firewall-1-INPUT -s 10.65.211.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEP
[root@vm12 alltestfiles]#

[root@vm12 alltestfiles]# vi /etc/hosts.deny
[root@vm12 alltestfiles]# vi /etc/hosts.allow
[root@vm12 alltestfiles]# cat /etc/hosts.deny | grep portmap
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
portmap:ALL
[root@vm12 alltestfiles]# cat /etc/hosts.allow| grep 10.65.211
portmap:10.65.211.0/24
portmap:10.65.192.0/24
[root@vm12 alltestfiles]#

Verify :
[root@vm12 alltestfiles]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 896 status
100024 1 tcp 899 status
100011 1 udp 1000 rquotad
100011 2 udp 1000 rquotad
100011 1 tcp 1003 rquotad
100011 2 tcp 1003 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 60156 nlockmgr
100021 3 udp 60156 nlockmgr
100021 4 udp 60156 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 51539 nlockmgr
100021 3 tcp 51539 nlockmgr
100021 4 tcp 51539 nlockmgr
100005 1 udp 603 mountd
100005 1 tcp 606 mountd
100005 2 udp 603 mountd
100005 2 tcp 606 mountd
100005 3 udp 603 mountd
100005 3 tcp 606 mountd
[root@vm12 alltestfiles]#

or nfsstat

NFS client configure for NFSv4 : -

yum install nfs-utils

[root@kmaiti ~]# hostname -i
10.65.192.160 127.0.0.1
[root@kmaiti ~]#
[root@kmaiti ~]# cat /etc/sysconfig/iptables | grep 2049
#-A RH-Firewall-1-INPUT -s 10.65.192.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT

[root@kmaiti ~]# mount -t nfs 10.65.211.12:/ /mounted/


[root@kmaiti ~]# df -HT | column -t
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/HelpDeskRHEL6-Root
ext4 16G 5.3G 9.5G 36% /
tmpfs tmpfs 2.0G 455k 2.0G 1% /dev/shm
/dev/mapper/HelpDeskRHEL6-NotBackedUp
ext4 8.5G 154M 7.9G 2% /NotBackedUp
/dev/mapper/HelpDeskRHEL6-VirtualMachines
ext4 21G 181M 20G 1% /VirtualMachines
/dev/sda1 ext4 204M 47M 147M 25% /boot
/dev/mapper/HelpDeskRHEL6-Home
ext4 4.3G 263M 3.8G 7% /home
10.65.211.12:/
nfs4 8.3G 1.6G 6.3G 20% /mounted
[root@kmaiti ~]#


[root@kmaiti ~]# cat /etc/fstab | grep mounted
10.65.211.12:/ /mounted nfs4 soft,intr,rsize=8192,wsize=8192,nosuid 0 0
[root@kmaiti ~]#

try :
)
Read More
Posted in | No comments

Monday, 20 December 2010

Which desktop is used by my linux machine?

Posted on 21:31 by Unknown
Guys,

Check the directory : /usr/share/xsessions. It has been defined there. You can also execute the following command to get the result.

-----
[root@kmaiti xsessions]# find /usr/share/xsessions -name "*.desktop" -exec basename "{}" .desktop ";"
gnome
[root@kmaiti xsessions]# pwd
/usr/share/xsessions
[root@kmaiti xsessions]#
-----

Try :)
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • unable connect to socket: No route to host (113)
    Guys, This error message usually comes when you try to access remote linux desktop using vncviewer. Please check the firewall in the linux s...
  • NDMP communication failure error
    Guys, Issue : Netbackup server sends alert NDMP communication failure once everyday. But there is no issue to run scheduled backup jobs. Env...
  • what does it mean by "cman expected_votes="1" two_node="1" in cluster.conf ?
    For two node clusters ordinarily, the loss of quorum after one out of two nodes fails will prevent the remaining node from continuing (if bo...
  • How to make bridge over VLAN?
    How to make bridge over VLAN? Bridging over VLAN's : By constructing a bridge between a "normal" and a "VLAN" ethern...
  • How to verify UDP packet communication between two linux system?
    Guys, Today, I had to check UDP packet communication between linux and a windows system. Main purpose of the windows system was to capturing...
  • How to install pdo_mysql module with php on 64 bit linux machine?
    Guys, The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver ...
  • configure: error: C preprocessor "/lib/cpp" fails sanity check + Resolved
    Guys, I got that error messages when I was going to configure any software on the linux server. I was unable to execute easyapache or ./conf...
  • configure: error: could not find library containing RSA_new
    Guys, It seems you have enabled the SSL option during configuring the package. Please either resolve that dependency or disable the SSL opti...
  • Cannot find config.m4 + phpize +Resolved
    Guys, I got the same error messages and sorted out it. Here is the error that I got. ===== root@server [/home/cpeasyapache/src/php-5.2.9/ext...
  • How to redirect output of script to a file(Need to save log in a file and file should be menioned in the script itself?
    Expectation : @subject Steps : 1. Create a bash script. 2. add line : exec > >(tee /var/log/my_logfile.txt) That's it. All output ...

Categories

  • ACL
  • ESX
  • Linux
  • Storage
  • UCS

Blog Archive

  • ►  2013 (5)
    • ►  May (1)
    • ►  April (3)
    • ►  February (1)
  • ►  2012 (10)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
    • ►  March (3)
    • ►  February (3)
    • ►  January (1)
  • ►  2011 (86)
    • ►  December (3)
    • ►  November (2)
    • ►  September (19)
    • ►  August (9)
    • ►  July (5)
    • ►  June (9)
    • ►  May (12)
    • ►  April (3)
    • ►  March (4)
    • ►  February (5)
    • ►  January (15)
  • ▼  2010 (152)
    • ▼  December (9)
      • unable connect to socket: No route to host (113)
      • How to install frysk on linux rhel5?
      • Flow diagram of systemtap debugging scripting tool?
      • How to remotely access the linux desktop from any ...
      • How to install luci and ricci for managing the clu...
      • How to configure a High Availability Cluster (Hear...
      • How to configure autofs with NFS4?
      • How to install and configure NFSv4 server and clie...
      • Which desktop is used by my linux machine?
    • ►  November (34)
    • ►  October (20)
    • ►  September (14)
    • ►  August (24)
    • ►  July (19)
    • ►  June (3)
    • ►  May (25)
    • ►  April (3)
    • ►  January (1)
Powered by Blogger.