Tag Archives: client

GlusterFS 3: mount client to raid

How to setup replication of GlusterFS (raid-1) you can read in my previous article.

Next step is mounting client to this cluster.

Copy content of your volume ( for me it's /var/lib/glusterd/vols/AO/AO-fuse.vol ) to the client machine in the /etc/glusterfs/AO.vol and mount it to mountpoint:

glusterfs -f /etc/glusterfs/AO.vol /mnt/glusterfs/

edit fstab:

/etc/glusterfs/AO.vol /mnt/glusterfs/ glusterfs defaults 0 0

Now you can stop one of the master servers and check that your connection is fine !

puppet: step-by-step

Server:

apt-get install puppet puppetmaster
insert into /etc/puppet/manifests/site.pp

1
2
3
4
5
6
7
8
9
10
11
12
class common {
  file { "/tmp/testfile":
    owner => root,
    group => admin,
    mode => 664,
    ensure => present
  }
}

node default {
  include common
}

/etc/init.d/puppetmaster restart

Client:

apt-get install puppet

1
openssl s_client -connect 127.0.0.1:8140 |grep subject
1
2
...
subject=/CN=puppet-master.local

add to /etc/puppet/puppet.conf

1
server=puppet-master.local
1
puppetd --verbose --test

Server:

1
puppetca --sign --all

 

Client:

1
puppetd --verbose --test


/etc/init.d/puppet start

Subversion client: wrong default permissions

Default permissions on the folder with plaintext passwords from SVN:

ls -la /home/alter/.subversion/auth/svn.simple

drwxrwxr-x. 2 alter alter 4096 нояб. 7 16:44 .
drwxrwxr-x. 6 alter alter 4096 июня 14 2011 ...
-rw-r--r-- . 1 alter alter 144 июля 18 2011 28c62da73b202226d356b9ab8f841daa
-rw-rw-r-- . 1 alter alter 141 нояб. 7 16:44 292a2b271c421acc9002974b69090349
-rw-r--r-- . 1 alter alter 144 июля 19 2011 7ece931cd5b8565388b0ae20754c3215
-rw-r--r-- . 1 alter alter 132 июля 5 2011 c752ec77a7ea7af3a13b7116f986bd95

It's a holy shit !!

chmod -R 0600 /home/alter/.subversion/auth/
chmod -R +X /home/alter/.subversion/auth/

ls -la /home/alter/.subversion/auth/svn.simple

drwx--x--x. 2 alter alter 4096 нояб. 7 16:44 .
drwx--x--x. 6 alter alter 4096 июня 14 2011 ...
-rw------- . 1 alter alter 144 июля 18 2011 28c62da73b202226d356b9ab8f841daa
-rw------- . 1 alter alter 141 нояб. 7 16:44 292a2b271c421acc9002974b69090349
-rw------- . 1 alter alter 144 июля 19 2011 7ece931cd5b8565388b0ae20754c3215
-rw------- . 1 alter alter 132 июля 5 2011 c752ec77a7ea7af3a13b7116f986bd95

Fedora: runscript (example: openvpn client)

/etc/init.d/opevpn-home-client

#!/bin/bash
#
# Run-level Startup script for the OpenVPN client
#
# chkconfig: 345 91 19
# description: Startup/Shutdown OpenVPN client 
OVPN_HOME="/home/alter/ovpn/"
case "$1" in
    start)
        echo -n "Starting OpenVPN home client: "
        cd $OVPN_HOME && /usr/sbin/openvpn ovpn.conf
        echo "OK"
        ;;
    stop)
        echo -n "Shutdown OpenVPN home client: "
        killall openvpn
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart"
        exit 1
esac
exit 0
chmod +x /etc/init.d/opevpn-home-client
chkconfig --add openvpn-home-client 

nagios hdd smart

Client side

aptitude install nagios-nrpe-server nagios-plugins-basic smartmontools

# netstat -an | grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN

edit /etc/nagios/nrpe.cfg

allowed_hosts=127.0.0.1,195.43.68.2

dont_blame_nrpe=1

command[check_smart]=/usr/lib/nagios/plugins/check_smart -t -d $ARG1$

/etc/init.d/nagios-nrpe-server restart

wget -P /usr/lib/nagios/plugins/ http://dl.dropbox.com/u/5742349/check_smart

chmod +x /usr/lib/nagios/plugins/check_smart

echo «nagios ALL=(ALL) NOPASSWD:/usr/sbin/smartctl» >> /etc/sudoers

 

Server side

edit /etc/nagios3/conf.d/group.cfg

define hostgroup{
hostgroup_name          check_lnx_smart0
alias Linux S.M.A.R.T TEST Disk 0
members server1,server2,server3
}
define hostgroup{
hostgroup_name          check_lnx_smart1
alias Linux S.M.A.R.T TEST Disk 1
members server1,server3
}

 

edit /etc/nagios3/conf.d/services.cfg

define service{
use                     generic-service
hostgroup_name          check_lnx_smart0
service_description     Linux SMART Disk sda
check_command           check_nrpe_smart!/dev/sda
check_interval          720
}

define service{
use                     generic-service
hostgroup_name          check_lnx_smart1
service_description     Linux SMART Disk sdb
check_command           check_nrpe_smart!/dev/sdb
check_interval          720
}

/etc/init.d/nagios3 reload