<?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>treibsand.com &#187; Unix</title>
	<atom:link href="http://www.treibsand.com/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.treibsand.com</link>
	<description></description>
	<lastBuildDate>Tue, 10 Aug 2010 13:33:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>CentOS als VirtualBox Gast</title>
		<link>http://www.treibsand.com/2010/02/23/centos-als-virtualbox-gast/</link>
		<comments>http://www.treibsand.com/2010/02/23/centos-als-virtualbox-gast/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 11:41:32 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=465</guid>
		<description><![CDATA[Unter Mac OS X ist VirtualBox wirklich ein sehr gutes Programm. Jedes Betriebssystem lief bisher ohne Probleme als Gast&#8230;naja, bis vor kurzem, als ich CentOS 5.4 installiert habe&#8230; Nach der Installation merkte ich, dass meine CPU immer zwischen 80-90% ausgelastet war, obwohl die VM eine Load von 0 hatte und nichts machte. Es hat mich [...]]]></description>
			<content:encoded><![CDATA[<p style="clear: both;"><a class="image-link" href="http://www.treibsand.com/wp-content/uploads/2010/02/centos_logo_45.png" rel="lightbox[465]"><img class="linked-to-original" style="display: inline; float: right; margin: 0 0 10px 10px;" src="http://www.treibsand.com/wp-content/uploads/2010/02/centos_logo_45-thumb.png" alt="" width="208" height="45" align="right" /></a>Unter Mac OS X ist VirtualBox wirklich ein sehr gutes Programm. Jedes Betriebssystem lief bisher ohne Probleme als Gast&#8230;naja, bis vor kurzem, als ich CentOS 5.4 installiert habe&#8230;</p>

<p><p style="clear: both;"><!-- more --><span id="more-465"></span>
Nach der Installation merkte ich, dass meine CPU immer zwischen 80-90% ausgelastet war, obwohl die VM eine Load von 0 hatte und nichts machte.</p>
<p style="clear: both;">Es hat mich einige Zeit gekostet den Fehler zu finden. Grund hierfür war der Kernel von CentOS, dieser wurde nämlich mit einem internem &#8220;Takt&#8221; von 1000Hz kompiliert. Andere Distributionen verwenden hier noch 100Hz. Dies hatte zur Folge, dass VirtualBox sehr viel zu tun hatte und die CPU im Host-System nahezu ausgelastet war.</p>
<p style="clear: both;">Das Problem kann aber recht einfach gelöst werden, indem der Kernel mit der Option <strong>divider=10 </strong>gebootet wird. Einfach an die Kernel Zeile in der grub.conf hängen und alles läuft.</p>
<br class="final-break" style="clear: both;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2010/02/23/centos-als-virtualbox-gast/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NFS Server unter Solaris 10</title>
		<link>http://www.treibsand.com/2009/11/17/nfs-server-unter-solaris-10/</link>
		<comments>http://www.treibsand.com/2009/11/17/nfs-server-unter-solaris-10/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 10:50:06 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=395</guid>
		<description><![CDATA[Solaris ist ein wunderbares Betriebssystem, allerdings schaut man grundsätzlich erstmal in die Röhre, wenn man z.B. von FreeBSD kommt. Neulich brauchte ich einen NFS Server auf einem Solaris System und war zuerst etwas verwirrt wie es konfiguriert wird&#8230; Die Konfiguration unterscheidet sich ziemlich von der unter FreeBSD, so dass erst mal die Handbücher gewälzt werden [...]]]></description>
			<content:encoded><![CDATA[<p>Solaris ist ein wunderbares Betriebssystem, allerdings schaut man grundsätzlich erstmal in die Röhre, wenn man z.B. von FreeBSD kommt. Neulich brauchte ich einen NFS Server auf einem Solaris System und war zuerst etwas verwirrt wie es konfiguriert wird&#8230;</p>

<p><span id="more-395"></span>
Die Konfiguration unterscheidet sich ziemlich von der unter FreeBSD, so dass erst mal die Handbücher gewälzt werden mussten.</p>

<p>Als erstes sollte der NFS Service gestartet werden&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">svcadm <span style="color: #660033;">-v</span> <span style="color: #7a0874; font-weight: bold;">enable</span> <span style="color: #660033;">-r</span> network<span style="color: #000000; font-weight: bold;">/</span>nfs<span style="color: #000000; font-weight: bold;">/</span>server</pre></div></div>


<p>Danach ist die NFS Freigabe nötig, bei FreeBSD stehen die in <em>/etc/exports</em>, unter Solaris allerdings in <em>/etc/dfs/dfstab</em>. Eine Freigabe kann man allerdings auch auf der Konsole machen:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">share <span style="color: #660033;">-F</span> nfs <span style="color: #660033;">-o</span> rw <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span></pre></div></div>


<p>Diese Methode überlebt allerdings keinen Reboot, so dass für eine permanente Freigabe die Zeile in der Datei <em>/etc/dfs/dfstab</em> eingetragen werden sollte.</p>

<p>Wenn auch der Benutzer <em>root</em> auf den NFS Clients verwendet werden soll, dann muss dies explizit freigegeben werden:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">share <span style="color: #660033;">-F</span> nfs <span style="color: #660033;">-o</span> rw,<span style="color: #007800;">root</span>=host1:host2 <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span></pre></div></div>


<p>Die Option <em>root=access_list</em> legt fest von welchem Host der Benutzer <em>root</em> für die Freigabe Zugriff hat.</p>

<p>Um die Freigabe auf dem anderen System zu mounten, reicht der Befehl:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-F</span> nfs server:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #000000; font-weight: bold;">/</span>mount_point</pre></div></div>


<p>Um das Volumen dauerhaft auf dem Client einzubinden, muss dies in der Datei <em>/etc/vfstab</em> definiert werden:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span>   -   <span style="color: #000000; font-weight: bold;">/</span>mount_point   nfs   -   <span style="color: #c20cb9; font-weight: bold;">yes</span>    rw,soft</pre></div></div>


<p>Also eigentlich gar nicht so schwer&#8230;man muss nur wissen, wo man alles nachlesen kann <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<p>Alle Sun Administration Handücher können übrigens unter <a href="http://docs.sun.com/app/docs/coll/47.16?l=de">http://docs.sun.com/app/docs/coll/47.16?l=de</a> gefunden werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/11/17/nfs-server-unter-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup einer großen PostgreSQL Datenbank</title>
		<link>http://www.treibsand.com/2009/06/19/backup-einer-grosen-postgresql-datenbank/</link>
		<comments>http://www.treibsand.com/2009/06/19/backup-einer-grosen-postgresql-datenbank/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 10:10:45 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Datenbank]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Write-Ahead-Log]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=326</guid>
		<description><![CDATA[Um eine Datenbank zu sichern, wird üblicherweise ein SQL Dump erzeugt, welcher dann bei einem Ausfall wieder eingespielt werden kann. Bei kleineren Datenbank ist das auch durchaus ein guter Weg. Wenn allerdings eine Datenbank z.B. größer als 20GB wird, dann dauert der Dump extrem lange und belastet das System. PostgreSQL bietet aber auch die Möglichkeit [...]]]></description>
			<content:encoded><![CDATA[<p>Um eine Datenbank zu sichern, wird üblicherweise ein SQL Dump erzeugt, welcher dann bei einem Ausfall wieder eingespielt werden kann. Bei kleineren Datenbank ist das auch durchaus ein guter Weg. Wenn allerdings eine Datenbank z.B. größer als 20GB wird, dann dauert der Dump extrem lange und belastet das System.
<span id="more-326"></span></p>

<p>PostgreSQL bietet aber auch die Möglichkeit im Betrieb ein sogenanntes Write-Ahead-Log (WAL), neben den eigentlichen Datenbestand, auf die Festplatte zu schreiben. Es enthält alle Aufzeichnungen sämtlicher im Datenbanksystem vorgenommenen Schreiboperationen. Falls das System ausfällt, können diese Aufzeichnungen verwendet werden, um die Datenbank wieder herzustellen. Es handelt sich hierbei um das gleiche Prinzip wie ein &#8220;Journal&#8221; von Linux Dateisystemen. </p>

<p>Eigentlich wird das Write-Ahead-Log in regelmäßigen Abständen mit dem Datenbestand abgeglichen und wieder gelöscht, da es nicht mehr benötigt wird. Es kann aber auch für eine Datensicherung verwendet werden. Die Aufzeichnungen bestehen aus Segmenten,  je 16MB groß und im Verzeichnis <b>pg_xlog</b> zu finden. </p>

<p>Um eine Datensicherung mit WAL zu betreiben, braucht man als erstes eine Basissicherung. Hierfür kann ein einfaches Shellscript verwendet werden:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-e</span>
<span style="color: #007800;">filename</span>=<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>wal_archive<span style="color: #000000; font-weight: bold;">/</span>basebackup_<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span><span style="color: #000000; font-weight: bold;">`</span>_$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">'%Y-%m-%dT%H%M%S.%N%z'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.tar.gz
psql <span style="color: #660033;">-U</span> postgres <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;SELECT pg_start_backup('<span style="color: #007800;">$filename</span>');&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">--force-local</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>data <span style="color: #660033;">-c</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$filename</span>&quot;</span> <span style="color: #660033;">--anchored</span> <span style="color: #660033;">--exclude</span>=pg_xlog pgsql <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
psql <span style="color: #660033;">-U</span> postgres <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;SELECT pg_stop_backup();&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null</pre></div></div>


<p>Mit den PostgreSQL Befehlen <b>pg&#95;start&#95;backup()</b> und <b>pg&#95;stop&#95;backup()</b> kann das komplette Datenbanksystem gesichert werden. Das erzeugte Tarball wird unter <b>/data/wal_archive</b> gespeichert. Die PostgreSQL Installation wird unter <b>/data/pgsql</b> erwartet.</p>

<p>Nachdem die Basissicherung erstellt wurde, kann PostgreSQL für WAL konfiguriert werden. PostgreSQL selber macht hier keine Vorschriften, wie die WAL Segmente archiviert werden sollen, es können beliebige Shell Befehle aufgerufen werden. Man hat z.B. die Möglichkeit die Segmente einfach mit <b>cp</b> zu kopieren, könnte sie aber auch mit <b>rsync</b> auf einen anderen Rechner schieben. Die Konfiguration wird in der Datei <b>postgresql.conf</b> vorgenommen:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">archive_mode = on
archive_command = <span style="color: #ff0000;">'test ! -f /data/wal_archive/%f &amp;&amp; cp %p /data/wal_archive/%f'</span></pre></div></div>


<p>Es ist hier wichtig, dass keine vorhandenen Dateien überschrieben werden, deshalb wird vor dem kopieren getestet, ob die entsprechende Datei schon vorhanden ist. Der Platzhalter <b>%f</b> ist der Dateiname für die Zieldatei, <b>%p</b> ist die zu kopierende Datei mit vollständigem Pfad. </p>

<p>Nachdem PostgreSQL neu gestartet wurde, werden die WAL Dateien, sofern 16MB Daten geschrieben wurden nach <b>/data/wal_archive</b> kopiert. Es ist nicht möglich, kleinere Datei zu schreiben, deswegen besteht das Risiko max. 16MB an Daten zu verlieren, wenn der Server stirbt und die WAL Datei noch nicht geschrieben hat. Es gibt allerdings die Möglichkeit einen Timeout zu setzen, nach welchem auf jeden Fall das Segment geschrieben werden soll.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">archive_timeout = <span style="color: #000000;">60</span></pre></div></div>


<p>Hierdurch würden alle 60 Sekunden ein Segment geschrieben werden, auch wenn keine Schreiboperation durchgeführt würde! Das Segment ist dann trotzdem 16MB groß, und mit NULL Daten gefüllt. Es ist also abzuwägen ob und wie hoch der Timeout sein soll.</p>

<p>Grundsätzlich sichere ich die WAL Segmente großer Datenbank auf einen anderen Server, damit das Hauptsystem nicht durch das Backup bzw. den erhöhten Speicherbedarf belastet wird. Einerseits kann das Segment auf ein mit <b>NFS</b> eingehängtes Volumen gespeichert werden, oder es wird mit <b>scp</b> oder <b>rsync</b> kopiert. Der <b>archive_command</b> Aufruf für <b>rsync</b> könnte wie folgt ausehen:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">archive_command = <span style="color: #ff0000;">'rsync --delay-updates --whole-file -ar -e ssh %p postgres@192.168.0.2:/data/wal_archive/%f &lt;/dev/null'</span></pre></div></div>


<p>Die Segmente werden dann automatisch in das Verzeichnis <b>/data/wal_archive</b> auf dem Server <b>192.168.0.2</b> kopiert. Es sollte allerdings ein SSH-Key ohne Passwort auf dem Zielsystem für den Benutzer <b>postgres</b> hinterlegt sein.</p>

<p>Für die eigentliche Sicherung muss nur nach das Verzeichnis <b>/data/wal_archive</b> auf dem Server <b>192.168.0.2</b> eingetragen werden. Zugegeben, diese Art von Datensicherung verbraucht viel Speicherplatz, da die Festplattenpreise allerdings sehr niedrig sind und das Datenbanksystem kaum belastet wird, rechtfertigt sich der hohe Speicherbedarf durchaus.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/06/19/backup-einer-grosen-postgresql-datenbank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL Replikation</title>
		<link>http://www.treibsand.com/2009/06/16/postgresql-replikation/</link>
		<comments>http://www.treibsand.com/2009/06/16/postgresql-replikation/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 09:59:30 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Datenbank]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Replikation]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=312</guid>
		<description><![CDATA[Replikation bei Datenbanken ist ein ziemlich umfangreiches Thema. PostgreSQL bietet in der Distribution leider keine mitgelieferte Möglichkeit Datenbanken in einem Master-Slave Setup zu replizieren. Da ist man auf Tools wie Slony-I oder die Skytools angewiesen. Da Slony-I sehr umfangreich und nicht gerade einfach zu konfigurieren ist, habe ich mir die Skytools bzw. londiste näher angeschaut, [...]]]></description>
			<content:encoded><![CDATA[<p>Replikation bei Datenbanken ist ein ziemlich umfangreiches Thema. PostgreSQL bietet in der Distribution leider keine mitgelieferte Möglichkeit Datenbanken in einem Master-Slave Setup zu replizieren. Da ist man auf Tools wie <a href="http://www.slony.info/">Slony-I</a> oder die <a href="https://developer.skype.com/SkypeGarage/DbProjects/SkyTools">Skytools</a> angewiesen. Da Slony-I sehr umfangreich und nicht gerade einfach zu konfigurieren ist, habe ich mir die Skytools bzw. londiste näher angeschaut, und muss sagen, dass es wirklich hervorragend funktioniert.</p>

<p><span id="more-312"></span>
Die Skytools sind von Skype, und können auf der <a href="http://pgfoundry.org/">PgFoundry</a> Seite gefunden werden.  Als Beispiel nehmen wir eine einfache Datenbank mit nur einer Tabelle&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> sequence test_seq start <span style="color: #993333; font-weight: bold;">WITH</span> <span style="color: #cc66cc;">1</span>;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> test <span style="color: #66cc66;">&#40;</span>
  id int4 <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span><span style="color: #66cc66;">,</span> 
  txt text
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<p>Jetzt brauchen wir noch ein paar Datensätze&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> test <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test_seq'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'bla'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> test <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test_seq'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'blub'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> test <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test_seq'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'test text'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<p>Nachdem alle Tabelle angelegt ist, sollte die Datenbank auf dem Slave Server erstellt werden. Danach können die Inhalte mit einem Dump initial übernommen werden&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pg_dump <span style="color: #660033;">-U</span> postgres <span style="color: #660033;">-s</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #000000; font-weight: bold;">|</span> psql <span style="color: #660033;">-h</span> <span style="color: #000000; font-weight: bold;">&lt;</span>IP-VON-SLAVE<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #660033;">-U</span> postgres <span style="color: #7a0874; font-weight: bold;">test</span></pre></div></div>


<p>Damit londiste laufen kann, brauchen wir einen Ticker, dieser muss auf dem Master-Server laufen. Die Konfiguration kann wie folgt aussehen (hier die Datei /etc/ticker.ini):</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>pgqadm<span style="color: #7a0874; font-weight: bold;">&#93;</span>
job_name = ticker
db = <span style="color: #007800;">dbname</span>=<span style="color: #7a0874; font-weight: bold;">test</span> 
maint_delay_min = <span style="color: #000000;">1</span>
loop_delay = <span style="color: #000000;">0.5</span>
logfile = <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>log.<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>job_name<span style="color: #7a0874; font-weight: bold;">&#41;</span>s
pidfile = <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>pid.<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>job_name<span style="color: #7a0874; font-weight: bold;">&#41;</span>s
use_skylog = <span style="color: #000000;">0</span>
connection_lifetime = <span style="color: #000000;">21</span>
queue_refresh_period = <span style="color: #000000;">10</span></pre></div></div>


<p>Danach kann der Ticker gestartet werden&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pgqadm.py <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ticker.ini ticker</pre></div></div>


<p>Als nächstes brauchen wir noch für londiste ebenfalls eine Konfigurationsdatei (hier /etc/londiste.ini):</p>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>londiste<span style="color: #66cc66;">&#93;</span>
job_name <span style="color: #66cc66;">=</span> test_to_subcriber
provider_db <span style="color: #66cc66;">=</span> dbname<span style="color: #66cc66;">=</span>test port<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">5432</span> host<span style="color: #66cc66;">=&lt;</span>IP<span style="color: #66cc66;">-</span>VON<span style="color: #66cc66;">-</span>MASTER<span style="color: #66cc66;">&gt;</span>
subscriber_db <span style="color: #66cc66;">=</span> dbname<span style="color: #66cc66;">=</span>test port<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">5432</span> host<span style="color: #66cc66;">=&lt;</span>IP<span style="color: #66cc66;">-</span>VON<span style="color: #66cc66;">-</span>SLAVE<span style="color: #66cc66;">&gt;</span>
pgq_queue_name <span style="color: #66cc66;">=</span> londiste<span style="color: #66cc66;">.</span>replika
logfile <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">/</span>tmp<span style="color: #66cc66;">/</span>%<span style="color: #66cc66;">&#40;</span>job_name<span style="color: #66cc66;">&#41;</span>s<span style="color: #66cc66;">.</span>log
pidfile <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">/</span>tmp<span style="color: #66cc66;">/</span>%<span style="color: #66cc66;">&#40;</span>job_name<span style="color: #66cc66;">&#41;</span>s<span style="color: #66cc66;">.</span>pid</pre></div></div>


<p>Die londiste Konfigurationsdatei muss auf beiden Server sein, damit die Replikation funktioniert. Auf dem Slave-System kann londiste nun installiert werden</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ londiste.py <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>londiste.ini provider <span style="color: #c20cb9; font-weight: bold;">install</span>
$ londiste.py <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>londiste.ini subscriber <span style="color: #c20cb9; font-weight: bold;">install</span>
$ londiste.py <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>londiste.ini provider add <span style="color: #7a0874; font-weight: bold;">test</span>
$ londiste.py <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>londiste.ini subscriber add <span style="color: #7a0874; font-weight: bold;">test</span>
$ londiste.py <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>londiste.ini replay</pre></div></div>


<p>Londiste läuft nun im Hintergrund als Daemon und sollte alle neuen Daten sofort auf den Slave replizieren.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/06/16/postgresql-replikation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Es muss nicht immer Bind sein&#8230;</title>
		<link>http://www.treibsand.com/2009/02/20/maradns/</link>
		<comments>http://www.treibsand.com/2009/02/20/maradns/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 09:01:47 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Bind]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[FreeNAS]]></category>
		<category><![CDATA[MaraDNS]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/?p=254</guid>
		<description><![CDATA[Die meisten Administratoren, welchen einen DNS Server aufsetzen wollen, denken automatisch an Bind. Klar, Bind ist ein hervorragender DNS Server, oft aber zu umfangreich für eine kleine Installation. Soll z.B. ein DNS Server auf einem extrem abgespecktem System, wie z.B. FreeNAS installiert werden, dann bietet sich eher was kleineres an&#8230; Genau das war vor kurzem [...]]]></description>
			<content:encoded><![CDATA[<p>Die meisten Administratoren, welchen einen DNS Server aufsetzen wollen, denken automatisch an Bind. Klar, Bind ist ein hervorragender DNS Server, oft aber zu umfangreich für eine kleine Installation. Soll z.B. ein DNS Server auf einem extrem abgespecktem System, wie z.B. <a href="http://www.freenas">FreeNAS</a> installiert werden, dann bietet sich eher was kleineres an&#8230;</p>

<p><span id="more-254"></span>
Genau das war vor kurzem bei mir der Fall, wo ich einen DNS Server in meiner FreeNAS Installation brauchte. Ich hab auch schon an <a href="http://tinydns.org">TinyDNS</a> von D.J. Bernstein gedacht, allerdings braucht dieser /usr/sbin/daemon, was bei mir nicht verfügbar ist.</p>

<p>Also viel meine Wahl auf <a href="http://www.maradns.org">MaraDNS</a>. Hierbei handelt es sich um einen extrem kleinen DNS Server, welcher seine Zonen aus CSV Dateien holt. Ziemlich einfach zu installieren bzw. konfigurieren.</p>

<p>Unter FreeBSD reicht ein <b>pkg_add -r maradns</b> und die Software ist installiert. Die Konfiguration in der Datei mararc ist auch recht simpel&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">csv2 = <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
csv2<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;example.com.&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">&quot;db.example.com&quot;</span>
csv2<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;0.168.192.in-addr.arpa.&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">&quot;db.192.168.0&quot;</span>
&nbsp;
ipv4_bind_addresses = <span style="color: #ff0000;">&quot;0.0.0.0&quot;</span>
chroot_dir = <span style="color: #ff0000;">&quot;/usr/local/etc/maradns&quot;</span>
maradns_uid = <span style="color: #000000;">53</span>
maradns_gid = <span style="color: #000000;">53</span>
maxprocs = <span style="color: #000000;">96</span>
no_fingerprint = <span style="color: #000000;">0</span>
default_rrany_set = <span style="color: #000000;">3</span>
max_chain = <span style="color: #000000;">8</span>
max_ar_chain = <span style="color: #000000;">1</span>
max_total = <span style="color: #000000;">20</span>
verbose_level = <span style="color: #000000;">1</span>
&nbsp;
ipv4_alias = <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>  = <span style="color: #ff0000;">&quot;198.41.0.4, 192.228.79.201, 192.33.4.12, 128.8.10.90,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;192.203.230.10, 192.5.5.241, 192.112.36.4,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;128.63.2.53, 192.36.148.17, 192.58.128.30,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;icann&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;193.0.14.129, 198.32.64.12, 202.12.27.33&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>  = <span style="color: #ff0000;">&quot;157.238.46.24, 209.104.33.250, 209.104.63.249,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;130.94.168.216, 209.21.75.53, 64.114.34.119,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;207.6.128.246, 167.216.255.199, 62.208.181.95,&quot;</span>
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;opennic&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> += <span style="color: #ff0000;">&quot;216.87.153.98, 216.178.136.116&quot;</span>
&nbsp;
ipv4_alias<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;localhost&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">&quot;127.0.0.0/8&quot;</span>
recursive_acl = <span style="color: #ff0000;">&quot;localhost,192.168.0.0/8&quot;</span></pre></div></div>


<p>In der Konfiguration werden 2 Zonen eingerichtet, eine für example.com und eine Reverse Zone für 192.168.0. Ausserdem wird mit <b>recursive_acl</b> das Netz 192.168.0.0/8 für Abfragen freigeschalten.</p>

<p>Die Zonen an sich sind auch extrem einfach aufgebaut. Die Zone für example.com in der Datei db.exmaple.com</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server1.example.com. A 192.168.0.1
server1.exmaple.com. MX <span style="color: #000000;">10</span> server1.example.com.
server2.example.com. CNAME server1.example.com.
&nbsp;
client1 A 192.168.0.10
client2 A 192.168.0.11</pre></div></div>


<p>Die Datei db.192.168.0 für die Rückwärtsauflösung sieht dann z.B. wie folgt aus&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">1.0.168.192 PTR server1.example.com.
10.0.168.192 PTR client1.example.com.
11.0.168.192 PTR client2.example.com.</pre></div></div>


<p>Auch der Umstieg von Bind wird leicht gemacht. Mit dem Tool <b>getzone</b>, welches mitgeliefert wird, können direkt die Zonen von einem anderen Server geholt, und in das MaraDNS Format ausgegeben werden. Das erspart lästige Tipparbeit <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">getzone example.com 192.168.0.100</pre></div></div>


<p>Hier hole ich die Zone example.com von dem Nameserver mit der IP 192.168.0.100.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/02/20/maradns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD aktualisieren</title>
		<link>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/</link>
		<comments>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 18:43:25 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/</guid>
		<description><![CDATA[Jeder Administrator, welcher schon mal ein make world unter FreeBSD gemacht hat, weiss wie lange es dauert das System zu aktualisieren bzw. wie umständlich es ist. Hier hilft das Tool freebsd-update. Es handelt sich hierbei um ein Shell Script, welches seit FreeBSD 6.4 mitgeliefert wird. Mit diesem Script kann das ganze System (ausgenommen Ports natürlich) [...]]]></description>
			<content:encoded><![CDATA[<p>Jeder Administrator, welcher schon mal ein make world unter <a href="http://www.freebsd.org">FreeBSD</a> gemacht hat, weiss
wie lange es dauert das System zu aktualisieren bzw. wie umständlich es ist. Hier hilft das Tool freebsd-update.</p>

<p><span id="more-175"></span>
Es handelt sich hierbei um ein Shell Script, welches seit FreeBSD 6.4 mitgeliefert wird. Mit diesem Script kann
das ganze System (ausgenommen Ports natürlich) einfach geupdatet werden.</p>

<p>FreeBSD wird dabei nicht aus den Quellen neu gebaut, es werden Binaries verwendet, und hier wird auch nur
die x86 Architektur bedient. Weitere Vorraussetzung ist, dass das System ein Release ist, also z.B. 7.1-RELEASE.
Systeme, welche vorher mit make world geupdatet wurden kann freebsd-update nicht analysieren.</p>

<p>Um z.B. aktuelle Sicherheitsupdates zu installieren reicht:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update fetch
freebsd-update <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>


<p>Darauf hin untersucht freebsd-update das System und sucht für dieses Release neue Updates. Diese werden
dann installiert, sofern nötig muss der Rechner rebootet werden.</p>

<p>Soll das ganze System auf ein neues Release geupdatet werden, dann muss dieses explizit angegeben werden.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update <span style="color: #660033;">-r</span> <span style="color: #000000;">7.1</span>-RELEASE upgrade
freebsd-update <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>


<p>Bei Release Updates muss der Rechner rebootet werden, da ein neuer GENERIC Kernel installiert wird. Sobald
man allerdings einen selbst gebautet Kernel verwendet, wird das ganze etwas komplizierter. Dieser muss dann
natürlich nochmal gegen die neuen Sourcen gebaut werden. freebsd-update weisst aber darauf hin. Nach einem Update auf ein neues Release muss man noch alle Ports gegen das neue Basissystem bauen.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portupgrade <span style="color: #660033;">-af</span></pre></div></div>


<p>Hier hat es wieder der Admin einfach, welcher nur Packages verwendet <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<p>Allgemein ist freebsd-update ein wunderbares Tool, um ein System relativ einfach aktuell zu halten. Vor kurzem
hat es mir dabei geholfen, ein FreeBSd 6.2 auf 7.1 zu aktualisieren. Dabei kam es zu keinem Problem. Übrigens,
mergemaster fällt mit freebsd-update auch weg <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2009/01/18/freebsd-aktualisieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brute Force Angriffe mit DenyHosts abwehren</title>
		<link>http://www.treibsand.com/2008/09/19/brute-force-angriffe-mit-denyhosts-abwehren/</link>
		<comments>http://www.treibsand.com/2008/09/19/brute-force-angriffe-mit-denyhosts-abwehren/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 16:07:46 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Sicherheit]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/?p=165</guid>
		<description><![CDATA[Viele Systemadministratoren kennen bestimmt das Problem, dass sehr viele Brute Force Angriffe gegen die eigenen Server laufen. Systematisch werden Logins mit den ueblichen Benutzernamen bzw. Passwörtern per SSH versucht. Genau hier hilft DenyHosts. Es handelt sich hierbei um einen kleinen Daemon, welcher permanent die Datei /var/auth.log liest und bei mehrmaligen fehlgeschlagenen Login Versuchen die IP [...]]]></description>
			<content:encoded><![CDATA[<p>Viele Systemadministratoren kennen bestimmt das Problem, dass sehr viele Brute Force Angriffe gegen die eigenen Server laufen. Systematisch werden Logins mit den ueblichen Benutzernamen bzw. Passwörtern per SSH versucht. </p>

<p><span id="more-165"></span>
Genau hier hilft DenyHosts. Es handelt sich hierbei um einen kleinen Daemon, welcher permanent die Datei /var/auth.log liest und bei mehrmaligen fehlgeschlagenen Login Versuchen die IP per /etc/hosts.allow blockt. Das Prinzip ist nicht neu, es gibt z.B. auch andere Tools, welche die gleiche Funktionalität z.B. per iptables lösen.</p>

<p>Das ist aber noch nicht alles, man kann den Daemon auch so einstellen, dass der die gefundenen IPs der globalen Datenbank von DenyHosts meldet. Im Gegenzug kann auch die Datenbank verwendet werden um die Hosts Datei zu füttern. Seit dem ich das Tool auf meinen Servern installiert habe, haben die Angriffe fast aufgehört bzw. es wurden fast alle sofort geblockt.</p>

<p>Die Konfiguration ist denkbar einfach. Nachdem die Software installiert ist, muss als erstes die Datei denyhosts.conf angepasst werden. Die Konfigurationsdatei ist ziemlich selbsterklärend. Danach kann auch schon der Daemon gestartet werden. Dank der Ports Collection von FreeBSD war das Startscript bereits vorhanden. Der Daemon schreibt seine Einträge dann üblicherweise in die Datei /etc/hosts.deniedssh, welche nur noch in die Datei /etc/hosts.allow eingebunden werden muss mit&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sshd : <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts.deniedssh : deny  
sshd : ALL : allow</pre></div></div>


<p>Danach ist das komplette System fertig konfiguriert und das System blockt automatisch SSH Anfragen von IPs, welche in der Datenbank von DenyHosts gelistet sind. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2008/09/19/brute-force-angriffe-mit-denyhosts-abwehren/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OpenLDAP Replikation</title>
		<link>http://www.treibsand.com/2007/03/19/openldap_replikation/</link>
		<comments>http://www.treibsand.com/2007/03/19/openldap_replikation/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 14:35:42 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[LDAP]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/?p=76</guid>
		<description><![CDATA[Kaum wächst ein LDAP Verzeichnis stark, muss man sich Gedanken darüber machen, ob der Server dafür eigentlich noch ausreichend Performance hat. OpenLDAP bietet zum Glück mit slurpd die geeigneten Mittel um ein Verzeichnis auf einen anderen Server zu replizieren. In meinem Setup wollte ich nur einen LDAP Server, welcher alle Schreibzugriffe bearbeitet und somit der [...]]]></description>
			<content:encoded><![CDATA[<p>Kaum wächst ein LDAP Verzeichnis stark, muss man sich Gedanken darüber machen, ob der Server dafür eigentlich noch ausreichend Performance hat. OpenLDAP bietet zum Glück mit slurpd die geeigneten Mittel um ein Verzeichnis auf einen anderen Server zu replizieren. </p>

<p><span id="more-76"></span>
In meinem Setup wollte ich nur einen LDAP Server, welcher alle Schreibzugriffe bearbeitet und somit der eigentliche Master-Server ist. Alle anderen LDAP Server sind nur noch für Lesezugriffe da.</p>

<p>Für den Master müssen nur folgende Zeilen in die slapd.conf eintragen werden:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">replica <span style="color: #007800;">host</span>=HOSTNAME-REPLICA-SERVER:<span style="color: #000000;">389</span>
        <span style="color: #007800;">suffix</span>=<span style="color: #ff0000;">&quot;LDAP-SUFFIX&quot;</span>
        <span style="color: #007800;">binddn</span>=<span style="color: #ff0000;">&quot;DN-MANAGER&quot;</span>
        <span style="color: #007800;">credentials</span>=PASSWORT
        <span style="color: #007800;">bindmethod</span>=simple</pre></div></div>


<p>Für jeden Slave Server muss eine replica host Direktive vorhanden sein. </p>

<p>Die Slave Server lassen sich sogar noch einfach konfigurieren&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">updatedn        <span style="color: #ff0000;">&quot;DN-MANAGER&quot;</span>
updateref     ldap:<span style="color: #000000; font-weight: bold;">//</span>HOSTNAME-MASTER:<span style="color: #000000;">389</span></pre></div></div>


<p>Durch updateref leitet der Slave alle Update- bzw. Schreib-Request zum Master weiter.</p>

<p>So simpel kann eine Replikation eingerichtet werden <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2007/03/19/openldap_replikation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ProFTP mit SQLite Backend</title>
		<link>http://www.treibsand.com/2006/08/03/proftp-mit-sqlite-backend/</link>
		<comments>http://www.treibsand.com/2006/08/03/proftp-mit-sqlite-backend/#comments</comments>
		<pubDate>Thu, 03 Aug 2006 21:28:38 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ProFTP]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/2009/01/15/proftp-mit-sqlite-backend/</guid>
		<description><![CDATA[Was tun, wenn man einige User für einen FTP Server hat, allerdings keine Systembenutzer einrichten möchte? Der freie FTP Server ProFTP unterstützt zwar MySQL Und PostgreSQL Backends, aber die sind gar nicht nötig, wenn es nur um eine Handvoll von Benutzern geht. Da ProFTP selber über eine Modul Schnittstelle verfügt ist es kein Problem diese [...]]]></description>
			<content:encoded><![CDATA[<p>Was tun, wenn man einige User für einen FTP Server hat, allerdings keine Systembenutzer einrichten möchte? Der freie FTP Server ProFTP unterstützt zwar MySQL Und PostgreSQL Backends, aber die sind gar nicht nötig, wenn es nur um eine Handvoll von Benutzern geht.</p>

<p><span id="more-9"></span>
Da ProFTP selber über eine Modul Schnittstelle verfügt ist es kein Problem diese Funktionalität einzubauen. Unter http://www.castaglia.org/proftpd/modules/mod<em>sql</em>sqlite.html gibt es genau für diesen Fall ein passendes Modul <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p>Sobald das Modul mit einkompiliert ist, kann das Backend in der proftpd.conf wie folgt angesprochen werden:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_sql_sqlite.c<span style="color: #000000; font-weight: bold;">&gt;</span>
  SQLConnectInfo <span style="color: #000000; font-weight: bold;">/</span>pfad<span style="color: #000000; font-weight: bold;">/</span>zu<span style="color: #000000; font-weight: bold;">/</span>ftpd.db
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>


<p>Mehr ist für die Verbindung zur Datenbank nicht nötig. Da ProFTP selber schon eine Schnittstelle für SQL hat, kann die Abfrage der Benutzer mit mod<em>sql gemacht werden. Eine Anleitung hierfür ist unter http://www.castaglia.org/proftpd/modules/mod</em>sql.html zu finden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2006/08/03/proftp-mit-sqlite-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
