AN!CDB - Cluster Dashboard

From Alteeve Wiki
Jump to navigation Jump to search

 AN!Wiki :: AN!CDB - Cluster Dashboard

The AN!CDB, the Alteeve's Niche! Cluster Dashboard, is a management tool for clusters built following the 2-Node Red Hat KVM Cluster Tutorial.

It provides;

  • A single view of all cluster components and their current status.
  • Control of the cluster nodes. Nodes can be:
    • Powered On, Powered Off and Fenced
    • Join to and withdrawn from the cluster
  • Control of the virtual machines. VMs can be:
    • Booted up, gracefully shut down and forced off
    • Migrated between nodes

The program was written with the user in mind. A user of AN!CDB needs minimal prior knowledge. Users who have never used a cluster before can be shown how to manage their cluster in about an hour, on average.

AN!CDB is designed to run on a machine outside of the cluster. The only customization needed is for the cluster name and the name of the nodes be added to the program. Once done, AN!CDB will collect and cache everything needed to control the cluster, even when both nodes are offline.

Installation

AN!CDB is designed to run on a stand-alone PC, outside of the cluster. Most users have a machine on which they run virt-manager, which is perfect for this application. This tutorial will assume that the machine is running CentOS or RHEL version 6.x, 64-bit. It is also assumed that it has been installed as a "Graphical Desktop".

# For all systems
yum -y install cpan perl-YAML perl-Net-SSLeay gcc make perl-CGI fence-agents syslinux

# For AN!CDB server only.
yum -y install httpd virt-manager

# Automate the install of the perl modules.
export PERL_MM_USE_DEFAULT=1
perl -MCPAN -e 'install Throwable::Error'
perl -MCPAN -e 'install Email::Sender::Transport::SMTP::TLS'
#

Make the apache have a home directory at /var/www/home and enable it's login.

mkdir /var/www/home
chown apache:apache /var/www/home/
cp /etc/passwd ~/passwd.orig
sed -i 's/apache\(.*\)www:\/sbin\/nologin/apache\1www\/home:\/bin\/bash/g' /etc/passwd
diff -u ~/passwd.orig /etc/passwd
--- /root/passwd.orig	2012-08-24 13:40:40.943151701 -0400
+++ /etc/passwd	2012-08-24 13:45:19.391981540 -0400
@@ -38,5 +38,5 @@
 qemu:x:107:107:qemu user:/:/sbin/nologin
 radvd:x:75:75:radvd user:/:/sbin/nologin
 tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin
-apache:x:48:48:Apache:/var/www:/sbin/nologin
+apache:x:48:48:Apache:/var/www/home:/bin/bash
 dhcpd:x:177:177:DHCP server:/:/sbin/nologin

Now test logging in as apache;

su - apache
-bash-4.2$

Now create an SSH key;

ssh-keygen -t rsa -N "" -b 4095 -f ~/.ssh/id_rsa
Generating public/private rsa key pair.
Your identification has been saved in /var/www/home/.ssh/id_rsa.
Your public key has been saved in /var/www/home/.ssh/id_rsa.pub.
The key fingerprint is:
00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff apache@cmonitor.alteeve.ca
The key's randomart image is:
+--[ RSA 4095]----+
|                 |
|                 |
|                 |
|       .         |
|      . S        |
|       V .  .    |
|      + s  . +   |
|     +. .+. +.+. |
|    o.R.o+ +.++. |
+-----------------+

Now create the ssh config if you need special ports to reach the nodes (only needed if you're behind a firewall and using port forwards).

Copy your ssh public key to the target nodes;

Setup Apache To Require a Password

First, create an htpasswd file with the user account set.

htpasswd -c /var/www/home/htpasswd admin

Enter the password twice;

New password: 
Re-type new password: 
Adding password for user admin

Now tell apache to require authentication;

cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig
vim /etc/httpd/conf/httpd.conf
diff -u /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf
--- /etc/httpd/conf/httpd.conf.orig	2012-08-27 10:27:41.125566485 -0400
+++ /etc/httpd/conf/httpd.conf	2012-08-27 10:33:37.842522263 -0400
@@ -342,6 +342,11 @@
     Order allow,deny
     Allow from all
 
+    # Password login
+    AuthType Basic
+    AuthName "AN!Cluster Monitor - Customer Name"
+    AuthUserFile /var/www/home/htpasswd
+    Require user admin
 </Directory>
 
 #

Finally, restart apache.

systemctl restart httpd.service 
systemctl status httpd.service
httpd.service - The Apache HTTP Server (prefork MPM)
	  Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
	  Active: active (running) since Mon, 27 Aug 2012 10:34:33 -0400; 1s ago
	 Process: 28243 ExecStop=/usr/sbin/httpd $OPTIONS -k stop (code=exited, status=0/SUCCESS)
	 Process: 28247 ExecStart=/usr/sbin/httpd $OPTIONS -k start (code=exited, status=0/SUCCESS)
	Main PID: 28248 (httpd)
	  CGroup: name=systemd:/system/httpd.service
		  ├ 28248 /usr/sbin/httpd -k start
		  ├ 28249 /usr/sbin/httpd -k start
		  ├ 28250 /usr/sbin/httpd -k start
		  ├ 28251 /usr/sbin/httpd -k start
		  ├ 28252 /usr/sbin/httpd -k start
		  ├ 28253 /usr/sbin/httpd -k start
		  ├ 28254 /usr/sbin/httpd -k start
		  ├ 28255 /usr/sbin/httpd -k start
		  └ 28256 /usr/sbin/httpd -k start

Now when you try to log into AN!CDB you will have to enter the user name admin and the password you set above.


ASUS EeeBox Specific Notes

This section is mainly for our use, but it might prove useful to anyone looking to use the same hardware for the cluster monitor machine.

BIOS

Press <F2> at boot to enter setup.

  • Advanced > ACPI Settings > Enable Hibernation = Disabled
  • Advanced > ACPI Settings > ACPI Sleep State = Suspend Disabled
  • Advanced > Onboard Devices Configuration > Realtek PXE OPROM = Enables
  • Advanced > South Bridge > SB SATA Configuration > OnChip SATA Type = AHCI
  • Advanced > APM > Restore AC Power Loss = Last State

Save, reboot and re-enter the BIOS (needed to add 'PXE boot' to the boot options).

  • Boot > Setup Prompt Timeout = 5
  • Boot > Full Screen Logo = Disabled
  • Boot > Boot Option #1 = Realtek PXE B02 D00

Save and exit. You can now install the OS via PXE. If you plan to leave this machine on a network with an existing PXE server, be sure the change the boot priority to put PXE at the bottom of the list after you finish the install.

OS Install Notes

The internal hard drives shows up as /dev/sdb, so update any kickstart scripts you use accordingly.

Once a minimal OS install is complete, run, follow these tutorials;

Setting Up PXE To Support The Nodes

We will offer two types of installers via the cluster monitor; Rebuilt existing nodes and build generic nodes.

  • The first will include backups of the entire target machine.
  • The later will not setup the target's network or SSH.

random notes:

  • Mount the ISO on boot.
echo /var/www/html/c6/x86_64/iso/CentOS-6.3-x86_64-bin-DVD1.iso /var/www/html/c6/x86_64/img/ auto loop 0 0 >> /etc/fstab
  • Show full path at the console prompt.
echo export PS1='\h:\w\$ ' >> ~/.bashrc

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.