<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>andi.priv.at &#187; andi</title>
	<atom:link href="http://andi.priv.at/author/besn/feed/" rel="self" type="application/rss+xml" />
	<link>http://andi.priv.at</link>
	<description>Beta seit 1998</description>
	<lastBuildDate>Thu, 22 Dec 2011 23:00:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Shell One-Liner: Alle .csv.bz2 Dateien die älter als eine Woche sind löschen</title>
		<link>http://andi.priv.at/2011/12/23/shell-one-liner-alle-csv-bz2-dateien-die-alter-als-eine-woche-sind-loschen/</link>
		<comments>http://andi.priv.at/2011/12/23/shell-one-liner-alle-csv-bz2-dateien-die-alter-als-eine-woche-sind-loschen/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 23:00:46 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1506</guid>
		<description><![CDATA[find . -type f -name &#34;*.csv.bz2&#34; -mtime +7 -exec rm -rf &#123;&#125; \;]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.csv.bz2&quot;</span> <span style="color: #660033;">-mtime</span> +<span style="color: #000000;">7</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;</div></div>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/12/23/shell-one-liner-alle-csv-bz2-dateien-die-alter-als-eine-woche-sind-loschen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lokales Git Repository auf einen Server verschieben</title>
		<link>http://andi.priv.at/2011/12/23/lokales-git-repository-auf-einen-server-verschieben/</link>
		<comments>http://andi.priv.at/2011/12/23/lokales-git-repository-auf-einen-server-verschieben/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 23:00:42 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[andi.priv.at]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1532</guid>
		<description><![CDATA[Damit ich nicht jedes mal Googlen muss (und für euch paar da draussen die auf diesen Post über Google oder so stolperln) gibts heute ein kleines Tutorial zu wie man ein lokales Git Repository auf einen (Linux/*nix/&#8230;) Server kopiert und &#8230; <a href="http://andi.priv.at/2011/12/23/lokales-git-repository-auf-einen-server-verschieben/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Damit ich nicht jedes mal Googlen muss (und für euch paar da draussen die auf diesen Post über Google oder so stolperln) gibts heute ein kleines Tutorial zu wie man ein lokales Git Repository auf einen (Linux/*nix/&#8230;) Server kopiert und dann das lokale Repository auf den entfernten Server einstellt.</p>
<p>Als erstes erstellen wir auf dem Server ein leeres Repository</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">besn@daedalus:~$ mkdir -p ~/git/lerl<br />
besn@daedalus:~$ cd ~/git/lerl/<br />
besn@daedalus:~/git/lerl$ git init --shared --bare<br />
Initialized empty shared Git repository in /home/besn/git/lerl/</div></div>
<p>Dann stellen wir in dem lokalen Repository den Server als Remote Ziel ein</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">besn@odyssey:~/lerl$ git remote add origin besn.at:~/git/lerl<br />
besn@odyssey:~/lerl$ git push origin master<br />
Counting objects: 50, done.<br />
Delta compression using up to 4 threads.<br />
Compressing objects: 100% (43/43), done.<br />
Writing objects: 100% (50/50), 95.98 KiB, done.<br />
Total 50 (delta 2), reused 0 (delta 0)<br />
To besn.at:~/git/lerl<br />
&nbsp;* [new branch] &nbsp; &nbsp; &nbsp;master -&gt; master</div></div>
<br /><strong>Quelle:</strong> <a href="http://stackoverflow.com/questions/3894719/git-move-existing-repository-from-pc-to-server-clone-from-server/3894788#3894788" target="_blank" class="previewlink">Greg Hewgill's Post auf stackoverflow.com</a>]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/12/23/lokales-git-repository-auf-einen-server-verschieben/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell One-Liner: Alle .csv Dateien die älter als einen Tag sind bzipen</title>
		<link>http://andi.priv.at/2011/12/21/shell-one-liner-alle-csv-dateien-die-alter-als-einen-tag-sind-bzipen/</link>
		<comments>http://andi.priv.at/2011/12/21/shell-one-liner-alle-csv-dateien-die-alter-als-einen-tag-sind-bzipen/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 23:00:42 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1505</guid>
		<description><![CDATA[find . -type f -name &#34;*.csv&#34; -mtime +0 -exec bzip2 &#123;&#125; \;]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.csv&quot;</span> <span style="color: #660033;">-mtime</span> +<span style="color: #000000;">0</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">bzip2</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;</div></div>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/12/21/shell-one-liner-alle-csv-dateien-die-alter-als-einen-tag-sind-bzipen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell One-Liner: Alle .done Dateien umbenennen und das .done entfernen</title>
		<link>http://andi.priv.at/2011/12/19/shell-one-liner-alle-done-dateien-umbenennen-und-das-done-entfernen/</link>
		<comments>http://andi.priv.at/2011/12/19/shell-one-liner-alle-done-dateien-umbenennen-und-das-done-entfernen/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 23:00:39 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1504</guid>
		<description><![CDATA[find . -type f -name &#34;*.done&#34; &#124; \ sort &#124; while read donefile; do \ &#160; undonefile=`echo $donefile &#124; sed 's/.done//'`; \ &#160; mv -v &#34;$donefile&#34; &#34;$newfile&#34;; \ done]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.done&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> \<br />
<span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> donefile; <span style="color: #000000; font-weight: bold;">do</span> \<br />
&nbsp; <span style="color: #007800;">undonefile</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$donefile</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/.done//'</span><span style="color: #000000; font-weight: bold;">`</span>; \<br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$donefile</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$newfile</span>&quot;</span>; \<br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/12/19/shell-one-liner-alle-done-dateien-umbenennen-und-das-done-entfernen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell One-Liner: Alle .gz Dateien entpacken und mit bzip2 neu komprimieren</title>
		<link>http://andi.priv.at/2011/12/17/shell-one-liner-alle-gz-dateien-entpacken-und-mit-bzip2-neu-komprimieren/</link>
		<comments>http://andi.priv.at/2011/12/17/shell-one-liner-alle-gz-dateien-entpacken-und-mit-bzip2-neu-komprimieren/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 23:00:31 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1489</guid>
		<description><![CDATA[find . -type f -name &#34;*.gz&#34; &#124; \ sort &#124; while read gzipfile; do \ &#160; uncompressedfile=`echo $gzipfile &#124; sed 's/\.gz//'`; \ &#160; gunzip -v $gzipfile &#38;&#38; \ &#160; bzip2 -v $uncompressedfile; \ done]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash twitlight codecolorer-noborder" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.gz&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> \<br />
<span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> gzipfile; <span style="color: #000000; font-weight: bold;">do</span> \<br />
&nbsp; <span style="color: #007800;">uncompressedfile</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$gzipfile</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/\.gz//'</span><span style="color: #000000; font-weight: bold;">`</span>; \<br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">gunzip</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">$gzipfile</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> \<br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">bzip2</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">$uncompressedfile</span>; \<br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/12/17/shell-one-liner-alle-gz-dateien-entpacken-und-mit-bzip2-neu-komprimieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Könnt ihr alle erraten?</title>
		<link>http://andi.priv.at/2011/09/01/konnt-ihr-alle-erraten/</link>
		<comments>http://andi.priv.at/2011/09/01/konnt-ihr-alle-erraten/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 21:00:47 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1459</guid>
		<description><![CDATA[via: fun.drno.de]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://andi.priv.at/wp-content/uploads/2011/08/guess-the-web-browser.jpeg"  rel="lightbox[1459]"  class="lightbox"><img src="http://andi.priv.at/wp-content/uploads/2011/08/guess-the-web-browser.jpeg" alt="" title="GUESS THE WEB BROWSER" width="600" height="2225" class="aligncenter size-full wp-image-1458" /></a></p>
<br /><strong>via:</strong> <a href="http://fun.drno.de/" target="_blank" class="previewlink">fun.drno.de</a>]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/09/01/konnt-ihr-alle-erraten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian Squeeze + DRBD + Pacemaker Tutorial</title>
		<link>http://andi.priv.at/2011/07/27/debian-squeeze-drbd-pacemaker-tutorial/</link>
		<comments>http://andi.priv.at/2011/07/27/debian-squeeze-drbd-pacemaker-tutorial/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 18:51:37 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1435</guid>
		<description><![CDATA[Dieses Tutorial ist eine aktualisierte Fassung meines "Debian Squeeze + DRBD + Pacemaker Tutorials" bei dem ich (fast) nur Lenny durch Squeeze ersetzt habe und den Teil mit dem drbd8-source rausgelöscht habe, weil das nicht mehr notwendig ist. Sonst ist alles wie gehabt ;) <a href="http://andi.priv.at/2011/07/27/debian-squeeze-drbd-pacemaker-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Vorwort</h3>
<p>Dieses Tutorial ist eine aktualisierte Fassung meines <a href="http://andi.priv.at/2011/03/05/debian-squeeze-drbd-pacemaker-tutorial/">Debian Squeeze + DRBD + Pacemaker Tutorial</a>s bei dem ich (fast) nur <strong>Lenny</strong> durch <strong>Squeeze</strong> ersetzt habe und den Teil mit dem <strong>drbd8-source</strong> rausgelöscht habe, weil das nicht mehr notwendig ist. Sonst ist alles wie gehabt <img src='http://andi.priv.at/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h3>Vorbereitung</h3>
<p>Ich benutze 2 Debian Systeme (phobos und deimos) für diese Installation. Die Systeme sind mit einer Netboot-CD mit einem Minimalsystem installiert und bis auf das LVM (das es später um einiges leichter macht neue Platten in das System oder ins DRBD einzubinden) habe ich nicht viel abweichend installiert.</p>
<p>Jedes System hat 2 Netzwerkinterfaces (eines für den &#8220;normalen&#8221; Netzwerktraffic und eines für die direkte übertragung der DRBD-Daten. Alternativ könnte man die beiden Interfaces auch als bond redundant ans Netzwerk anbinden und die DRBD Kommunikation über ein seperates VLAN laufen lassen, aber das heb ich mir vielleicht für ein anderes Tuturial auf <img src='http://andi.priv.at/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>In meinem Setup hat jeder Server auch 2 Festplatten (eine für das System und eine für die DRBD-Daten). Durch das LVM ist das zwar nicht notwendig, aber aus Performancegründen empfiehlt es sich die Systemdaten von den DRBD Daten zu trennen.</p>
<p><span id="more-1435"></span></p>
<h3>Die Systeme</h3>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">+------------------------+ &nbsp; &nbsp; &nbsp;+------------------------+<br />
| &nbsp; &nbsp; &nbsp; &nbsp; phobos &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; deimos &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+------------------------+ &nbsp; &nbsp; &nbsp;+------------------------+<br />
| eth0: 192.168.1.244/24 |--||--| eth0: 192.168.1.245/24 |<br />
| eth1: 10.11.12.1/24 &nbsp; &nbsp;|------| eth1: 10.11.12.2/24 &nbsp; &nbsp;|<br />
+------------------------+ &nbsp; &nbsp; &nbsp;+------------------------+</div></div>
<p>Es empfiehlt sich, die internen (die 10.11.12.* IP-Adressen und Hostnames in die <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/hosts</span> auf den beiden Servern einzutragen, um DNS Abfragen für die beiden Hosts zu vermeiden. Sobald das Minimalsystem steht und die IP-Adressen konfiguriert sind können wir mit der eigentlich Installation unseres HA-Clusters beginnen.</p>
<h3>Debian Sources erweitern</h3>
<p>Bevor wir mit der Installation beginnen können, müssen wir noch unsere Packetquellen abändern damit wir die Pakete bekommen die wir brauchen. Weiters empfiehlt es sich wenn du es nicht eh schon gemacht hast, das Debian Backports Repository zu aktivieren, um frische Packete zu bekommen, was nie schaden kann.</p>
<p>Meine <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/apt/sources.list</span> sieht so aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deb http://debian.inode.at/debian/ squeeze main contrib non-free<br />
deb-src http://debian.inode.at/debian/ squeeze main contrib non-free<br />
<br />
deb http://security.debian.org/ squeeze/updates main contrib non-free<br />
deb-src http://security.debian.org/ squeeze/updates main contrib non-free<br />
<br />
deb http://ftp.at.debian.org/debian-backports/ squeeze-backports main contrib non-free<br />
deb-src http://ftp.at.debian.org/debian-backports/ squeeze-backports main contrib non-free</div></div>
<p>Um die Paketlisten zu aktualisieren führen wir danach noch ein <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">apt-get update</span> aus.</p>
<h3>DRBD installieren</h3>
<p>Das wichtigste bei einem HA-Cluster ist Zeit. Da beide Server genau die selbe Uhrzeit haben sollen installieren wir ntp auf beiden Servern, um die lokale Uhrzeit mit Zeitservern im Internet abzugleichen.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># apt-get install ntp ntpdate</div></div>
<p>Nachdem wir uns um die Zeit gekümmert haben, kommen als nächstes das DRBD Paket und der Cluster Manager Pacemaker.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># apt-get install drbd8-utils pacemaker</div></div>
<p>Wenn die Pakte installiert sind, laden wir als nächstes das DRBD Kernel Modul und probieren es gleich aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># modprobe drbd<br />
# lsmod | grep drbd</div></div>
<p>Beim letzten Befehl solltest du in der Auflistung das DRBD Modul sehen, wenn nicht dann hat es bei den vorigen Schritten ein Problem gegeben. Du solltest auch mit <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">cat /proc/drbd</span> schon ein paar Infos zur DRBD Installation sehen können:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# cat /proc/drbd<br />
version: 8.3.7 (api:88/proto:86-91)<br />
srcversion: EE47D8BF18AC166BE219757</div></div>
<p>Bearbeite als nächstes auf beiden Servern die Datei <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/drbd.d/mars.res</span> und passe die Config an dein Setup an:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">resource mars {<br />
&nbsp; disk {<br />
&nbsp; &nbsp; on-io-error detach;<br />
&nbsp; }<br />
&nbsp; on phobos {<br />
&nbsp; &nbsp; device /dev/drbd0;<br />
&nbsp; &nbsp; disk /dev/mapper/data-drbd;<br />
&nbsp; &nbsp; address 10.11.12.1:7788;<br />
&nbsp; &nbsp; meta-disk internal;<br />
&nbsp; }<br />
&nbsp; on deimos {<br />
&nbsp; &nbsp; device /dev/drbd0;<br />
&nbsp; &nbsp; disk /dev/mapper/data-drbd;<br />
&nbsp; &nbsp; address 10.11.12.2:7788;<br />
&nbsp; &nbsp; meta-disk internal;<br />
&nbsp; }<br />
}</div></div>
<p>Als nächstes erstellen wir (wie schon die ganze Zeit auf beiden Servern) die DRBD Metadaten.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># drbdadm create-md mars<br />
# drbdadm up all</div></div>
<p>Wenn du jetzt <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">cat /proc/drbd</span> eingibst, sieht du das beide Nodes im Secondary Mode sind und auch beide Inkonsistent sind.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# cat /proc/drbd<br />
version: 8.3.7 (api:88/proto:86-91)<br />
srcversion: EE47D8BF18AC166BE219757<br />
&nbsp;0: cs:Connected st:Secondary/Secondary ds:Inconsistent/Inconsistent C r---<br />
&nbsp; &nbsp; ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0</div></div>
<p>Das ist aber eh klar weil wir ja noch einstellen müssen, welcher Node der Primäre sein soll und wir auch noch kein Filesystem und nichts auf unserer Virutellen DRBD Platte haben. Dazu führen wir auf einem Server, in meinem fall <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">phobos</span> die folgenden Befehle aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># drbdsetup /dev/drbd0 primary -o<br />
# mkfs.ext3 /dev/drbd0<br />
# mkdir /mnt/data # den Ordner solltest du auf beiden Nodes erstellen<br />
# mount /dev/drbd0 /mnt/data</div></div>
<p>Damit ist unser DRBD Setup grundsätzlich fertig. Wenn du jetzt <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">df -h</span> eingibst, solltest du deine Hochverfügbare Partition sehen können.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# df -h<br />
Filesystem &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp;Used Avail Use% Mounted on<br />
/dev/mapper/phobos-root<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7.3G &nbsp;829M &nbsp;6.1G &nbsp;12% /<br />
tmpfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 379M &nbsp; &nbsp; 0 &nbsp;379M &nbsp; 0% /lib/init/rw<br />
udev &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10M &nbsp;640K &nbsp;9.4M &nbsp; 7% /dev<br />
tmpfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 379M &nbsp; &nbsp; 0 &nbsp;379M &nbsp; 0% /dev/shm<br />
/dev/sda1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 228M &nbsp;9.4M &nbsp;207M &nbsp; 5% /boot<br />
/dev/drbd0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2.0G &nbsp; 35M &nbsp;1.8G &nbsp; 2% /mnt/data</div></div>
<p>cat /proc/drbd zeigt nun auf beiden Nodes wer in welchem Modus ist und das die Daten überall aktuell und konsistent sind.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# cat /proc/drbd<br />
version: 8.3.7 (api:88/proto:86-91)<br />
srcversion: EE47D8BF18AC166BE219757<br />
&nbsp;0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---<br />
&nbsp; &nbsp; ns:2050468 nr:0 dw:65608 dr:1984973 al:25 bm:125 lo:0 pe:0 ua:0 ap:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; act_log: used:0/257 hits:16377 misses:40 starving:0 dirty:15 changed:25</div></div>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deimos:~# cat /proc/drbd<br />
version: 8.3.7 (api:88/proto:86-91)<br />
srcversion: EE47D8BF18AC166BE219757<br />
&nbsp;0: cs:Connected st:Secondary/Primary ds:UpToDate/UpToDate C r---<br />
&nbsp; &nbsp; ns:0 nr:2050468 dw:2050468 dr:0 al:0 bm:125 lo:0 pe:0 ua:0 ap:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0</div></div>
<h3>Pacemaker installieren</h3>
<p>Eigentlich haben wir ja schon einen voll funktionierenden DRBD-Cluster. Das einzige Manko ist, das wenn unser Primärknoten jetzt ausfällt wir uns erst händisch am Sekundärknoten per SSH (oder Console) anmelden müssen um ihm zu sagen das er jetzt für das DRBD Zuständig ist und dann noch das Volume mounten und Dienste starten müssten. Damit wir das nicht müssen verwenden wir Pacemaker, das unsren Cluster managen wird.</p>
<p>Zuerst müssen wir auf den Primären Knoten einen Authorisations Key für Corosync erzeugen und diesen auf den anderen Knoten kopieren:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# corosync-keygen<br />
phobos:~# scp /etc/corosync/authkey deimos:/etc/corosync/authkey</div></div>
<p>Als nächstes müssen wir ein paar Einstellungen von Corosync bearbeiten damit beide Knoten miteinander reden können. Bearbeite in der <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">interface</span> Sektion von <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">totem</span> den Wert von <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">bindnetaddr</span>:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<br />
&nbsp; &nbsp; interface {<br />
&nbsp; &nbsp; &nbsp; &nbsp; ringnumber: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; bindnetaddr: 10.11.12.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mcastaddr: 226.94.1.1<br />
&nbsp; &nbsp; &nbsp; &nbsp; mcastport: 5405<br />
&nbsp; &nbsp; }<br />
...</div></div>
<p>Wenn du mit den Änderungen an der Config fertig bist, muss Corosync noch aktiviert werden indem du <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">START=no</span> durch <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">START=yes</span> in der Datei <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/default/corosync</span> ersetzt.</p>
<p>Nachdem Corosync konfiguriert ist, starten wir den Dienst auf beiden Knoten und schauen ob er auch brav startet:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# /etc/init.d/corosync start<br />
Starting corosync daemon: corosync.</div></div>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deimos:~# /etc/init.d/corosync start<br />
Starting corosync daemon: corosync.</div></div>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# crm_mon --one-shot -V<br />
crm_mon[7363]: 2010/11/14_12:34:56 ERROR: unpack_resources: No STONITH resources have been defined<br />
crm_mon[7363]: 2010/11/14_12:34:54 ERROR: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option<br />
crm_mon[7363]: 2010/11/14_12:34:56 ERROR: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity<br />
<br />
<br />
============<br />
Last updated: Fri Nov 14 12:34:56 2010<br />
Stack: openais<br />
Current DC: phobos - partition with quorum<br />
Version: 1.0.6-cebe2b6ff49b36b29a3bd7ada1c4701c7470febe<br />
2 Nodes configured, 2 expected votes<br />
0 Resources configured.<br />
============<br />
<br />
Online: [ phobos deimos ]</div></div>
<p>Das schaut ja schon mal (bis auf den STONITH Fehler den wir gleich beheben werden) ja schon mal nicht schlecht aus. Jetzt konfigurieren wir mal ein paar Resourcen, die wir für unseren DRBD-Cluster benötigen werden:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# sudo crm<br />
crm(live)# cib new config20101114001<br />
crm(config20101114001)# configure<br />
crm(config20101114001)configure# edit</div></div>
<p>Meine Pacemaker Config sieht so aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">node phobos<br />
node deimos<br />
primitive drbd_mars ocf:linbit:drbd params drbd_resource=&quot;mars&quot; op monitor interval=&quot;15s&quot;<br />
ms ms_drbd_mars drbd_mars meta master-max=&quot;1&quot; master-node-max=&quot;1&quot; clone-max=&quot;2&quot; clone-node-max=&quot;1&quot; notify=&quot;true&quot;<br />
primitive fs_mars ocf:heartbeat:Filesystem params device=&quot;/dev/drbd/by-res/mars&quot; directory=&quot;/mnt/data&quot; fstype=&quot;ext3&quot;<br />
primitive ip_mars ocf:heartbeat:IPaddr2 params ip=&quot;192.168.1.243&quot; nic=&quot;eth0&quot;<br />
group mars fs_mars ip_mars<br />
colocation mars_on_drbd inf: mars ms_drbd_mars:Master<br />
property $id=&quot;cib-bootstrap-options&quot; \<br />
&nbsp; &nbsp; &nbsp; &nbsp; dc-version=&quot;1.0.6-cebe2b6ff49b36b29a3bd7ada1c4701c7470febe&quot; \<br />
&nbsp; &nbsp; &nbsp; &nbsp; stonith-enabled=false \<br />
&nbsp; &nbsp; &nbsp; &nbsp; cluster-infrastructure=&quot;openais&quot; \<br />
&nbsp; &nbsp; &nbsp; &nbsp; expected-quorum-votes=&quot;2&quot;</div></div>
<p>Wenn du mit dem bearbeiten der Config fertig bist verifiziere deine Änderungen und wenn alles OK ist aktiviere die Config.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">crm(config20101114001)configure# verify<br />
crm(config20101114001)configure# end<br />
There are changes pending. Do you want to commit them? y<br />
crm(config20101114001)#<br />
crm(config20101114001)# cib use live<br />
crm(live)# cib commit config20101114001<br />
INFO: commited 'config20101114001' shadow CIB to the cluster<br />
crm(live)# quit<br />
bye</div></div>
<h3>Sources (Linkz)</h3>
<ul>
<li><a href="http://www.howtoforge.com/highly-available-nfs-server-using-drbd-and-heartbeat-on-debian-5.0-lenny">Highly Available NFS Server Using DRBD And Heartbeat On Debian 5.0 (Lenny)</a></li>
<li><a href="http://www.clusterlabs.org/wiki/Debian_Lenny_HowTo">Clusterlabs: Pacemaker Debian Squeeze HowTo</a></li>
<li><a href="http://www.drbd.org/users-guide/s-pacemaker-crm.html">Using DRBD in Pacemaker clusters</a></li>
</ul>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/07/27/debian-squeeze-drbd-pacemaker-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Einen Haufen Dateien zusammenpacken und gleichzeitig auf eine andere Maschine schieben mit tar und netcat</title>
		<link>http://andi.priv.at/2011/07/08/einen-haufen-dateien-zusammenpacken-und-gleichzeitig-auf-eine-andere-maschine-schieben-mit-tar-und-netcat/</link>
		<comments>http://andi.priv.at/2011/07/08/einen-haufen-dateien-zusammenpacken-und-gleichzeitig-auf-eine-andere-maschine-schieben-mit-tar-und-netcat/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 13:13:38 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1427</guid>
		<description><![CDATA[Du musst ein Backup von einem Verzeichnis auf einem Linux/Unix Server anlegen, willst jedoch die Backupdaten (nicht einmal temporär) auf der Maschine ablegen (weil der Platz nicht ausreicht oder der einzige freie Space auf der Kiste eine DRBD Partition ist &#8230; <a href="http://andi.priv.at/2011/07/08/einen-haufen-dateien-zusammenpacken-und-gleichzeitig-auf-eine-andere-maschine-schieben-mit-tar-und-netcat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Du musst ein Backup von einem Verzeichnis auf einem Linux/Unix Server anlegen, willst jedoch die Backupdaten (nicht einmal temporär) auf der Maschine ablegen (weil der Platz nicht ausreicht oder der einzige freie Space auf der Kiste eine DRBD Partition ist die zwar dein Backup redundant auf dem 2. Knoten verfügbar macht aber damit den ganzen Prozess ausbremst)?</p>
<p>Kein Problem, alles was du dazu brauchst ist <a href="http://www.gnu.org/software/tar/">TAR</a> und <a href="http://netcat.sourceforge.net/">Netcat</a> das heutzutage in jeder Linux/Unix Distribution enthalten ist oder sich recht einfach nachinstallieren lässt (zur not per Hand von Source).</p>
<p>Und dann geht alles ganz einfach:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">besn@target:~# nc -l -p 1234 &gt; meinbackup.tar.bz2<br />
besn@source:~# tar -cjf - wasichsichernwill | nc 192.168.0.27 1234 -q 10</div></div>
<p>Du kannst die beiden Befehle natürlich noch erweitern, ich verwende gerne <a href="http://freshmeat.net/projects/pv/">Pipe Viewer</a> um zu sehen wie weit der Transfer schon ist bzw. wie schnell er ablauft bzw. wie viel mir die Komprimierung on the fly bringt.</p>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/07/08/einen-haufen-dateien-zusammenpacken-und-gleichzeitig-auf-eine-andere-maschine-schieben-mit-tar-und-netcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtuelle Machinen auf ESXi ohne vSphere Client (neu)starten</title>
		<link>http://andi.priv.at/2011/05/03/virtuelle-machinen-auf-esxi-ohne-vsphere-client-neustarten/</link>
		<comments>http://andi.priv.at/2011/05/03/virtuelle-machinen-auf-esxi-ohne-vsphere-client-neustarten/#comments</comments>
		<pubDate>Tue, 03 May 2011 09:11:02 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[andi.priv.at]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1410</guid>
		<description><![CDATA[Weil ich mich gerade mal wieder dazu durchkämpfen musste, hier eine kurze Anleitung wie man ohne einen vSphere Client auf einem ESXi eine Virtuelle Machine startet (oder neustartet oder resettet): 1. Verbinde dich als root zum ESX Host 2. Finde &#8230; <a href="http://andi.priv.at/2011/05/03/virtuelle-machinen-auf-esxi-ohne-vsphere-client-neustarten/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Weil ich mich gerade mal wieder dazu durchkämpfen musste, hier eine kurze Anleitung wie man ohne einen vSphere Client auf einem ESXi eine Virtuelle Machine startet (oder neustartet oder resettet):</p>
<p>1. Verbinde dich als root zum ESX Host<br />
2. Finde mit <strong>vim-cmd vmsvc/getallvms</strong> die Vmid deiner Virtuellen Machine raus<br />
3. Starte die Virtuelle Machine mit <strong>vim-cmd vmsvc/power.on [Vmid]</strong></p>
<p>So einfach geht das. Eine Vollständige Liste der Befehle der vimsh findest du z.b. auf <a href="http://www.vi-toolkit.com/wiki/index.php/Vimsh">VI-Toolkit.com</a></p>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/05/03/virtuelle-machinen-auf-esxi-ohne-vsphere-client-neustarten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian Lenny + DRBD + Pacemaker Tutorial</title>
		<link>http://andi.priv.at/2011/03/05/debian-lenny-drbd-pacemaker-tutorial/</link>
		<comments>http://andi.priv.at/2011/03/05/debian-lenny-drbd-pacemaker-tutorial/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 11:36:16 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1361</guid>
		<description><![CDATA[Vorbereitung Ich benutze 2 Debian Systeme (phobos und deimos) für diese Installation. Die Systeme sind mit einer Netboot-CD mit einem Minimalsystem installiert und bis auf das LVM (das es später um einiges leichter macht neue Platten in das System oder &#8230; <a href="http://andi.priv.at/2011/03/05/debian-lenny-drbd-pacemaker-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Vorbereitung</h3>
<p>Ich benutze 2 Debian Systeme (phobos und deimos) für diese Installation. Die Systeme sind mit einer Netboot-CD mit einem Minimalsystem installiert und bis auf das LVM (das es später um einiges leichter macht neue Platten in das System oder ins DRBD einzubinden) habe ich nicht viel abweichend installiert.</p>
<p>Jedes System hat 2 Netzwerkinterfaces (eines für den &#8220;normalen&#8221; Netzwerktraffic und eines für die direkte übertragung der DRBD-Daten. Alternativ könnte man die beiden Interfaces auch als bond redundant ans Netzwerk anbinden und die DRBD Kommunikation über ein seperates VLAN laufen lassen, aber das heb ich mir vielleicht für ein anderes Tuturial auf <img src='http://andi.priv.at/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>In meinem Setup hat jeder Server auch 2 Festplatten (eine für das System und eine für die DRBD-Daten). Durch das LVM ist das zwar nicht notwendig, aber aus Performancegründen empfiehlt es sich die Systemdaten von den DRBD Daten zu trennen.</p>
<p><span id="more-1361"></span></p>
<h3>Die Systeme</h3>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">+------------------------+ &nbsp; &nbsp; &nbsp;+------------------------+<br />
| &nbsp; &nbsp; &nbsp; &nbsp; phobos &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; deimos &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+------------------------+ &nbsp; &nbsp; &nbsp;+------------------------+<br />
| eth0: 192.168.1.244/24 |--||--| eth0: 192.168.1.245/24 |<br />
| eth1: 10.11.12.1/24 &nbsp; &nbsp;|------| eth1: 10.11.12.2/24 &nbsp; &nbsp;|<br />
+------------------------+ &nbsp; &nbsp; &nbsp;+------------------------+</div></div>
<p>Es empfiehlt sich, die internen (die 10.11.12.* IP-Adressen und Hostnames in die <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/hosts</span> auf den beiden Servern einzutragen, um DNS Abfragen für die beiden Hosts zu vermeiden. Sobald das Minimalsystem steht und die IP-Adressen konfiguriert sind können wir mit der eigentlich Installation unseres HA-Clusters beginnen.</p>
<h3>Debian Sources erweitern</h3>
<p>Bevor wir mit der Installation beginnen können, müssen wir noch unsere Packetquellen abändern damit wir die Pakete bekommen die wir brauchen. Weiters empfiehlt es sich wenn du es nicht eh schon gemacht hast, das Debian Backports Repository zu aktivieren, um frische Packete zu bekommen, was nie schaden kann.</p>
<p>Meine <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/apt/sources.list</span> sieht so aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deb http://debian.inode.at/debian/ lenny main contrib non-free<br />
deb-src http://debian.inode.at/debian/ lenny main contrib non-free<br />
<br />
deb http://security.debian.org/ lenny/updates main contrib non-free<br />
deb-src http://security.debian.org/ lenny/updates main contrib non-free<br />
<br />
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free<br />
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free<br />
<br />
deb http://ftp.at.debian.org/debian-backports/ lenny-backports main contrib non-free<br />
deb-src http://ftp.at.debian.org/debian-backports/ lenny-backports main contrib non-free</div></div>
<p>Wenn du das Debian Packports Repo noch nicht eingerichtet hast, musst du den Release Key einspielen, um nervige Abfragen später zu vermeiden:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gpg --keyserver hkp://subkeys.pgp.net --recv-keys 16BA136C &amp;&amp; gpg --export 16BA136C | apt-key add -</div></div>
<p>Um die Paketlisten zu aktualisieren führen wir danach noch ein <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">apt-get update</span> aus.</p>
<h3>DRBD installieren</h3>
<p>Das wichtigste bei einem HA-Cluster ist Zeit. Da beide Server genau die selbe Uhrzeit haben sollen installieren wir ntp auf beiden Servern, um die lokale Uhrzeit mit Zeitservern im Internet abzugleichen.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># apt-get install ntp ntpdate</div></div>
<p>Nachdem wir uns um die Zeit gekümmert haben, kommen als nächstes die DRBD Pakete.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># apt-get -t lenny-backports install \<br />
&nbsp; &nbsp; linux-headers-`uname -r` drbd8-utils \ <br />
&nbsp; &nbsp; drbd8-source pacemaker</div></div>
<p>Wenn die Pakte installier sind, übersetzen wir als nächstes das DRBD Kernel Modul und probieren es gleich aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># m-a a-i drbd8-source<br />
# modprobe drbd<br />
# lsmod | grep drbd</div></div>
<p>Beim letzten Befehl solltest du in der Auflistung das DRBD Modul sehen, wenn nicht dann hat es bei den vorigen Schritten ein Problem gegeben. Du solltest auch mit <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">cat /proc/drbd</span> schon ein paar Infos zur DRBD Installation sehen können:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# cat /proc/drbd<br />
version: 8.0.14 (api:86/proto:86)<br />
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33</div></div>
<p>Bearbeite als nächstes auf beiden Servern die Datei <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/drbd.d/mars.res</span> und passe die Config an dein Setup an:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">resource mars {<br />
&nbsp; disk {<br />
&nbsp; &nbsp; on-io-error detach;<br />
&nbsp; }<br />
&nbsp; on phobos {<br />
&nbsp; &nbsp; device /dev/drbd0;<br />
&nbsp; &nbsp; disk /dev/mapper/data-drbd;<br />
&nbsp; &nbsp; address 10.11.12.1:7788;<br />
&nbsp; &nbsp; meta-disk internal;<br />
&nbsp; }<br />
&nbsp; on deimos {<br />
&nbsp; &nbsp; device /dev/drbd0;<br />
&nbsp; &nbsp; disk /dev/mapper/data-drbd;<br />
&nbsp; &nbsp; address 10.11.12.2:7788;<br />
&nbsp; &nbsp; meta-disk internal;<br />
&nbsp; }<br />
}</div></div>
<p>Als nächstes erstellen wir (wie schon die ganze Zeit auf beiden Servern) die DRBD Metadaten.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># drbdadm create-md mars<br />
# drbdadm up all</div></div>
<p>Wenn du jetzt <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">cat /proc/drbd</span> eingibst, sieht du das beide Nodes im Secondary Mode sind und auch beide Inkonsistent sind.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# cat /proc/drbd<br />
version: 8.0.14 (api:86/proto:86)<br />
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33<br />
&nbsp;0: cs:Connected st:Secondary/Secondary ds:Inconsistent/Inconsistent C r---<br />
&nbsp; &nbsp; ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0</div></div>
<p>Das ist aber eh klar weil wir ja noch einstellen müssen, welcher Node der Primäre sein soll und wir auch noch kein Filesystem und nichts auf unserer Virutellen DRBD Platte haben. Dazu führen wir auf einem Server, in meinem fall <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">phobos</span> die folgenden Befehle aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># drbdsetup /dev/drbd0 primary -o<br />
# mkfs.ext3 /dev/drbd0<br />
# mkdir /mnt/data # den Ordner solltest du auf beiden Nodes erstellen<br />
# mount /dev/drbd0 /mnt/data</div></div>
<p>Damit ist unser DRBD Setup grundsätzlich fertig. Wenn du jetzt <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">df -h</span> eingibst, solltest du deine Hochverfügbare Partition sehen können.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# df -h<br />
Filesystem &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp;Used Avail Use% Mounted on<br />
/dev/mapper/phobos-root<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7.3G &nbsp;829M &nbsp;6.1G &nbsp;12% /<br />
tmpfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 379M &nbsp; &nbsp; 0 &nbsp;379M &nbsp; 0% /lib/init/rw<br />
udev &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10M &nbsp;640K &nbsp;9.4M &nbsp; 7% /dev<br />
tmpfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 379M &nbsp; &nbsp; 0 &nbsp;379M &nbsp; 0% /dev/shm<br />
/dev/sda1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 228M &nbsp;9.4M &nbsp;207M &nbsp; 5% /boot<br />
/dev/drbd0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2.0G &nbsp; 35M &nbsp;1.8G &nbsp; 2% /mnt/data</div></div>
<p>cat /proc/drbd zeigt nun auf beiden Nodes wer in welchem Modus ist und das die Daten überall aktuell und konsistent sind.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# cat /proc/drbd<br />
version: 8.0.14 (api:86/proto:86)<br />
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33<br />
&nbsp;0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---<br />
&nbsp; &nbsp; ns:2050468 nr:0 dw:65608 dr:1984973 al:25 bm:125 lo:0 pe:0 ua:0 ap:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; act_log: used:0/257 hits:16377 misses:40 starving:0 dirty:15 changed:25</div></div>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deimos:~# cat /proc/drbd<br />
version: 8.0.14 (api:86/proto:86)<br />
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33<br />
&nbsp;0: cs:Connected st:Secondary/Primary ds:UpToDate/UpToDate C r---<br />
&nbsp; &nbsp; ns:0 nr:2050468 dw:2050468 dr:0 al:0 bm:125 lo:0 pe:0 ua:0 ap:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0<br />
&nbsp; &nbsp; &nbsp; &nbsp; act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0</div></div>
<h3>Pacemaker installieren</h3>
<p>Eigentlich haben wir ja schon einen voll funktionierenden DRBD-Cluster. Das einzige Manko ist, das wenn unser Primärknoten jetzt ausfällt wir uns erst händisch am Sekundärknoten per SSH (oder Console) anmelden müssen um ihm zu sagen das er jetzt für das DRBD Zuständig ist und dann noch das Volume mounten und Dienste starten müssten. Damit wir das nicht müssen verwenden wir Pacemaker, das unsren Cluster managen wird.</p>
<p>Zuerst müssen wir auf den Primären Knoten einen Authorisations Key für Corosync erzeugen und diesen auf den anderen Knoten kopieren:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# corosync-keygen<br />
phobos:~# scp /etc/corosync/authkey deimos:/etc/corosync/authkey</div></div>
<p>Als nächstes müssen wir ein paar Einstellungen von Corosync auf beiden Knoten bearbeiten. Zum einen die <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">interface</span> Sektion von <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">totem</span>:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<br />
&nbsp; &nbsp; interface {<br />
&nbsp; &nbsp; &nbsp; &nbsp; ringnumber: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; bindnetaddr: 10.11.12.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mcastaddr: 226.94.1.1<br />
&nbsp; &nbsp; &nbsp; &nbsp; mcastport: 5405<br />
&nbsp; &nbsp; }<br />
...</div></div>
<p>Zum andern (falls sich Corosync darüber aufregt) muss die den <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">consensus</span> Wert unter totem auf 3600 setzen.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<br />
&nbsp; &nbsp; # How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)<br />
&nbsp; &nbsp; consensus: 3600<br />
&nbsp; &nbsp; # Turn off the virtual synchrony filter<br />
&nbsp; &nbsp; vsftype: none<br />
...</div></div>
<p>Wenn du mit den Änderungen an der Config fertig bist, muss Corosync noch aktiviert werden indem du <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">START=no</span> durch <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">START=yes</span> in der Datei <span style="font: normal normal normal 13px/1.4em Monaco, 'Lucida Console', monospace;">/etc/default/corosync</span> ersetzt.</p>
<p>Nachdem Corosync konfiguriert ist, starten wir den Dienst auf beiden Knoten und schauen ob er auch brav startet:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# /etc/init.d/corosync start<br />
Starting corosync daemon: corosync.</div></div>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deimos:~# /etc/init.d/corosync start<br />
Starting corosync daemon: corosync.</div></div>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# crm_mon --one-shot -V<br />
crm_mon[7363]: 2010/11/14_12:34:56 ERROR: unpack_resources: No STONITH resources have been defined<br />
crm_mon[7363]: 2010/11/14_12:34:54 ERROR: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option<br />
crm_mon[7363]: 2010/11/14_12:34:56 ERROR: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity<br />
<br />
<br />
============<br />
Last updated: Fri Nov 14 12:34:56 2010<br />
Stack: openais<br />
Current DC: phobos - partition with quorum<br />
Version: 1.0.6-cebe2b6ff49b36b29a3bd7ada1c4701c7470febe<br />
2 Nodes configured, 2 expected votes<br />
0 Resources configured.<br />
============<br />
<br />
Online: [ phobos deimos ]</div></div>
<p>Das schaut ja schon mal (bis auf den STONITH Fehler den wir gleich beheben werden) ja schon mal nicht schlecht aus. Jetzt konfigurieren wir mal ein paar Resourcen, die wir für unseren DRBD-Cluster benötigen werden:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">phobos:~# sudo crm<br />
crm(live)# cib new config20101114001<br />
crm(config20101114001)# configure<br />
crm(config20101114001)configure# edit</div></div>
<p>Meine Pacemaker Config sieht so aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">node phobos<br />
node deimos<br />
primitive drbd_mars ocf:linbit:drbd params drbd_resource=&quot;mars&quot; op monitor interval=&quot;15s&quot;<br />
ms ms_drbd_mars drbd_mars meta master-max=&quot;1&quot; master-node-max=&quot;1&quot; clone-max=&quot;2&quot; clone-node-max=&quot;1&quot; notify=&quot;true&quot;<br />
primitive fs_mars ocf:heartbeat:Filesystem params device=&quot;/dev/drbd/by-res/mars&quot; directory=&quot;/mnt/data&quot; fstype=&quot;ext3&quot;<br />
primitive ip_mars ocf:heartbeat:IPaddr2 params ip=&quot;192.168.1.243&quot; nic=&quot;eth0&quot;<br />
group mars fs_mars ip_mars<br />
colocation mars_on_drbd inf: mars ms_drbd_mars:Master<br />
property $id=&quot;cib-bootstrap-options&quot; \<br />
&nbsp; &nbsp; &nbsp; &nbsp; dc-version=&quot;1.0.6-cebe2b6ff49b36b29a3bd7ada1c4701c7470febe&quot; \<br />
&nbsp; &nbsp; &nbsp; &nbsp; stonith-enabled=false \<br />
&nbsp; &nbsp; &nbsp; &nbsp; cluster-infrastructure=&quot;openais&quot; \<br />
&nbsp; &nbsp; &nbsp; &nbsp; expected-quorum-votes=&quot;2&quot;</div></div>
<p>Wenn du mit dem bearbeiten der Config fertig bist verifiziere deine Änderungen und wenn alles OK ist aktiviere die Config.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">crm(config20101114001)configure# verify<br />
crm(config20101114001)configure# end<br />
There are changes pending. Do you want to commit them? y<br />
crm(config20101114001)#<br />
crm(config20101114001)# cib use live<br />
crm(live)# cib commit config20101114001<br />
INFO: commited 'config20101114001' shadow CIB to the cluster<br />
crm(live)# quit<br />
bye</div></div>
<h3>Sources (Linkz)</h3>
<ul>
<li><a href="http://www.howtoforge.com/highly-available-nfs-server-using-drbd-and-heartbeat-on-debian-5.0-lenny">Highly Available NFS Server Using DRBD And Heartbeat On Debian 5.0 (Lenny)</a></li>
<li><a href="http://www.clusterlabs.org/wiki/Debian_Lenny_HowTo">Clusterlabs: Pacemaker Debian Lenny HowTo</a></li>
<li><a href="http://www.drbd.org/users-guide/s-pacemaker-crm.html">Using DRBD in Pacemaker clusters</a></li>
</ul>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2011/03/05/debian-lenny-drbd-pacemaker-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>devops videos</title>
		<link>http://andi.priv.at/2010/09/07/devops-videos/</link>
		<comments>http://andi.priv.at/2010/09/07/devops-videos/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 21:34:53 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[andi.priv.at]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1347</guid>
		<description><![CDATA[heute gibt&#8217;s ein paar videos zum thema devops, wie große webseiten wie yahoo, facebook oder twitter entwicklung und operating zusammenbringen und ein wenig darüber wie deren systeme im hintergrund funktionieren. devopscafe.org &#8211; Open Mic Episode 1: DevOps Metrics and Dashboards &#8230; <a href="http://andi.priv.at/2010/09/07/devops-videos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>heute gibt&#8217;s ein paar videos zum thema <a href="http://en.wikipedia.org/wiki/DevOps">devops</a>, wie große webseiten wie yahoo, facebook oder twitter entwicklung und operating zusammenbringen und ein wenig darüber wie deren systeme im hintergrund funktionieren.</p>
<div align="center">
<p><a href="http://devopscafe.org/show/2010/7/19/open-mic-episode-1-video.html" style="font-weight: bold;">devopscafe.org &#8211; Open Mic Episode 1: DevOps Metrics and Dashboards at Shopzilla</a></p>
<p><iframe src="http://player.vimeo.com/video/13407836?byline=0&amp;portrait=0" width="480" height="300" frameborder="0"></iframe></p>
<p><a href="http://velocityconference.blip.tv/file/2284377/" style="font-weight: bold;">John Allspaw, &#8220;10+ Deploys Per Day: Dev and Ops Cooperation at Flickr&#8221;</a></p>
<p><embed src="http://blip.tv/play/AYGMoH8C" type="application/x-shockwave-flash" width="480" height="300" allowscriptaccess="always" allowfullscreen="true"></embed></p>
<p><a href="http://www.youtube.com/watch?v=T-Xr_PJdNmQ" style="font-weight: bold;">Velocity 2010: Tom Cook, &quot;A Day in the Life of Facebook Operations&quot;</a></p>
<p><a href="http://www.youtube.com/watch?v=T-Xr_PJdNmQ">www.youtube.com/watch?v=T-Xr_PJdNmQ</a></p>
<p><a href="http://www.youtube.com/watch?v=_7KdeUIvlvw" style="font-weight: bold;">Velocity 2010: John Adams, &quot;In the Belly of the Whale: Operations at Twitter&quot;</a></p>
<p><a href="http://www.youtube.com/watch?v=_7KdeUIvlvw">www.youtube.com/watch?v=_7KdeUIvlvw</a></p>
</div>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/09/07/devops-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streifen für Wurstsalat</title>
		<link>http://andi.priv.at/2010/08/01/streifen-fur-wurstsalat/</link>
		<comments>http://andi.priv.at/2010/08/01/streifen-fur-wurstsalat/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 13:16:36 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[shopping_fun]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1335</guid>
		<description><![CDATA[Ich wär eigentlich genau die Zielgruppe für so ein Produkt aber selbst ich frag mich ob das nicht ein wenig zuu weit geht. Aber wenn ich mal wieder Wurstsalat mache und zu Faul bin mir an halben Kilo Extrawurst zu &#8230; <a href="http://andi.priv.at/2010/08/01/streifen-fur-wurstsalat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ich wär eigentlich genau die Zielgruppe für so ein Produkt aber selbst ich frag mich ob das nicht ein wenig zuu weit geht.</p>
<p style="text-align: center;"><a href="http://andi.priv.at/wp-content/uploads/2010/08/31072010.jpg"  rel="lightbox[1335]"  class="lightbox"><img src="http://andi.priv.at/wp-content/uploads/photojar/cache/31072010-640x640-0-img1336.jpg" alt="" title="Extrawurst in Streifen für Wurstsalat" width="640" height="480" class="aligncenter size-medium wp-image-1336" /></a></p>
<p>Aber wenn ich mal wieder Wurstsalat mache und zu Faul bin mir an halben Kilo Extrawurst zu kaufen und zu schneiden dann weiß ich genau was ich mir stattdessen kaufen kann <img src='http://andi.priv.at/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/08/01/streifen-fur-wurstsalat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selbst signierte Zertifikate erzeugen</title>
		<link>http://andi.priv.at/2010/06/07/selbst-signierte-zertifikate-erzeugen/</link>
		<comments>http://andi.priv.at/2010/06/07/selbst-signierte-zertifikate-erzeugen/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 10:12:21 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1327</guid>
		<description><![CDATA[Das ist wiedermal mehr ein Gedächtnisstützenpost für mich, damit ich nicht immer googlen muss wenn ich ein SSL Zertifikat für eine Webseite erzeugen will: # Zertifikats Key erzeugen openssl genrsa -des3 -out domainname.at.key 2048 # Passwortgeschützten Key kopieren cp domainname.at.key &#8230; <a href="http://andi.priv.at/2010/06/07/selbst-signierte-zertifikate-erzeugen/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Das ist wiedermal mehr ein Gedächtnisstützenpost für mich, damit ich nicht immer googlen muss wenn ich ein SSL Zertifikat für eine Webseite erzeugen will:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Zertifikats Key erzeugen</span><br />
openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> domainname.at.key <span style="color: #000000;">2048</span><br />
<span style="color: #666666; font-style: italic;"># Passwortgeschützten Key kopieren</span><br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> domainname.at.key domainname.at.key.orig<br />
<span style="color: #666666; font-style: italic;"># Key ohne Passwort erzeugen</span><br />
openssl rsa <span style="color: #660033;">-in</span> domainname.at.key.orig <span style="color: #660033;">-out</span> domainname.at.key<br />
<span style="color: #666666; font-style: italic;"># Zertifikat erzeugen</span><br />
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-key</span> domainname.at.key <span style="color: #660033;">-out</span> domainname.at.crt <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span></div></div>
<p>Damit ist in ein paar einfachen Schritten ein selbst signiertes SSL Zertifikat erzeugt das für 10 Jahre gültig ist und für die meisten privaten Aufgaben vollkommen ausreicht.</p>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/06/07/selbst-signierte-zertifikate-erzeugen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hau weg die .htpasswd: Apache Authentifizierung mit mod-auth-mysql</title>
		<link>http://andi.priv.at/2010/05/15/hau-weg-die-htpasswd-apache-authentifizierung-mit-mod-auth-mysql/</link>
		<comments>http://andi.priv.at/2010/05/15/hau-weg-die-htpasswd-apache-authentifizierung-mit-mod-auth-mysql/#comments</comments>
		<pubDate>Sat, 15 May 2010 13:52:43 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1260</guid>
		<description><![CDATA[Noch aus den Urzeiten der Webserver stammt die HTTP-Authentifizierung mit der man sich im Browser gegenüber dem Webserver als jemand Berechtigter ausweisen kann. Das Verfahren mag ein wenig angestaubt wirken und die Fenster könnten sie auch mal schöner Designen aber &#8230; <a href="http://andi.priv.at/2010/05/15/hau-weg-die-htpasswd-apache-authentifizierung-mit-mod-auth-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Noch aus den Urzeiten der Webserver stammt die <a href="http://de.wikipedia.org/wiki/HTTP-Authentifizierung">HTTP-Authentifizierung</a> mit der man sich im Browser gegenüber dem Webserver als jemand Berechtigter ausweisen kann. Das Verfahren mag ein wenig angestaubt wirken und die Fenster könnten sie auch mal schöner Designen aber solange es keinen Nachfolger für die <a href="http://www.ietf.org/rfc/rfc2617">RFC 2617</a> gibt hat sich etwas an der Art wie man die Passwörter speichert geändert. Fast alle Tutorials zur Absicherung des Indianers erklären wie ihr mithilfe von <strong>htpasswd</strong> eine Datei erzeugen und für den Ordner mit den Partyfotos das man an eine Handvoll Leute weitergibt reicht das ja auch vollkommen aus. Aber wenn man ein paar Subversion Repos und Trac Installationen mit einem haufen Usern hat wünscht man sich eine Lösung bei der die User in einer Datenbank liegen und man das ganze über ein Webinterface verwalten kann. Und genau das ist mit dem Apache Modul mod-auth-mysql.</p>
<p><span id="more-1260"></span></p>
<h3>Datenbank</h3>
<p><strong>User und Datenbank anlegen</strong><br />
Du kannst einen eigenen Benutzer für mod-auth-mysql anlegen, musst es aber nicht.</p>
<div class="codecolorer-container sql twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">USER</span> <span style="color: #ff0000;">'mysqlauth'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'passwort'</span><br />
<span style="color: #993333; font-weight: bold;">GRANT</span> USAGE <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">.</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'mysqlauth'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'passwort'</span>;<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #ff0000;">`mysqlauth`</span> ;<br />
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> PRIVILEGES <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #ff0000;">`mysqlauth`</span> <span style="color: #66cc66;">.</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'mysqlauth'</span>@<span style="color: #ff0000;">'localhost'</span>;</div></div>
<p><strong>Tabellen anlegen</strong><br />
Die Tabellenstruktur basiert auf der von <a title="SVN with MySQL authentication" href="http://www.arune.se/tech:svnwithmysqlauth">http://www.arune.se/tech:svnwithmysqlauth</a> mit der Erweitung um die Virtuellen Gruppen und die Views für den .htpasswd Ersatz.</p>
<div class="codecolorer-container sql twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #ff0000;">`groups`</span> <span style="color: #66cc66;">&#40;</span><br />
<span style="color: #ff0000;">`groupid`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">UNSIGNED</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`groupname`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`groupvirtual`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">150</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
<span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> &nbsp;<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`groupid`</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #993333; font-weight: bold;">UNIQUE</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #ff0000;">`name`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`groupname`</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>InnoDB &nbsp;<span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8;<br />
<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #ff0000;">`usergroup`</span> <span style="color: #66cc66;">&#40;</span><br />
<span style="color: #ff0000;">`userid`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">UNSIGNED</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #ff0000;">'0'</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`groupid`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">UNSIGNED</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #ff0000;">'0'</span><span style="color: #66cc66;">,</span><br />
<span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> &nbsp;<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`userid`</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">`groupid`</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>InnoDB <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8;<br />
<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #ff0000;">`users`</span> <span style="color: #66cc66;">&#40;</span><br />
<span style="color: #ff0000;">`userid`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">UNSIGNED</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`username`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`password`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`firstname`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`lastname`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
<span style="color: #ff0000;">`email`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><br />
<span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> &nbsp;<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`userid`</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #993333; font-weight: bold;">UNIQUE</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #ff0000;">`login`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`username`</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>InnoDB &nbsp;<span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8;<br />
<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">VIEW</span> <span style="color: #ff0000;">`mysqlauth`</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">`users`</span><span style="color: #66cc66;">.*,</span><span style="color: #ff0000;">`groups`</span><span style="color: #66cc66;">.*</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`users`</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`groups`</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`usergroup`</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`usergroup`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`userid`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">`users`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`userid`</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`groups`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`groupid`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">`usergroup`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`groupid`</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></div>
<h3>Apache 2 mit mod-auth-mysql unter Debian/Ubuntu</h3>
<p><strong>mod-auth-mysql</strong><br />
Die Installation des Moduls geht recht einfach über apt:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install libapache2-mod-auth-mysql</div></div>
<p>Es gibt auch ein &#8220;mod_auth_mysql&#8221; Modul für Fedora, RHEL bzw. CentOS das soweit ich das in Erfahrung bringen konnte auf <a href="http://modauthmysql.sourceforge.net/">modauthmysql.sourceforge.net</a> basiert, während man bei Debian ein eigenes Repository pflegt. Wenn deine Distribution das Modul nicht mitliefert kannst du dir auch  das <a href="http://code.svn.wordpress.org/mod_auth_mysql/">mod_auth_mysql</a> Modul von WordPress.org übersetzen. All diese Module unterscheiden sich aber durch die Syntax die man in die httpd.conf von Apache verwenden muss. Bedenke das wenn du dieses Howto auf eine andere Distribution bzw ein anderes mod-auth-mysql Modul anwenden möchtest.</p>
<p>Folgender Code ist für den &lt;Location &gt; Teil deiner httpd.conf:</p>
<div class="codecolorer-container apache twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">DAV</span> svn<br />
<span style="color: #00007f;">AuthType</span> Basic<br />
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;lala&quot;</span><br />
<span style="color: #00007f;">AuthUserFile</span> /dev/null<br />
<span style="color: #00007f;">require</span> valid-<span style="color: #00007f;">user</span><br />
AuthMYSQL <span style="color: #0000ff;">on</span><br />
<span style="color: #00007f;">AuthBasicAuthoritative</span> <span style="color: #0000ff;">off</span><br />
AuthMySQL_Authoritative <span style="color: #0000ff;">on</span><br />
AuthMySQL_Host localhost<br />
AuthMySQL_User mysqlauth<br />
AuthMySQL_Password ******<br />
AuthMySQL_DB svnauth<br />
AuthMySQL_Password_Table mysqlauth_user<br />
AuthMySQL_Username_Field username<br />
AuthMySQL_Password_Field password<br />
AuthMySQL_Empty_Passwords <span style="color: #0000ff;">off</span><br />
AuthMySQL_Encryption_Types Crypt_DES PHP_MD5</div></div>
<h3>Nginx mit nginx_auth_mysql</h3>
<p>Das ganze geht natürlich auch mit Nginx. Der Vorteil ist, das man einen Request schon am Reverse Proxy ablehnen kann und gar nicht erst den Apache im Hintergrund belästigen muss. Jedoch gibt es kein eingebautes Modul um gegen mySQL zu authentifizieren aber du kannst dir nginx recht einfach zusammen mit dem <a href="http://code.svn.wordpress.org/nginx_auth_mysql/">nginx_auth_mysql</a> Modul selber übersetzen:</p>
<p><strong>1. nginx runterladen und entpacken</strong></p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget http://nginx.org/download/nginx-0.7.65.tar.gz<br />
tar -xzvf nginx-0.7.65.tar.gz</div></div>
<p><strong>2. nginx_auth_mysql auschecken</strong></p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svn export http://code.svn.wordpress.org/nginx_auth_mysql/</div></div>
<p><strong>3. nginx mit nginx_auth_mysql bauen</strong><br />
Wenn du unter Debian bist und willst das dein selbstgebauter nginx aus den Standard nginx Verzeichnissen ließt aber selbst an einem anderen Ort liegt (damit beim nächsten Update des Debian Paketes dein eigenbau Binary nicht überschrieben wird) kannst du die Zeile kopieren mit der auch das Debian Paket von nginx gebaut wird. Das auth_mysql Modul wird auch gleich mitgebaut.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">./configure --prefix=/usr/local/nginx \<br />
--conf-path=/etc/nginx/nginx.conf \<br />
--error-log-path=/var/log/nginx/error.log \<br />
--pid-path=/var/run/nginx.pid \<br />
--lock-path=/var/lock/nginx.lock \<br />
--http-log-path=/var/log/nginx/access.log \<br />
--http-client-body-temp-path=/var/lib/nginx/body \<br />
--http-proxy-temp-path=/var/lib/nginx/proxy \<br />
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \<br />
--with-debug \<br />
--with-http_stub_status_module \<br />
--with-http_flv_module \<br />
--with-http_ssl_module \<br />
--with-http_dav_module \<br />
--add-module=../nginx_auth_mysql/</div></div>
<p><strong>4. nging nginx.conf</strong><br />
Der folgende Code gehört in deine nginx.conf innerhalb eines location { &#8230; } Teils:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">auth_mysql_realm &quot;lerl&quot;;<br />
auth_mysql_host &quot;localhost&quot;;<br />
auth_mysql_user &quot;mysqlauth&quot;;<br />
auth_mysql_password &quot;******&quot;;<br />
auth_mysql_database &quot;mysqlauth_priv&quot;;<br />
auth_mysql_table &quot;users&quot;;<br />
auth_mysql_password_column &quot;password&quot;;<br />
auth_mysql_user_column &quot;username&quot;;<br />
auth_mysql_encryption_type &quot;md5&quot;;</div></div>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/05/15/hau-weg-die-htpasswd-apache-authentifizierung-mit-mod-auth-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kaputte Berkeley DB&#8217;s wiederherstellen</title>
		<link>http://andi.priv.at/2010/04/20/kaputte-berkeley-dbs-wiederherstellen/</link>
		<comments>http://andi.priv.at/2010/04/20/kaputte-berkeley-dbs-wiederherstellen/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 19:54:32 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1308</guid>
		<description><![CDATA[Weil ich mir nach den paar Zeilen gerade den A*sch abgegooglet habe wie man eine (möglicherweiße) kaputte Berkeley DBs wiederherstellt, poste ich sie hier damit ich beim nächsten mal nicht wieder suchen muss. Und immer daran denken: Sicherungskopie anlegen db_verify &#8230; <a href="http://andi.priv.at/2010/04/20/kaputte-berkeley-dbs-wiederherstellen/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Weil ich mir nach den paar Zeilen gerade den A*sch abgegooglet habe wie man eine (möglicherweiße) kaputte Berkeley DBs wiederherstellt, poste ich sie hier damit ich beim nächsten mal nicht wieder suchen muss. Und immer daran denken: <strong>Sicherungskopie anlegen</strong> <img src='http://andi.priv.at/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">db_verify $DBNAME<br />
db_recover -v<br />
db_dump -f $DBNAME.out $DBNAME<br />
mv $DBNAME $DBNAME.old<br />
db_load -f $DBNAME.out $DBNAME<br />
db_verify $DBNAME</div></div>
<br /><strong>Quelle:</strong> <a href="http://markmail.org/message/fzzysts6u3qywken" target="_blank" class="previewlink">net.sunsource.gridengine.users</a>]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/04/20/kaputte-berkeley-dbs-wiederherstellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenTTD wird 1.0</title>
		<link>http://andi.priv.at/2010/04/07/openttd-wird-1-0/</link>
		<comments>http://andi.priv.at/2010/04/07/openttd-wird-1-0/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 12:01:48 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1296</guid>
		<description><![CDATA[Nach 6 Jahren Arbeit hat OpenTTD, der Open Source Clon des bekannten Wirtschaftssimulationsspiels die Version 1.0 erreicht. Im Gegensatz zum leicht angestaubten Vorbild kann man OpenTTD auch unter Linux sowie diversen Unixen (sogar am iphone) nativ spielen, kann Karten erstellen &#8230; <a href="http://andi.priv.at/2010/04/07/openttd-wird-1-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Nach 6 Jahren Arbeit hat <a href="http://www.openttd.org/">OpenTTD</a>, der Open Source Clon des bekannten Wirtschaftssimulationsspiels die Version 1.0 erreicht. Im Gegensatz zum leicht angestaubten Vorbild kann man OpenTTD auch unter Linux sowie diversen Unixen (sogar am iphone) nativ spielen, kann Karten erstellen die 64 mal größer sind als im Original, hat eine etwas verfeinertes UI und kann eine Tonne ans Mods und Maps aus dem Internet runterladen. Um das Spiel zu spielen benötigt man auch nicht mehr zwingend die Original CD von <a href="http://de.wikipedia.org/wiki/Transport_Tycoon">Transport Tycoon Deluxe</a> sondern kann auch hier auf offene Alternativen für Sounds und Grafik zurückgreifen.</p>
<br /><strong>Quelle:</strong> <a href="http://www.golem.de/1004/74290.html" target="_blank" class="previewlink">Golem.de</a>]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/04/07/openttd-wird-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quake II auf HTML5 portiert</title>
		<link>http://andi.priv.at/2010/04/05/quake-ii-auf-html5-portiert/</link>
		<comments>http://andi.priv.at/2010/04/05/quake-ii-auf-html5-portiert/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 21:33:02 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[quake]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1290</guid>
		<description><![CDATA[Ein paar Google Entwickler haben auf Basis von Jake2 (dem Java-Port von Quake 2) mithilfe von GWT, HTML5, WebGL und WebSockets die Engine des Oldschool Killerspiels auf den Browser portiert. Es gibt auch ein Video wie das ganze aussieht: www.youtube.com/watch?v=XhMN0wlITLk &#8230; <a href="http://andi.priv.at/2010/04/05/quake-ii-auf-html5-portiert/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ein paar Google Entwickler haben auf Basis von Jake2 (dem Java-Port von Quake 2) mithilfe von GWT, HTML5, WebGL und WebSockets die Engine des Oldschool Killerspiels auf den Browser portiert. Es gibt auch ein Video wie das ganze aussieht:</p>
<div align="center">
<p><a href="http://www.youtube.com/watch?v=XhMN0wlITLk">www.youtube.com/watch?v=XhMN0wlITLk</a></p>
</div>
<p>Derzeit funktioniert das ganze nur im Safari oder Chromium, im Firefox ist laut der <a href="http://code.google.com/p/quake2-gwt-port/wiki/FAQ">FAQ</a> die Performance derzeit nicht gut genug. Runterladen kann man den Sourcecode auf der Projektseite von <a href="http://code.google.com/p/quake2-gwt-port/">quake2-gwt-port</a>.</p>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/04/05/quake-ii-auf-html5-portiert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grub nach Windows Installation wiederherstellen</title>
		<link>http://andi.priv.at/2010/03/22/grub-nach-windows-installation-wiederherstellen/</link>
		<comments>http://andi.priv.at/2010/03/22/grub-nach-windows-installation-wiederherstellen/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 20:31:24 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1232</guid>
		<description><![CDATA[Für den (ganz sicherern) Fall das ich es wieder brauche: Wie stell ich Grub nach einer Windows Installation wieder her]]></description>
			<content:encoded><![CDATA[<p>Für den (ganz sicherern) Fall das ich es wieder brauche: <a href="https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows">Wie stell ich Grub nach einer Windows Installation wieder her</a></p>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/03/22/grub-nach-windows-installation-wiederherstellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Garstige Hotlinker mit mod_rewrite ärgern</title>
		<link>http://andi.priv.at/2010/03/16/garstige-hotlinker-mit-mod_rewrite-argern/</link>
		<comments>http://andi.priv.at/2010/03/16/garstige-hotlinker-mit-mod_rewrite-argern/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 17:21:37 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1133</guid>
		<description><![CDATA[Kennt ihr das auch? Da macht man sich die Mühe, den Content den man aus dem Interwebs klaut kopiert auf den eigenen Webspace zu laden und da kommt so jemand daher und verlinkt einfach das Bild von deinem Webspace aus. &#8230; <a href="http://andi.priv.at/2010/03/16/garstige-hotlinker-mit-mod_rewrite-argern/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Kennt ihr das auch? Da macht man sich die Mühe, den Content den man aus dem Interwebs <span style="text-decoration: line-through;">klaut</span> kopiert auf den eigenen Webspace zu laden und da kommt so jemand daher und verlinkt einfach das Bild von deinem Webspace aus. In meinem Fall haben ein paar Warez Foren einen hochaufgelösten Covershot von Quake 1 in ein paar Posts gelinked und das 156KB große Bild wurde seit Juni 2009 satte <strong>156.893 mal</strong> aufgerufen, was mir einen Traffic von <strong>23.901MB</strong> beschert hat. Das ist natürlich alles andere als leiwand und so hab ich mir gedacht ich kann doch eigentlich mit ein paar Zeilen in der .htaccess im DocumentRoot von andi.priv.at dafür sorgen das das Bild recht schnell aus deren Forum verschwindet.</p>
<p><span id="more-1133"></span></p>
<p>Die normale .htaccess einer WordPress installation sieht so aus:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;<br />
# END WordPress</div></div>
<p>Über dem ganzen fügst du einen weiteren Block dazu:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">RewriteEngine On<br />
RewriteCond %{HTTP_REFERER} ^http://www.bösehotlinkerseite.com/ [NC]<br />
RewriteCond %{REQUEST_URI} !^/hotlinkpic.jpg$<br />
RewriteRule .(jpe?g|gif|bmp|png)$ /hotlinkpic.jpg [L]</div></div>
<p>Jetzt wird jeder Requests auf ein Bild der von der Seite www.bösehotlinkerseite.com kommt auf das Bild das unter /hotlinkpic.jpg liegt weitergeleitet. Du kannst auch bei der Condition mit dem Referer statt der Seite die du aussperren willst die URLs zu deiner Seite mit einem Rufzeichen davor eintragen um alle Requests die nicht von deiner Seite aus gehen das Hotlinkbild anzuzeigen:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:640px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">RewriteCond %{HTTP_REFERER} !^http://andi.priv.at/ [NC]<br />
RewriteCond %{HTTP_REFERER} !^https://andi.priv.at/ [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.andi.priv.at/ [NC]</div></div>
<p>Ich hoffe damit konnt ich dem ein oder anderen helfen der so wie ich &#8220;Opfer&#8221; von Hotlinking geworden ist.</p>
<br />]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/03/16/garstige-hotlinker-mit-mod_rewrite-argern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hingabe zur (Admin)Pflicht</title>
		<link>http://andi.priv.at/2010/03/01/hingabe-zur-adminpflicht/</link>
		<comments>http://andi.priv.at/2010/03/01/hingabe-zur-adminpflicht/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:42:17 +0000</pubDate>
		<dc:creator>andi</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[adminfun]]></category>

		<guid isPermaLink="false">http://andi.priv.at/?p=1118</guid>
		<description><![CDATA[Warum denk ich mir bei dem Comic &#8220;Das würd ich auch machen&#8230;&#8221;? Quelle: xkcd]]></description>
			<content:encoded><![CDATA[<p>Warum denk ich mir bei dem Comic &#8220;Das würd ich auch machen&#8230;&#8221;? <img src='http://andi.priv.at/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a href="http://xkcd.com/705/"><img src="http://andi.priv.at/wp-content/uploads/2010/03/devotion_to_duty.png" alt="Devotion to Duty (© xkcd)" title="Devotion to Duty (© xkcd)" class="aligncenter size-medium wp-image-1117" height="193" width="500"></a></p>
<br /><strong>Quelle:</strong> <a href="http://xkcd.com/705/" target="_blank" class="previewlink">xkcd</a>]]></content:encoded>
			<wfw:commentRss>http://andi.priv.at/2010/03/01/hingabe-zur-adminpflicht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

