resource r0 { protocol C; incon-degr-cmd "echo '!DRBD! pri on incon-degr' wall ; sleep 60 ; halt -f";



Similar documents
Building Elastix-2.4 High Availability Clusters with DRBD and Heartbeat (using a single NIC)

High Availability with DRBD & Heartbeat. Chris Barber

Installation. Installation centreon + nagios mai LISTE DES PRE-REQUIS. Nagios/centreon Paquets divers. 1.1.

High Availability Low Dollar Clustered Storage

Open-Xchange Server High Availability

Twin Peaks Software High Availability and Disaster Recovery Solution For Linux Server

ZCP trunk (build 50384) Zarafa Collaboration Platform. Zarafa HA Manual

Load Balancing/High Availability Configuration for neoninsight Server

INUVIKA OVD INSTALLING INUVIKA OVD ON UBUNTU (TRUSTY TAHR)

High Availability, Replicating, Load Balanced MySQL Databases Oliver Hookins Systems Administrator Network Fixinator Script Hacker All round su

High availability infrastructures for TYPO3 Websites

NRPE Documentation CONTENTS. 1. Introduction... a) Purpose... b) Design Overview Example Uses... a) Direct Checks... b) Indirect Checks...

Single Node Hadoop Cluster Setup

Chapter 1. Backup service

IMPLEMENTATION OF CIPA - PUDUCHERRY UT SERVER MANAGEMENT. Client/Server Installation Notes - Prepared by NIC, Puducherry UT.

System and Network Monitoring With Zabbix

Resource Manager Corosync/DRBD HA Installation Guide

1. Configuring Apache2 Load Balancer with failover mechanism

Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4

Repris de : Version Debian (de base)

PRM and DRBD tutorial. Yves Trudeau October 2012

Installation Guide for AmiRNA and WMD3 Release 3.1

Using Cacti To Graph MySQL s Metrics

Monitoring Netflow with NFsen

Perforce Helix Threat Detection On-Premise Deployment Guide

A technical whitepaper describing steps to setup a Private Cloud using the Eucalyptus Private Cloud Software and Xen hypervisor.

Configuring Ubuntu Server as a Firewall and Reverse Proxy for OWA 2007 Configuration Guide

Back Up Linux And Windows Systems With BackupPC

GeBro-BACKUP. Die Online-Datensicherung. Manual Pro Backup Client on a NAS

Installing MooseFS Step by Step Tutorial

OS Installation: CentOS 5.8

Overview: Clustering MySQL with DRBD & Pacemaker

Hardening web application (DOS and Application firewalls. Margus Ernits

GroundWork Monitor Open Source Installation Guide

NoMachine Enterprise Products, Cloud Server Installation and Configuration Guide

2. Boot using the Debian Net Install cd and when prompted to continue type "linux26", this will load the 2.6 kernel

Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch

Support ovirt on Ubuntu

ULTEO OPEN VIRTUAL DESKTOP UBUNTU (PRECISE PANGOLIN) SUPPORT

Procedure to Create and Duplicate Master LiveUSB Stick

HADOOP - MULTI NODE CLUSTER

Network Monitoring As a Layer of Security

Ubuntu 下 的 云 计 算. UbuntuChin 互 动 社 区 王 大 亮

Ubuntu Professional Training Course Overview (E-learning, Ubuntu LTS)

Newton Linux User Group Graphing SNMP with Cacti and RRDtool

itixi Ubuntu Server Deployment How-To/Information

Knowledge is Power. He who gets wisdom loves his own soul; he who cherishes understanding prospers. (Proverbs 19:8)

Configuring an OpenNMS Stand-by Server

Monitoring a Linux Mail Server

An A-Z Index of the Apple OS X command line (TERMINAL) The tcsh command shell of Darwin (the open source core of OSX)

Partek Flow Installation Guide

The objective of this lab is to learn how to set up an environment for running distributed Hadoop applications.

Installing Dspace 1.8 on Ubuntu 12.04

研 發 專 案 原 始 程 式 碼 安 裝 及 操 作 手 冊. Version 0.1

How to install RADIUSdesk on CentOS 6.4 using Nginx

Network Management & Monitoring

Installation & Configuration Guide for Solaris 8

Univention Corporate Server. Extended domain services documentation

Partitioning. Files on the Hard Drive. Administration of Operating Systems DO2003. Partition = Binder with index. Write file = Insert document

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

VoIP monitor sniffer manual

Opennebula and The Xen Hypervisor

Running Kmeans Mapreduce code on Amazon AWS

Cacti The ULTIMATE Management Solution

Advantech AE Technical Share Document

High Availability Low Dollar Load Balancing

OSM Tile Server. 1 Task Description & Background. Contents. (Version 2) <frederik.ramm@geofabrik.de>,

This howto is also a bit old now. But I thought of uploading it in the howtos section, as it still works.

Contents Set up Cassandra Cluster using Datastax Community Edition on Amazon EC2 Installing OpsCenter on Amazon AMI References Contact

High Availability and Backup Strategies for the Lustre MDS Server

Requirements for Rosetta Installation. Version 4.2

Using New Relic to Monitor Your Servers

Backup of ESXi Virtual Machines using Affa

Basic Linux & Package Management. Original slides from GTFO Security

Installation Instructions (2.8.8)

INASP: Effective Network Management Workshops

2.1 Hadoop a. Hadoop Installation & Configuration

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Creating a DUO MFA Service in AWS

Installation GENTOO + RAID sur VMWARE

Installation Guide. Copyright (c) 2015 The OpenNMS Group, Inc. OpenNMS SNAPSHOT Last updated :19:20 EDT

Using Google Compute Engine

BUILDING A HYBRID CLOUD WITH OpenNebula. OpenNebula connecting with Private cloud [KVM hypervisor]and Public cloud [Amazon EC2]

Deploying MongoDB and Hadoop to Amazon Web Services

Tutorial 0A Programming on the command line

Installation and Configuration Documentation

Intro to Docker for CMS

Firebird on Linux. Author: Philippe Makowski IBPhoenix Licence: Public Documentation License Date:

Setting Up Mac OS X 10.4 Server and Clients for Xgrid, Xgrid Enabled OpenMPI, LAM-MPI, and MPICH2

Configuration of High Performance Computing for Medical Imaging and Processing. SunGridEngine 6.2u5

CipherMail Gateway Installation Guide

Installing Platform RTM. Platform RTM Version Release date: October 2011

Linux System Administration on Red Hat

Secure File Transfer Installation. Sender Recipient Attached FIles Pages Date. Development Internal/External None 11 6/23/08

Creating a NAS with Ubuntu Server

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu

How To Install Openstack On Ubuntu (Amd64)

Redmine Installation on Debian. v1.1

Transcription:

Nagios Cluster BS: Ubuntu Server 6.06.2 LTS Vserver Installation: wget -O - http://bronson.rinspin.com/u32-package-key.gpg sudo apt-key add - vi /etc/apt/source.list deb http://dpkg.u32.net/ubuntu edgy vserver deb-src http://dpkg.u32.net/ubuntu edgy vserver apt-get update apt-get install util-vserver vserver-debiantools apt-get install linux-vserver-image-2.6.17-11-vserver-generic reboot uname r 2.6.17-11-vserver-generic DRBD Installation: apt-get install apt-get install drbd0.7* apt-get install linux-vserver-headers-2.6.17-11-vserver-generic resource r0 { protocol C; incon-degr-cmd "echo '!DRBD! pri on incon-degr' wall ; sleep 60 ; halt -f"; startup { degr-wfc-timeout 60; wfc-timeout 60; disk { on-io-error detach; net { max-buffers 2048; syncer { rate 100M; group 1; al-extents 257;

on nagiosc1 { device /dev/drbd0; disk /dev/hda3; address 10.0.0.1:7788; meta-disk internal; on nagiosc2 { device /dev/drbd0; disk /dev/hda3; address 10.0.0.2:7788; meta-disk internal; Debian 4 apt-get install ssh mc vim bwm-ng automake Mail Konguration dpkg-recongure exim4-cong Option - Internet-Server; E-Mails werden direkt über SMTP verschickt und empfangen - nagiosc2.dresden-it.de der Rest bleibt leer vi /etc/hosts 127.0.0.1 localhost #127.0.1.1 nagiosc2.dresden-it.de nagiosc2 10.0.0.2 nagiosc2.dresden-it.de nagiosc2 #10.247.0.246 nagiosc2.dresden-it.de nagiosc2 10.0.0.1 nagiosc1.dresden-it.de nagiosc1 #10.247.0.245 nagiosc1.dresden-it.de nagiosc1 VSERVER Teil 1 installation: apt-get install linux-headers-2.6.18-4-vserver-686 linux-image-2.6.18-4-vserver-686 uname a Linux nagiosc1 2.6.18-5-686 #1 SMP Mon Dec 24 16:41:07 UTC 2007 i686 GNU/Linux uname a Linux nagiosc1 2.6.18-4-vserver-686 #1 SMP Thu May 10 01:37:59 UTC 2007 i686 GNU/Linux apt-get install util-vserver DRBD und HA:

apt-get install drbd* modconf build-essential debootstrap heartbeat-2 heartbeat-2-dev cd /usr/src tar xzf drbd0.7.tar.gz cd /usr/src/modules/drbd/drbd/ make KDIR=/usr/src/linux-headers-2.6.18-4-vserver-686/ make install cfdisk /dev/hda3 mkfs.ext3 /dev/hda3 auf Master Node (nagiosc1) /etc/init.d/drbd start drbdsetup /dev/drbd0 primary --do-what-i-say auf Slave Node (nagiosc2): /etc/init.d/drbd start Überprüfen ob alles läuft cat /proc/drbd version: 0.7.21 (api:79/proto:74) SVN Revision: 2326 build by root@nagiosc2, 2008-02-05 14:10:35 0: cs:synctarget st:secondary/primary ld:inconsistent ns:0 nr:790412 dw:790412 dr:0 al:0 bm:1168 lo:3 pe:2461 ua:3 ap:0 [=>...] sync'ed: 8.7% (8175/8947)M nish: 0:11:05 speed: 12,544 (11,452) K/sec HA: Konguration muss auf beiden Nodes identisch sein cd /etc/ha.d/ mkdir -p /var/log/heartbeat vi ha.cf debugle /var/log/heartbeat/ha-debug logle /var/log/heartbeat/ha-log keepalive 2 deadtime 5 warntime 5 initdead 50 auto_failback off udpport 696

bcast eth1 node nagiosc1 node nagiosc2 respawn hacluster /usr/lib/heartbeat/ipfail respawn root /etc/ha.d/resource.d/drbd.sh ping_group 10.0.0.1 10.0.0.2 ping 10.247.0.1 vi /etc/ha.d/resources.d/mountall DEV[1]=/dev/drbd0 MP[1]=/vserver ismounted() { if mount grep "^$1 on $2" > /dev/null 2>&1; then true else false case x$1 in xstart) cd / for i in 1 do if ismounted ${DEV[$i] ${MP[i]; then true else echo Ich mounte ${DEV[$i] ${MP[i] mount ${DEV[$i] ${MP[i] done xstop) cd / for i in 1 do if ismounted ${DEV[$i] ${MP[i]; then umount ${MP[i] > /dev/null 2>&1 if ismounted ${DEV[$i] ${MP[i]; then fuser -k -TERM -s -m ${MP[i] fuser -k -HUP -s -m ${MP[i] umount ${MP[i] > /dev/null 2>&1 if ismounted ${DEV[$i] ${MP[i]; then sleep 5 fuser -k -s -m ${MP[i] sleep 5 umount ${MP[i] > /dev/null 2>&1 done xstatus) cd / for i in 1

do if ismounted ${DEV[$i] ${MP[i]; then STATUS="running" done echo $STATUS esac vi /etc/ha.d/resource.d/vserver VSERVER="/usr/sbin/vserver" case "$2" in esac start) $VSERVER $1 start stop) $VSERVER $1 stop status) $VSERVER $1 status vi /etc/ha.d/resource.d/drbd.sh #!/bin/bash drbd=r0 while : do state=`cat /proc/drbd tail -2 head -1 awk '{print $2' sed s/:/' '/g awk '{print $2'` if [ $state = "StandAlone" ] then echo "starte Reconnect fuer $drbd"; drbdadm connect $drbd sleep 10 else echo "alles OK" sleep 10 done nagiosc2:/etc/ha.d# chmod 777 resource.d/* vi /etc/ha.d/haresources (nagiosc1) nagiosc1 drbddisk mountall IPaddr2::10.247.0.76/16/eth0:nagios2 AudibleAlarm SendArp::10.247.0.76/eth0 vserver::nagios2 vi /etc/ha.d/haresources (nagiosc2)

nagios2 drbddisk mountall IPaddr2::10.247.0.76/16/eth0:nagios2 AudibleAlarm SendArp::10.247.0.76/eth0 vserver::nagios2 vi /etc/ha.d/authkeys auth 2 2 crc chmod 600 /etc/ha.d/authkeys VSERVER Teil 2 Einrichtung: auf beiden Nodes ausführen nagiosc1:/etc# mkdir /vserver nagiosc1:/etc# cd /etc/vservers/ nagiosc1:/etc/vservers/# mv * /vserver nagiosc1:/# cd / nagiosc1:/#rm rf /etc/vservers nagiosc1:/# ln -s /vserver /etc/vservers auf dem Master ausführen nagiosc1:/# mount /dev/drbd0 /vserver/ nagiosc1:/# vserver nagios build --hostname nagios.dresden-it.de --netdev eth0 --interface 10.247.0.76/16 -m debootstrap -- -d etch -m http://ftp.at.debian.org/debian/ nagiosc1:/# echo nagios > /etc/vservers/nagios/interfaces/0/name nagiosc1:/# vserver Nagios start Bereinigen des Startvorganges des VServers (optional) nagiosc1:/vserver/nagios2/etc/rc0.d# rm K20makedev K25hwclock.sh S30urandom S31umountnfs.sh S35networking S36ifupdown S40umountfs S90halt K89klogd nagiosc1:/vserver/nagios2/etc/rc6.d# rm K20makedev K25hwclock.sh S30urandom S31umountnfs.sh S35networking S36ifupdown S40umountfs S90reboot K89klogd nagiosc1:/vserver/nagios2/etc/rcs.d# rm S05keymap.sh S48console-screen.sh S50hwclock.sh S40networking S45mountnfs.sh S10checkroot.sh S02mountvirtfs S30procps.sh S35mountall.sh S36mountvirtfs S39ifupdown S30checkfs.sh S18ifupdown-clean S18hwclockrst.sh nagiosc1:/vserver/nagios2/etc/rc2.d# rm S20makedev S11klogd Resourcen festlegen (1GB Virtueller Adress Speicher und 128 MB RAM) (optional) nagiosc1:/# mkdir /vservers/nagios2/rlimits nagiosc1:/# echo 250000 > /vservers/nagios2/rlimits/as nagiosc1:/# echo 32000 > /vservers/nagios2/rlimits/rss CPU Limitation nagiosc1:/# echo sched_prio > /vservers/nagios2/flags nagiosc1:/# echo 6 > /vservers/nagios2/schedule nagiosc1:/# echo 30 >> /vservers/nagios2/schedule

nagiosc1:/# echo 1000 >> /vservers/nagios2/schedule nagiosc1:/# echo 200 >> /vservers/nagios2/schedule nagiosc1:/# echo 3000 >> /vservers/nagios2/schedule nagiosc1:/# echo dummy >> /vservers/nagios2/schedule Installation der Services auf dem Vserver nagios: nagios:/# apt-get install mc vim locales less apache2 perl mysql-server-5.0 mysql-client-5.0 php5 ntp rsync rsnapshot bwm-ng Zeit stellen nagios:/# date 02081564 (MMDDhhmm) Zeitzone Umstellen nagios:/# tzcong Zeichensatz Kongurieren nagios:/# dpkg-recongure locales nagios:/# locale-gen Verhalten auf der Console Kongurieren nagios:/# vi /root/.bashrc # ~/.bashrc: executed by bash(1) for non-login shells. export PS1='\h:\w\$ ' umask 022 # You may uncomment the following lines if you want `ls' to be colorized: export LS_OPTIONS='--color=auto' eval "`dircolors`" alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -lah' alias l='ls $LS_OPTIONS -la' # # Some more alias to avoid making mistakes: alias rm='rm -rf' alias cp='cp -a' alias mv='mv' aktivieren der bash nagios:/# cd /root nagios:/#..bashrc Konsolen Suche aktivieren nagios:/# vi /etc/inputrc "\e[5~": history-search-backward "\e[6~": history-search-forward

Apache Einstellungen nagios:/etc/apache2/#vi ports.conf Listen 10.247.0.76:80 nagios:/etc/# vi hosts 10.247.0.76 nagios.dresden-it.de nagios zusätzliche Libs installieren für Nagios nagios:/# apt-get install libgd-dev libgd-tools autoconf automake make libssl-dev openssl libc6 libc6- dev ntpdate php5-snmp snmp snmpd mrtg libsnmp-base smbclient smbfs libsmbclient libsmbclientdev libldap2 libldap2-dev php5-gd perl-tk libg2-dev libg20-perl libg20 libglpng libglpng-dev libimageinfo-perl libimage-size-perl libpng12-0 libpng12-dev libpng3 gif2png libphp-jpgraph libphp-jpgraphexamples libjpeg-progs imageindex libanydata-perl jpeginfo libgraphicsmagick1 libgraphicsmagick1- dev libgraphicsmagick++1 libgraphicsmagick++1-dev libgraphics-magick-perl gcc nagios:/# apt-get install libgd-perl Anpassen der Apache Kong nagios:/# apt-get remove php4 nagios:/# apt-get install php5 nagios:/# cd /etc/apache2/mods-enabled/ nagios: /etc/apache2/mods-enabled/# ln -s../mods-available/php5.load php5.load Nagios Installation nagios:/# groupadd -g 9000 nagios nagios:/# groupadd -g 9001 nagcmd nagios:/# useradd -u 9000 -g nagios -G nagcmd -d /usr/local/nagios -c "Nagios Admin" nagios (bei Debian) nagios:/# grep "^User" /etc/apache2/apache2.conf User www-data nagios:/# usermod -G nagcmd www-data nagios:/# mkdir -p /usr/local/nagios /var/nagios /etc/nagios nagios:/# chown nagios.nagios /etc/nagios /var/nagios /usr/local/nagios

Sources: nagios:/download/# wget http://surfnet.dl.sourceforge.net/sourceforge/nagios/nagios-3.0rc2.tar.gz nagios:/# cd /download/nagios-3.0rc2/ nagios:/download/nagios-3.0rc2#./congure --sysconfdir=/etc/nagios --localstatedir=/var/nagios --withcommand-group=nagcmd bei Fehler(Warnung) apt-get install gcc libgd-dev pkg-cong nagios:/download/nagios-3.0rc2# make all nagios:/download/nagios-3.0rc2# make install nagios:/download/nagios-3.0rc2# make install-init nagios:/download/nagios-3.0rc2# make install-commandmode nagios:/download/nagios-3.0rc2# make install-cong nagios:/download/nagios-3.0rc2# make install-webconf nagios:/download/nagios-3.0rc2# htpasswd -c /etc/nagios/htpasswd.users kaulto nagios:/download/nagios-3.0rc2# ln -s /etc/init.d/nagios /etc/rcs.d/s99nagios nagios:/download/nagios-3.0rc2# echo /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg > /sbin/rcnagios_test nagios:/download/nagios-3.0rc2# ln -s /etc/init.d/nagios /sbin/rcnagios nagios:/download/nagios-3.0rc2#rcnagios start nagios:/download/nagios-3.0rc2#chmod 775 /sbin/rcnagios_test Plugins: nagios:/download/# wget http://dfn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins- 1.4.11.tar.gz nagios:/download/nagios-plugins-1.4.11# perl MCPAN e install Net::SNMP nagios:/download/nagios-plugins-1.4.11# apt-get install icmpinfo icmpush inetutils-ping fping nagios:/download# cd nagios-plugins-1.4.11/ nagios:/download/nagios-plugins-1.4.11#./congure --enable-perl-modules --sysconfdir=/etc/nagios -- localstatedir=/var/nagios --with-ping-command=/bin/ping --enable-perl-modules nagios:/download/nagios-plugins-1.4.11#make nagios:/download/nagios-plugins-1.4.11#make install