AN!CDB - Cluster Dashboard: Difference between revisions

From Alteeve Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{header}}
{{header}}
[[image:header_screenshot.png|thumb|300px|Und Dashboard!]]


'''AN!CDB''', the '''Alteeve's Niche! Cluster Dashboard''', is a management tool for clusters built following the [[2-Node Red Hat KVM Cluster Tutorial]].
'''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's first and foremost goal is to be extremely easy to use.
It's first and foremost goal is to be extremely easy to use. No special skills or understanding of HA is required!


To achieve this ease of use, the cluster must be built to fairly specific requirements. Simplicity of use requires many assumptions be made.
To achieve this ease of use, the cluster must be built to fairly specific requirements. Simplicity of use requires many assumptions be made.
Line 9: Line 11:
'''AN!CDB''' provides;
'''AN!CDB''' provides;
* A single view of all cluster components and their current status.
* A single view of all cluster components and their current status.
* Control of the cluster nodes. Nodes can be:
** Control of the cluster nodes. Nodes can be:
** Powered On, Powered Off and Fenced
*** Powered On, Powered Off and Fenced
** Join to and withdrawn from the cluster
*** Join to and withdrawn from the cluster
* Control of the virtual machines. VMs can be:
** Control of the virtual servers. Servers can be:
** Booted up, gracefully shut down and forced off
*** Booted up, gracefully shut down and forced off
** Migrated between nodes
*** Migrated between nodes
 
** Create, modify and delete servers;
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.  
*** Create and upload installation and driver media
*** Provision new servers, installing from media just like bare-iron servers
*** Insert and Eject CD/DVD images
*** Change allocated RAM and CPUs
*** Delete servers that are no longer needed.


'''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.
'''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.

Revision as of 16:21, 23 July 2013

 AN!Wiki :: AN!CDB - Cluster Dashboard

File:Header screenshot.png
Und Dashboard!

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's first and foremost goal is to be extremely easy to use. No special skills or understanding of HA is required!

To achieve this ease of use, the cluster must be built to fairly specific requirements. Simplicity of use requires many assumptions be made.

AN!CDB 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 servers. Servers can be:
      • Booted up, gracefully shut down and forced off
      • Migrated between nodes
    • Create, modify and delete servers;
      • Create and upload installation and driver media
      • Provision new servers, installing from media just like bare-iron servers
      • Insert and Eject CD/DVD images
      • Change allocated RAM and CPUs
      • Delete servers that are no longer needed.

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".

Copy and paste the following commands into a terminal logged in as the root. This will install all needed applications, perl modules and disable selinux and the firewall. Once you have things working, you may wish to re-enable those.

# For all systems
yum -y install cpan perl-YAML-Tiny perl-Net-SSLeay gcc make perl-CGI fence-agents syslinux openssl-devel
yum -y groupinstall development
sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
setenforce 0
chkconfig iptables off
chkconfig ip6tables off
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop

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

# Automate the install of the perl modules.
export PERL_MM_USE_DEFAULT=1
perl -MCPAN -e 'install("YAML")'
perl -MCPAN -e 'install Moose::Role'
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$

Create the media storage directory.

mkdir /var/www/home/media

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+ +.++. |
+-----------------+

Still as the apache user, ssh into the two nodes so that you populate the ~/.ssh/known_hosts file.

ssh root@an-c01n01
ssh root@an-c01n02

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
sed -i 's/Timeout 60/Timeout 6000/' /etc/httpd/conf/httpd.conf
vim /etc/httpd/conf/httpd.conf

Add the following starting at about line 587;

    # Password login
    AuthType Basic
    AuthName "AN!Cluster Monitor - Customer Name"
    AuthUserFile /var/www/home/htpasswd
    Require user admin

Confirm the changes;

diff -u /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf
--- /etc/httpd/conf/httpd.conf.orig	2012-12-06 00:45:31.535290634 -0500
+++ /etc/httpd/conf/httpd.conf	2012-12-06 00:46:19.459290648 -0500
@@ -584,6 +584,11 @@
     Options None
     Order allow,deny
     Allow from all
+    # Password login
+    AuthType Basic
+    AuthName "AN!Cluster Monitor - Demo - an-m01"
+    AuthUserFile /var/www/home/htpasswd
+    Require user admin
 </Directory>
 
 #

Setup The Cluster Password

The dashboard needs to know what password to use when manipulating the cluster.

echo "xx-cluster-YY = \"your password\"" > /var/www/home/ricci_pw.txt
chown apache:apache /var/www/home/ricci_pw.txt
chmod 640 /var/www/home/ricci_pw.txt

Clone the git Repo

cd ~
git clone git://github.com/digimer/an-cdb.git
rsync -av an-cdb/html /var/www/
rsync -av an-cdb/cgi-bin /var/www/
rsync -av an-cdb/tools /var/www/
mkdir /var/www/home/status
mkdir /etc/an
rsync -av an-cdb/an.conf /etc/an/
o=$(whereis gethostip | awk '{print $2}') ; sed -e s#/bin/gethostip#${o}# -i /var/www/cgi-bin/an-cdb
touch /var/log/an-cdb.log
touch /var/log/an-mc.log

Make everything the right permissions.

chown -R apache:apache /var/www/*
chown apache:apache /var/log/an-cdb.log
chown apache:apache /var/log/an-*
chown root:root /var/www/tools/check_dvd
chown root:root /var/www/tools/do_dd
chmod 6755 /var/www/tools/check_dvd
chmod 6755 /var/www/tools/do_dd

Edit the configuration file for your cluster(s):

vim /etc/an/an.conf

Configure And Start AN!CDB

Here we get OS specific;

init.d Based Systems

Restart apache.

chkconfig httpd on
/etc/init.d/httpd start

Edit or disable the firewalls. If you are editing, allow incoming connections on TCP port 80. Here we simply disable it.

chkconfig iptables off
chkconfig ip6tables off
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop

First Login

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

Using AN!CDB

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.

Model EB1033

BIOS

Press <F2> at boot to enter setup.

  • Advanced > APM > Resore AC Power Loss = Last State
  • Advanced > Onboard Devices Configuration > Onboard WLAN = Disabled
  • Advanced > Onboard Devices Configuration > Onboard Audio = Disabled
  • Boot > Full Screen Logo = Disabled

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;

Model EB1021

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.