Master node

From ISPWiki

Jump to: navigation, search

Contents

Prerequisites

If the second network interface is not present, jump this step.

Open /etc/network/interfaces

 # nano /etc/network/interfaces

add the lines

 auto ethX
 iface ethX inet static
     address 10.0.0.6
     netmask 255.0.0.0

where X is the network interface number.

Run the command below to apply the changes:

 # /etc/init.d/networking restart

Installing and customizing libnss-extrausers

Install an additional module for the NSS service that will provide the system with user and group information from additional files: /var/lib/extrausers/passwd, /var/lib/extrausers/shadow and /var/lib/extrausers/groups.

 # apt-get install libnss-extrausers

Open /etc/nsswitch.conf

 # nano /etc/nsswitch.conf

change the passwd, group and shadow options

 ...
 passwd: compat extrausers
 group:  compat extrausers
 shadow: compat extrausers
 ...

Installing and customizing sshfs

Enter SSH to install the utility for the network file system:

 # apt-get install sshfs

Open /etc/rc.local

 # nano /etc/rc.local

add the line

 /usr/bin/sshfs 10.0.0.1:/storage/etc /var/lib/extrausers

where 10.0.0.1 is a storage server floating IP-address.

Create the /root/.ssh directory:

 # mkdir /root/.ssh

Get a public key of the SSH server storage:

 # ssh root@10.0.0.1 "cat /root/.ssh/id_rsa.pub"

Open /root/.ssh/known_hosts

 # nano /root/.ssh/known_hosts

add the line

 10.0.0.1 X

where X is the SSH server public key.

Create a SSH public SSH:

 # ssh-keygen -t rsa -f /root/.ssh/id_rsa -N ""

Get the public SSH key

 # cat /root/.ssh/id_rsa.pub

add it on the list of authorized keys.

 # ssh root@10.0.0.1 "echo \"X\" >> /root/.ssh/authorized_keys"

where X is a local public SSH key.

Thus, you have interchanged the public keys with the storage server.

Installing and customizing the NFS-server

Install the utility for the NFS-server:

 # apt-get install nfs-common

Open /etc/default/nfs-common

 # nano /etc/default/nfs-common

change NEED_IDMAPD

 ...
 NEED_IDMAPD="yes"
 ...

Open /etc/idmapd.conf

 # nano /etc/idmapd.conf

to change the Domain options in the General section and Method in the Translation section.

 [General]
 Domain = cluster.lan
 ...
 [Translation]
 Method = nsswitch
 ...

Restart the NFS-server with the command:

 # /etc/init.d/nfs-common restart

Configuring the SSH-server

Open /etc/ssh/sshd_config

 # nano /etc/ssh/sshd_config

to change the Port option

 ...
 Port 222
 ...

for the SSH-server that runs from the storage not to conflict a master node SSH server.

Restart the SSH-server with the command:

 # /etc/init.d/ssh restart

Connecting the storage

Create the following directories that are necessary for connecting the storage:

 # mkdir -p /storage \
            /var/run-cluster/mysqld \
            /var/run-cluster/apache2 \
            /var/cluster/spool/exim4 \
            /var/cluster/log/account \
            /var/cluster/lib/exim4 \
            

Open /etc/fstab

 # nano /etc/fstab

add the line

 10.0.0.1:/ /storage nfs4 rw,rsize=65000,wsize=65000,proto=tcp,soft,intr,noatime,noauto,actimeo=240,acregmin=10,acdirmin=30,timeo=50,sync 0 0

Open /etc/rc.local

 # nano /etc/rc.local

to add the following lines

 /bin/mount /storage
 /bin/mount --bind /dev /storage/dev
 /bin/mount --bind /dev/pts /storage/dev/pts
 /bin/mount --bind /proc /storage/proc
 /bin/mount --bind /tmp /storage/tmp
 /bin/mount --bind /lib/modules /storage/lib/modules
 /bin/mount --bind /var/run-cluster /storage/var/run
 /bin/mount --bind /var/cache/debconf /storage/var/cache/debconf
 /bin/mount --bind /var/cluster/spool/exim4 /storage/var/spool/exim4
 /bin/mount --bind /var/cluster/log/account /storage/var/log/account
 /bin/mount --bind /var/cluster/lib/exim4 /storage/var/lib/exim4

Connect the storage:

 # chmod +x /etc/rc.local && /etc/rc.local

Installing and configuring ISPmanager Cluster

Create the following directories to install and run ISPmanager Cluster:

 # mkdir -p /storage/var/lib/exim4 \
            /storage/var/spool/exim4 \
            /storage/var/log/account \
            /storage/home/httpd-logs \
            /storage/usr/local/ispmgr/etc/cluster_apache/users-conf.d

Copy the /etc/hosts file into the storage:

 # cp /etc/hosts /storage/etc/

Download ISPmanager Cluster:

 # chroot /storage wget -c http://download.ispsystem.com/Linux-cc6/`uname -m`/ISPmanager-Cluster/install.tgz -O /tmp/install.tgz

Unzip ISPmanager Cluster:

 # chroot /storage tar xvzpf /tmp/install.tgz -C /usr/local/ispmgr

Download mindterm.jar:

 # chroot /storage wget -c http://download.ispsystem.com/mindterm.jar -O /usr/local/ispmgr/skins/userdata/mindterm.jar

Download the ISPmanager Cluster license:

 # chroot /storage wget -q http://lic.ispsystem.com/ispmgr.lic?ip=X\ -O /usr/local/ispmgr/etc/ispmgr.lic

where X is the real IP-address of the master node to which a license is assigned.

Install ISPmanager Cluster:

 # chroot /storage /usr/local/ispmgr/sbin/ispinstall -s -c www -c ftp -c smtp -c pop3 -c dns -c php -c myadmin

Use the command below to monitor the installation process:

 # chroot /storage tail -f /usr/local/ispmgr/var/install.log

Open /storage/etc/apache2/ports.conf

 # nano /storage/etc/apache2/ports.conf

to comment out the following lines

 ...
 # NameVirtualHost *:80
 # Listen 8080
 ...

Install apache2-mpm-itk:

 # chroot /storage apt-get install apache2-mpm-itk

Create a file with with built-in encodings:

 # chroot /storage sh -c "iconv -l | cut -f1 -d\\ | tr -d / > /usr/local/ispmgr/etc/filemgr.enc"

Create and open /storage/usr/local/ispmgr/etc/cluster_roles/init.d/config:

 # chroot /storage sh -c "touch /usr/local/ispmgr/etc/cluster_roles/init.d/config && nano /usr/local/ispmgr/etc/cluster_roles/init.d/config"

to add the line

 P_APACHE=/usr/sbin/apache2

Create /storage/usr/local/ispmgr/etc/cluster_apache/global-fake.conf:

 # chroot /storage cp /usr/local/ispmgr/etc/cluster_apache/global.conf /usr/local/ispmgr/etc/cluster_apache/global-fake.conf

Open /storage/usr/local/ispmgr/etc/ispmgr.conf:

 # nano /storage/usr/local/ispmgr/etc/ispmgr.conf

to add the following lines

 ...
 HttpPort 81
 Option ApacheMPM
 path DefaultHomeDir /home
 path repquota /usr/local/ispmgr/sbin/repquota
 path setquota /usr/local/ispmgr/sbin/setquota
 path httpd-include /usr/local/ispmgr/etc/cluster_apache/users-conf.d/
 path httpd.conf /usr/local/ispmgr/etc/cluster_apache/global-fake.conf
 ...

Stop ISPmanager Cluster:

 # chroot /storage /usr/local/ispmgr/sbin/mgrctl -m ispmgr exit

Install libapache2-mod-macro:

 # chroot /storage apt-get install libapache2-mod-macro

Install the OpenSSH-server:

 # chroot /storage apt-get install openssh-server

Create a public SSH key for ISPmanager Cluster:

 # chroot /storage ssh-keygen -t rsa -f /usr/local/ispmgr/etc/ssh-key -N ""

Get the SSH public key for ISPmanager Cluster:

 # cat /storage/usr/local/ispmgr/etc/ssh-key.pub

and put it on the list of authorized key on the storage server

 # ssh root@10.0.0.1 "echo \"X\" >> /root/.ssh/authorized_keys"

where X is a newly created public SSH key.

Install acct:

 # chroot /storage apt-get install acct

Install openntpd:

 # chroot /storage apt-get install openntpd

The latest versions of GNU/Linux Debian may not contain openntpd. If so, execute the following command:

 # chroot /storage apt-get install ntp

Set up the root password in the storage (cluster password):

 # chroot /storage /usr/local/ispmgr/sbin/mgrctl -m ispmgr usrparam passwd=X sok=ok

where X is a cluster password.

Open /etc/rc.local

 # nano /etc/rc.local

to add the following lines

 /usr/sbin/chroot /storage /etc/init.d/openntpd start
 /usr/sbin/chroot /storage /usr/local/ispmgr/etc/cluster_roles/init.d/ntpdate start
 /usr/sbin/chroot /storage /etc/init.d/exim4 start
 /usr/sbin/chroot /storage /etc/init.d/acct start
 /usr/sbin/chroot /storage /etc/init.d/networking start
 /usr/sbin/chroot /storage /etc/init.d/bind9 start
 /usr/sbin/chroot /storage /etc/init.d/ssh start
 /usr/sbin/chroot /storage /etc/init.d/dovecot start
 /usr/sbin/chroot /storage /etc/init.d/proftpd start
 /usr/sbin/chroot /storage /etc/init.d/cron start

Statistics collection (accounting)

Enter the chroot environment and create the following cron job:

 0	*	*	*	*	/usr/local/ispmgr/sbin/acctstat -x

Make sure the following line is specified in the configuration file

 path pacct /var/log/account/pacct

Collecting error-logs from HTTP-backends

In the chroot environment add the following cron job:

 */30	*	*	*	*	/usr/local/ispmgr/sbin/logfetch -t error

Troubleshooting

# /usr/local/ispmgr/sbin/repquota -u -n /storage
/usr/local/ispmgr/sbin/repquota: 3: /usr/local/ispmgr/sbin/clusterctl: not found

The issue can be resolved by changing`/usr/local/ispmgr/sbin/clusterctl --role STORAGE role_executors`into the floating IP-address of the storage (or a static one if you use a single storage) in the files /usr/local/ispmgr/sbin/setquota and /usr/local/ispmgr/sbin/repquota.

Was this helpful? Yes | No
Personal tools