AN!CDB - Cluster Dashboard: Difference between revisions

From Alteeve Wiki
Jump to navigation Jump to search
No edit summary
Line 28: Line 28:
= Installation =
= 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 <span class="code">[[virt-manager]]</span>, 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".
Installing '''AN!CDB''' is very easy now. The instructions are at the page below;


Copy and paste the following commands into a terminal logged in as the <span class="code">root</span>. This will install all needed applications, [[perl]] modules and disable <span class="code">selinux</span> and the firewall. Once you have things working, you may wish to re-enable those.
* [[Installing AN!CDB]]
 
{{warning|1=The dashboard will have password-less SSH access to the cluster nodes. As such, you will want to ensure that the dashboard machine is not on public networks. If you must put it on public networks, be sure to re-enable <span class="code">selinux</span> and the firewall and to take any other security precautions needed for your environment.}}
 
<source lang="bash">
# 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'
#
</source>
 
Make the <span class="code">apache</span> user have a home directory at <span class="code">/var/www/home</span> and enable it's login. This allows the Apache server to have ssh access to the cluster nodes.
 
<source lang="bash">
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
</source>
<source lang="diff">
--- /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
</source>
 
Now test logging in as <span class="code">apache</span>;
 
<source lang="bash">
su - apache
</source>
<source lang="text">
-bash-4.2$
</source>
 
Create the media storage directory.
 
<source lang="bash">
mkdir /var/www/home/media
</source>
 
Now create an SSH key;
 
<source lang="bash">
ssh-keygen -t rsa -N "" -b 4095 -f ~/.ssh/id_rsa
</source>
<source lang="text">
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+ +.++. |
+-----------------+
</source>
 
Still as the <span class="code">apache</span> user, <span class="code">ssh</span> into the two nodes so that you populate the <span class="code">~/.ssh/known_hosts</span> file.
 
<source lang="bash">
ssh root@an-c01n01
ssh root@an-c01n02
</source>
 
Now create the [[ssh]] <span class="code">config</span> 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 <span class="code">htpasswd</span> file with the user account set.
 
<source lang="bash">
htpasswd -c /var/www/home/htpasswd admin
</source>
 
Enter the password twice;
 
<source lang="text">
New password:
Re-type new password:
Adding password for user admin
</source>
 
Now tell apache to require authentication;
 
<source lang="bash">
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
</source>
 
Add the following starting at about line 587;
 
<source lang="text">
    # Password login
    AuthType Basic
    AuthName "AN!Cluster Monitor - Customer Name"
    AuthUserFile /var/www/home/htpasswd
    Require user admin
</source>
 
Confirm the changes;
 
<source lang="bash">
diff -u /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf
</source>
<source lang="diff">
--- /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>
#
</source>
 
== Setup The Cluster Password ==
 
The dashboard needs to know what password to use when manipulating the cluster.
 
<source lang="bash">
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
</source>
 
== Clone the git Repo ==
 
<source lang="bash">
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
</source>
 
Make everything the right permissions.
 
<source lang="bash">
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
</source>
 
Edit the configuration file for your cluster(s):
 
<source lang="bash">
vim /etc/an/an.conf
</source>
 
== Configure And Start AN!CDB ==
 
Here we get OS specific;
 
=== init.d Based Systems ===
 
Restart apache.
 
<source lang="bash">
chkconfig httpd on
/etc/init.d/httpd start
</source>
 
Edit or disable the firewalls. If you are editing, allow incoming connections on [[TCP]] port <span class="code">80</span>. Here we simply disable it.
 
<source lang="bash">
chkconfig iptables off
chkconfig ip6tables off
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop
</source>
 
== First Login ==
 
Now when you try to log into AN!CDB you will have to enter the user name <span class="code">admin</span> and the password you set above.


= Using AN!CDB =
= Using AN!CDB =

Revision as of 17:13, 27 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

Installing AN!CDB is very easy now. The instructions are at the page below;

Using AN!CDB

Installing Server Operating Systems

KVM/QEMU maintained list of tested guest OS.

Windows 7

Windows 7 Professional has a limit of two sockets. The hypervisor presents each core as a socket, so Windows 7 will only use up to two cores.

Solaris 11

There is a harmless but verbose bug when using Solaris 11. You will see errors like:

WARNING: /pci@0,0/pci1af4,1100@1,2 (uhci0): No SOF interrupts have been received
, this USB UHCI host controller is unusable

Ignore this until the install is complete. Once the OS is installed, run:

rem_drv uhci

The errors will no longer appear.

Solution found here.

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.