<?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>Robert Penz Blog</title>
	<atom:link href="http://robert.penz.name/feed/" rel="self" type="application/rss+xml" />
	<link>http://robert.penz.name</link>
	<description>About Linux, IT security,tips and tricks and otherstuff that comes into my mind</description>
	<lastBuildDate>Sat, 07 Apr 2012 09:46:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>IPv6 activated for robert.penz.name</title>
		<link>http://robert.penz.name/414/ipv6-activated-for-robert-penz-name/</link>
		<comments>http://robert.penz.name/414/ipv6-activated-for-robert-penz-name/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 09:45:22 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=414</guid>
		<description><![CDATA[I&#8217;ve just activated IPv6 for my blog. You should now get A and AAAA records for the DNS name robert.penz.name. I hope it does not break anything, but you need to go with the time as the saying is. A query should show following: $ host robert.penz.name robert.penz.name has address 173.245.61.149 robert.penz.name has address 173.245.61.58 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just activated IPv6 for my blog. You should now get A and AAAA records for the DNS name robert.penz.name. I hope it does not break anything, but you need to go with the time as the saying is.</p>
<p>A query should show following:<br />
<code><br />
$ host robert.penz.name<br />
robert.penz.name has address 173.245.61.149<br />
robert.penz.name has address 173.245.61.58<br />
robert.penz.name has IPv6 address 2400:cb00:2048:1::adf5:3d3a<br />
robert.penz.name has IPv6 address 2400:cb00:2048:1::adf5:3d95<br />
robert.penz.name mail is handled by 10 mail.penz.name.<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/414/ipv6-activated-for-robert-penz-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto enable SSH public key authentication on Ubiquiti AirOS (e.g. NanoStation2)</title>
		<link>http://robert.penz.name/405/howto-enable-ssh-public-key-authentication-on-ubiquiti-airos-e-g-nanostation2/</link>
		<comments>http://robert.penz.name/405/howto-enable-ssh-public-key-authentication-on-ubiquiti-airos-e-g-nanostation2/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 20:15:21 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=405</guid>
		<description><![CDATA[First you need to check if the ssh service is enabled and than you need to login and use following commands. First you need to make sure your home directory is the same as mine: echo ~ should return /etc/persistent, which is used in this Howto. So lets start the actual work: chmod 750 /etc/persistent/ [...]]]></description>
			<content:encoded><![CDATA[<p>First you need to check if the ssh service is enabled and than you need to login and use following commands. First you need to make sure your home directory is the same as mine:<br />
<code><br />
echo ~<br />
</code></p>
<p>should return <code>/etc/persistent</code>, which is used in this Howto. So lets start the actual work:<br />
<code><br />
chmod 750 /etc/persistent/<br />
cd /etc/persistent/<br />
mkdir .ssh<br />
chmod 700 .ssh<br />
</code></p>
<p>Type on the machine you want to be able to use for public key login:<br />
<code><br />
cat ~/.ssh/id_dsa.pub | ssh username@x.x.x.x 'cat >> /etc/persistent/.ssh/authorized_keys'<br />
</code></p>
<p>Now you should be able to login like this<br />
<code><br />
ssh username@x.x.x.x<br />
</code></p>
<p>without a password. If so you need to make sure that it stays so even after a reboot:<br />
<code><br />
cfgmtd -w -p /etc/<br />
</code></p>
<p>Type <code>reboot</code> to test it!</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/405/howto-enable-ssh-public-key-authentication-on-ubiquiti-airos-e-g-nanostation2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Howto setup a haproxy as fault tolerant / high available load balancer for multiple caching web proxies on RHEL/Centos/SL</title>
		<link>http://robert.penz.name/386/howto-setup-a-haproxy-as-fault-tolerant-high-available-load-balancer-for-multiple-caching-web-proxies-on-rhelcentossl/</link>
		<comments>http://robert.penz.name/386/howto-setup-a-haproxy-as-fault-tolerant-high-available-load-balancer-for-multiple-caching-web-proxies-on-rhelcentossl/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 18:16:02 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=386</guid>
		<description><![CDATA[As I didn&#8217;t find much documentation on the topic of setting up a load balancer for multiple caching web proxies, specially in a high availability way on common Linux enterprise distributions I sat down and wrote this howto. If you&#8217;re working at a large organization, one web proxy will not be able to handle the [...]]]></description>
			<content:encoded><![CDATA[<p>As I didn&#8217;t find much documentation on the topic of setting up a load balancer for multiple caching web proxies, specially in a high availability way on common Linux enterprise distributions I sat down and wrote this howto.</p>
<p>If you&#8217;re working at a large organization, one web proxy will not be able to handle the whole load and you&#8217;ll also like some redundancy in case one proxy fails. A common setup is in this case to use the <a href="http://en.wikipedia.org/wiki/Proxy_auto-config" target="_blank">pac file</a> to tell the client to use different proxies, for example one for .com addresses and one for all others, or a random value for each page request. Others use <a href="http://en.wikipedia.org/wiki/Round-robin_DNS" target="_blank">DNS round robin</a> to balance the load between the proxies. In both cases you can remove one proxy node from the wheel for maintenances or of it goes down. But thats not done withing seconds and automatically. This howto will show you how to setup a <a href="http://haproxy.1wt.eu/" target="_blank">haproxy</a> with <a href="http://www.corosync.org/doku.php" target="_blank">corosync</a> and <a href="http://www.clusterlabs.org/" target="_blank">pacemaker</a> on RHEL6, Centos6 or SL6 as TCP load balancer for multiple HTTP proxies, which does exactly that. It will be high available by itself and also recognize if one proxy does not accept connections anymore and will remove it  automatically from the load balancing until it is back in operation.</p>
<p><strong>The Setup</strong></p>
<p>As many organizations will have appliances (which do much more than just caching the web)  as their web proxies, I will show a setup with two additional servers (can be virtual or physical) which are used as load balancer. If you in your organization have normal Linux server as your web proxies you can of course use two or more also as load balancer nodes.</p>
<p>Following diagram shows the principle setup and the IP addresses and hostnames used in this howto:</p>
<p><img class="aligncenter size-full wp-image-388" title="haproxy_loadbalancer_caching_proxy_blogpost-01" src="http://robert.penz.name/wp-content/uploads/2012/02/haproxy_loadbalancer_caching_proxy_blogpost-01.png" alt="" width="700" height="597" /></p>
<p><strong>Preconditions</strong></p>
<p>As the proxies and therefore the load balancer are normally in the external DMZ we care about security and therefore we&#8217;ll check that <a href="http://en.wikipedia.org/wiki/Selinux" target="_blank">Selinux</a> is activated. The whole setup will run with SeLinux actived without changing anything. For this we take a look at <code>/etc/sysconfig/selinux</code> and verify that <code>SELINUX</code> is set to <code>enforcing</code>. Change it if not and reboot. You should also install some packages with</p>
<p><code>yum install setroubleshoot setools-console</code></p>
<p>and make sure all is running with</p>
<p><code><br />
[root@proxylb01/02 ~]# sestatus<br />
SELinux status:                 enabled<br />
SELinuxfs mount:                /selinux<br />
Current mode:                   enforcing<br />
Mode from config file:          enforcing<br />
Policy version:                 24<br />
Policy from config file:        targeted<br />
</code></p>
<p>and</p>
<p><code><br />
[root@proxylb01/02 ~]# /etc/init.d/auditd status<br />
auditd (pid  1047) is running...<br />
</code></p>
<p>on both nodes. After this we make sure that our own host names are in the hosts files for security reasons and if the the DNS servers go down. The <code>/etc/hosts</code> file on both nodes should contain following:</p>
<p><code><br />
10.0.0.1    proxylb01 proxylb01.int<br />
10.0.0.2    proxylb02 proxylb02.int<br />
10.0.0.3    proxy proxy.int<br />
</code></p>
<p><strong>Software Installation and corosync setup</strong></p>
<p>We need to add some additional repositories to get the required software. The package for haproxy is in the <a href="http://fedoraproject.org/wiki/EPEL" target="_blank">EPEL</a> repositories. corosync and pacemaker are shipped as part of the distribution in Centos 6 and Scientific Linux 6, but you need the High Availability Addon for RHEL6 to get the packages. </p>
<p>Install all the software we need with </p>
<p><code><br />
[root@proxylb01/02 ~]# yum install pacemaker haproxy<br />
[root@proxylb01/02 ~]# chkconfig corosync on<br />
[root@proxylb01/02 ~]# chkconfig pacemaker on<br />
</code></p>
<p>We use the example corsync config as starting point:</p>
<p><code><br />
[root@proxylb01/02 ~]# cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf<br />
</code></p>
<p>And we add following lines after the version definition line:</p>
<p><code><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # How long before declaring a token lost (ms)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; token: 5000<br />
</code><code><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # How many token retransmits before forming a new configuration<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; token_retransmits_before_loss_const: 20<br />
</code><code><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # How long to wait for join messages in the membership protocol (ms)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; join: 1000<br />
</code><code><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; consensus: 7500<br />
</code><code><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Turn off the virtual synchrony filter<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vsftype: none<br />
</code><code><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Number of messages that may be sent by one processor on receipt of the token<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max_messages: 20<br />
</code></p>
<p>These values make the switching slower than default, but less trigger happy. This is required in my case as we&#8217;ve the machines running in VMware, where we use the snapshot feature to make backups and also move the VMware instances around. In both cases we&#8217;ve seen timeouts under high load of up to 4 seconds, normally 1-2 seconds.</p>
<p>Some lines later we&#8217;ve define the interfaces:</p>
<p><code><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; interface {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; member {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;memberaddr: 10.0.0.1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; member {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;memberaddr: 10.0.0.2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ringnumber: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bindnetaddr: 10.0.0.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mcastport: 5405<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ttl: 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transport: udpu<br />
</code></p>
<p>We use the new unicast feature introduced in RHEL 6.2, if you&#8217;ve an older version you need to use the multicast method. Of course you can use the multicast method also with 6.2 and higher, I just didn&#8217;t see the purpose of it for 2 nodes. The configuration file <code>/etc/corosync/corosync.conf</code> is the same on both nodes so you can copy it. </p>
<p>Now we need to define pacemaker as our resource handler with following command:</p>
<p><code><br />
[root@proxylb01/02 ~]# cat < <-END >>/etc/corosync/service.d/pcmk<br />
service {<br />
        # Load the Pacemaker Cluster Resource Manager<br />
        name: pacemaker<br />
        ver:  1<br />
}<br />
END<br />
</code></p>
<p>Now we&#8217;ve ready to test-fly it and &#8230;</p>
<p><code><br />
[root@proxylb01/02 ~]# /etc/init.d/corosync start<br />
</code></p>
<p>&#8230; do some error checking &#8230;</p>
<p><code><br />
[root@proxylb01/02 ~]# grep -e "corosync.*network interface" -e "Corosync Cluster Engine" -e "Successfully read main configuration file" /var/log/messages<br />
Feb 10 11:03:20 proxylb01/02 corosync[1691]:   [MAIN  ] Corosync Cluster Engine ('1.2.3'): started and ready to provide service.<br />
Feb 10 11:03:20 proxylb01/02 corosync[1691]:   [MAIN  ] Successfully read main configuration file '/etc/corosync/corosync.conf'.<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [TOTEM ] The network interface [10.0.0.1/2] is now up.<br />
</code></p>
<p>&#8230; and some more.</p>
<p><code><br />
[root@proxylb01/02 ~]# grep TOTEM /var/log/messages<br />
Feb 10 11:03:20 proxylb01/02 corosync[1691]:   [TOTEM ] Initializing transport (UDP/IP Unicast).<br />
Feb 10 11:03:20 proxylb01/02 corosync[1691]:   [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [TOTEM ] The network interface [10.0.0.1/2] is now up.<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.<br />
</code></p>
<p><strong>Pacemaker setup</strong></p>
<p>Now we need to check Pacemaker &#8230;</p>
<p><code><br />
[root@proxylb01/02 ~]#  grep pcmk_startup /var/log/messages<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [pcmk  ] info: pcmk_startup: CRM: Initialized<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [pcmk  ] Logging: Initialized pcmk_startup<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [pcmk  ] info: pcmk_startup: Maximum core file size is: 18446744073709551615<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [pcmk  ] info: pcmk_startup: Service: 10<br />
Feb 10 11:03:21 proxylb01/02 corosync[1691]:   [pcmk  ] info: pcmk_startup: Local hostname: proxylb01/02.int<br />
</code></p>
<p>&#8230; and start it &#8230;</p>
<p><code><br />
[root@proxylb01/02 ~]# /etc/init.d/pacemaker start<br />
Starting Pacemaker Cluster Manager:                        [  OK  ]<br />
</code></p>
<p>&#8230; and do some more error checking:</p>
<p><code><br />
[root@proxylb01/02 ~]#  grep -e pacemakerd.*get_config_opt -e pacemakerd.*start_child -e "Starting Pacemaker" /var/log/messages<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Found 'pacemaker' for option: name<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Found '1' for option: ver<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Defaulting to 'no' for option: use_logd<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Defaulting to 'no' for option: use_mgmtd<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Found 'off' for option: debug<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Found 'yes' for option: to_logfile<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Found '/var/log/cluster/corosync.log' for option: logfile<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Found 'yes' for option: to_syslog<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1709]: info: get_config_opt: Defaulting to 'daemon' for option: syslog_facility<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1711]: info: main: Starting Pacemaker 1.1.5-5.el6 (Build: 01e86afaaa6d4a8c4836f68df80ababd6ca3902f):  manpages docbook-manpages publican ncurses cman cs-quorum corosync snmp libesmtp<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1711]: info: start_child: Forked child 1715 for process stonith-ng<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1711]: info: start_child: Forked child 1716 for process cib<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1711]: info: start_child: Forked child 1717 for process lrmd<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1711]: info: start_child: Forked child 1718 for process attrd<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1711]: info: start_child: Forked child 1719 for process pengine<br />
Feb 10 11:05:41 proxylb01/02 pacemakerd: [1711]: info: start_child: Forked child 1720 for process crmd<br />
</code></p>
<p>We should also make sure that the process is running &#8230;</p>
<p><code><br />
[root@proxylb01/02 ~]# ps axf | grep pacemakerd<br />
6560 pts/0    S      0:00 pacemakerd<br />
 6564 ?        Ss     0:00  \_ /usr/lib64/heartbeat/stonithd<br />
 6565 ?        Ss     0:00  \_ /usr/lib64/heartbeat/cib<br />
 6566 ?        Ss     0:00  \_ /usr/lib64/heartbeat/lrmd<br />
 6567 ?        Ss     0:00  \_ /usr/lib64/heartbeat/attrd<br />
 6568 ?        Ss     0:00  \_ /usr/lib64/heartbeat/pengine<br />
 6569 ?        Ss     0:00  \_ /usr/lib64/heartbeat/crmd<br />
</code></p>
<p>and as a last check, take a look if there is any error message in the <code>/var/log/messages</code> with<br />
<code><br />
[root@proxylb01/02 ~]# grep ERROR: /var/log/messages | grep -v unpack_resources<br />
</code><br />
which should return nothing. </p>
<p><strong>cluster configuration</strong></p>
<p>We&#8217;ll change into the cluster configuration and administration CLI with the command <code>crm</code> and check the default configuration, which should look like this:</p>
<p><code><br />
crm(live)# configure show<br />
node proxylb01.int<br />
node proxylb02.int<br />
property $id="cib-bootstrap-options" \<br />
        dc-version="1.1.5-5.el6-01e86afaaa6d4a8c4836f68df80ababd6ca3902f" \<br />
        cluster-infrastructure="openais" \<br />
        expected-quorum-votes="2"<br />
crm(live)# bye<br />
</code></p>
<p>And if we call following: </p>
<p><code><br />
[root@proxylb01/02 ~]# crm_verify -L<br />
crm_verify[1770]: 2012/02/10_11:08:22 ERROR: unpack_resources: Resource start-up disabled since no STONITH resources have been defined<br />
crm_verify[1770]: 2012/02/10_11:08:22 ERROR: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option<br />
crm_verify[1770]: 2012/02/10_11:08:22 ERROR: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity<br />
Errors found during check: config not valid<br />
  -V may provide more details<br />
</code></p>
<p>We see that STONITH, has not been configurated, but we don&#8217;t need it as we have no filesystem or database running which could go corrupt, so we disable it.</p>
<p><code><br />
[root@proxylb01/02 ~]# crm configure property stonith-enabled=false<br />
[root@proxylb01/02 ~]# crm_verify -L<br />
</code></p>
<p>Now we download the OCF script for haproxy </p>
<p><code><br />
[root@proxylb01/02 ~]# wget -O /usr/lib/ocf/resource.d/heartbeat/haproxy http://github.com/russki/cluster-agents/raw/master/haproxy<br />
[root@proxylb01/02 ~]# chmod 755 /usr/lib/ocf/resource.d/heartbeat/haproxy<br />
</code></p>
<p>After this we&#8217;re ready to configure the cluster with following commands:</p>
<p><code><br />
[root@wgwlb01 ~]# crm<br />
crm(live)# configure<br />
crm(live)configure# primitive haproxyIP03 ocf:heartbeat:IPaddr2 params ip=10.0.0.3 cidr_netmask=32 op monitor interval=5s<br />
crm(live)configure# group haproxyIPs haproxyIP03 meta ordered=false<br />
crm(live)configure# property no-quorum-policy=ignore<br />
crm(live)configure# primitive haproxyLB ocf:heartbeat:haproxy params conffile=/etc/haproxy/haproxy.cfg op monitor interval=30s<br />
crm(live)configure# colocation haproxyWithIPs INFINITY: haproxyLB haproxyIPs<br />
crm(live)configure# order haproxyAfterIPs mandatory: haproxyIPs haproxyLB<br />
crm(live)configure# commit<br />
</code></p>
<p>These commands added the floating IP address to the cluster and than we created an group of IP addresses in case we later need more than one. We than defined that we need no quorum and added the haproxy to the mix and we made sure that the haproxy and its IP address is always on the same node and that the IP address is brought up before haproxy is.</p>
<p>Now the cluster setup is done and you should see the haproxy running on one node with <code>crm_mon -1</code>. </p>
<p><strong>haproxy configuration</strong></p>
<p>We now only need to setup haproxy, which is done by configurating following file: <code>/etc/haproxy/haproxy.cfg</code> </p>
<p>We make sure that haproxy is sending logfiles by having following in the <code>global</code> section<br />
<code><br />
log         127.0.0.1 local2 notice<br />
</code></p>
<p>and set <code>maxconn 8000</code> (or more if you need more). The <code>defaults</code> sections looks following in my setup:</p>
<p><code><br />
    log                     global<br />
     # 30 minutes of waiting for a web request is crazy,<br />
     # but some users do it, and then complain the proxy<br />
     # broke the interwebs.<br />
     timeout client 30m<br />
     timeout server 30m<br />
     # If the server doesnt respond in 4 seconds its dead<br />
     timeout connect 4s<br />
</code></p>
<p>And now the actual load balancer configuration<br />
<code><br />
listen http_proxy 10.0.0.3:3128<br />
&nbsp; &nbsp; &nbsp; &nbsp; mode tcp<br />
&nbsp; &nbsp; &nbsp; &nbsp; balance roundrobin<br />
&nbsp; &nbsp; &nbsp; &nbsp; server proxynode01 10.0.0.11 check<br />
&nbsp; &nbsp; &nbsp; &nbsp; server proxynode02 10.0.0.12 check<br />
&nbsp; &nbsp; &nbsp; &nbsp; server proxynode03 10.0.0.13 check<br />
&nbsp; &nbsp; &nbsp; &nbsp; server proxynode04 10.0.0.14 check<br />
</code></p>
<p>If your caches have public IP addresses and are not natted to one outgoing IP address, you may wish to change the balance algorithm to <code>source</code>. Some web applications get confused when a client&#8217;s IP address changes between requests. Using <code>balance source</code> load balances clients across all web proxies, but once a client is assigned to a specific proxy, it continues to use that proxy. </p>
<p>And we would like to see some stats so we configure following:<br />
<code><br />
listen statslb01/02 :8080      # choose different names for the 2 nodes<br />
&nbsp; &nbsp; &nbsp; &nbsp; mode http<br />
&nbsp; &nbsp; &nbsp; &nbsp; stats enable<br />
&nbsp; &nbsp; &nbsp; &nbsp; stats hide-version<br />
&nbsp; &nbsp; &nbsp; &nbsp; stats realm Haproxy\ Statistics<br />
&nbsp; &nbsp; &nbsp; &nbsp; stats uri /<br />
&nbsp; &nbsp; &nbsp; &nbsp; stats auth admin:xxxxxxxxx<br />
</code></p>
<p><strong>rsyslog setup</strong></p>
<p>haproxy does not write its own log files, so we need to configure rsyslog for this. We add following to the <code>MODULES</code> configuration in <code>/etc/rsyslog.conf</code></p>
<p><code><br />
$ModLoad imudp.so<br />
$UDPServerRun 514<br />
$UDPServerAddress 127.0.0.1<br />
</code></p>
<p>and following to the <code>RULES</code> section.</p>
<p><code><br />
local2.*  /var/log/haproxy.log<br />
</code></p>
<p>and at last we do a configuration reload for haproxy with<br />
<code><br />
[root@wgwlb01 ~]# /etc/init.d/haproxy reload<br />
</code></p>
<p>After all this work, you should have a working high availability haproxy setup for your proxies. If you have any comments please don&#8217;t hesitate to write a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/386/howto-setup-a-haproxy-as-fault-tolerant-high-available-load-balancer-for-multiple-caching-web-proxies-on-rhelcentossl/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Howto fix W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures were invalid: BADSIG C2518248EEA14886 Launchpad?</title>
		<link>http://robert.penz.name/376/howto-fix-w-gpg-error-httpppa-launchpad-net-oneiric-release-the-following-signatures-were-invalid-badsig-c2518248eea14886-launchpad/</link>
		<comments>http://robert.penz.name/376/howto-fix-w-gpg-error-httpppa-launchpad-net-oneiric-release-the-following-signatures-were-invalid-badsig-c2518248eea14886-launchpad/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 15:34:52 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=376</guid>
		<description><![CDATA[Today I ran into the problem that my Ubuntu 11.10 (Oneiric) show following error message while trying apt-get update: Fetched 16.3 MB in 34s (473 kB/s) Reading package lists... Done W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures were invalid: BADSIG C2518248EEA14886 Launchpad VLC W: A error occurred during the signature verification. The repository [...]]]></description>
			<content:encoded><![CDATA[<p>Today I ran into the problem that my Ubuntu 11.10 (Oneiric) show following error message while trying <code>apt-get update</code>:</p>
<p><code><br />
Fetched 16.3 MB in 34s (473 kB/s)</code><br />
<code><br />
Reading package lists... Done<br />
W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures were invalid: BADSIG C2518248EEA14886 Launchpad VLC<br />
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com oneiric Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key <ftpmaster @ubuntu.com><br />
</ftpmaster></code><code><br />
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/oneiric/Release<br />
</code><code><br />
W: Some index files failed to download. They have been ignored, or old ones used instead.<br />
</code></p>
<p>I did following to fix it. Maybe it helps you too.<br />
<code><br />
apt-get clean<br />
cd /var/lib/apt<br />
mv lists lists.old<br />
mkdir -p lists/partial<br />
apt-get clean<br />
apt-get update<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/376/howto-fix-w-gpg-error-httpppa-launchpad-net-oneiric-release-the-following-signatures-were-invalid-badsig-c2518248eea14886-launchpad/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A1 Telekom Austria Internet via UMTS seems to have a forced disconnet every 8h</title>
		<link>http://robert.penz.name/373/a1-telekom-austria-internet-via-umts-seems-to-have-a-forced-disconnet-every-8h/</link>
		<comments>http://robert.penz.name/373/a1-telekom-austria-internet-via-umts-seems-to-have-a-forced-disconnet-every-8h/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 14:10:31 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Austria]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=373</guid>
		<description><![CDATA[I think it is well known that the DSL Internet plans from A1 Telekom Austria for private user (= not the more expensive business plans) have a forced 8h disconnect. I searched the Internet to check if it is the same for there UMTS USB sticks, and couldn&#8217;t find anything &#8211; seems that nobody cares [...]]]></description>
			<content:encoded><![CDATA[<p>I think it is well known that the DSL Internet plans from A1 Telekom Austria for private user (= not the more expensive business plans) have a forced 8h disconnect. I searched the Internet to check if it is the same for there UMTS USB sticks, and couldn&#8217;t find anything &#8211; seems that nobody cares or tried it. So I put the USB Stick into my server and let it run for a week now, and I can say now: Yes, there is a forced disconnect normally every 8h &#8230; but sometimes they seem to miss it. Take a look at the last few days &#8211; I did a grep on the connect time and the pid of the umts pppd:</p>
<p><code><br />
# cat /var/log/messages | grep "Connect time" | grep "9069"</p>
<p>Dec 27 20:56:17 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 28 04:56:53 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 28 12:57:00 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 28 20:57:05 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 29 04:57:42 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 29 12:57:49 xxx pppd[9069]: Connect time 480.1 minutes.<br />
Dec 29 22:20:09 xxx pppd[9069]: Connect time 561.8 minutes.<br />
Dec 30 06:20:44 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 30 14:23:20 xxx pppd[9069]: Connect time 482.5 minutes.<br />
Dec 30 22:05:07 xxx pppd[9069]: Connect time 461.7 minutes.<br />
Dec 31 06:05:44 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 31 14:06:21 xxx pppd[9069]: Connect time 480.1 minutes.<br />
</code></p>
<p>ps: 480min = 8h</p>
<p>Somebody knows why they are missing some disconnect times? Maybe it is traffic related &#8211; I try to make some traffic every few seconds on the link to verify that. </p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/373/a1-telekom-austria-internet-via-umts-seems-to-have-a-forced-disconnet-every-8h/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Idle SL/Centos machine in KVM leads to 5 Watt more power usage</title>
		<link>http://robert.penz.name/367/idle-slcentos-machine-in-kvm-leads-to-5-watt-more-power-usage/</link>
		<comments>http://robert.penz.name/367/idle-slcentos-machine-in-kvm-leads-to-5-watt-more-power-usage/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 10:52:31 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=367</guid>
		<description><![CDATA[My home server needs in idle state less than 25 Watt (Intel Core i3-2100, SSD for the system, 2TB HD) but as soon as a KVM machine runs I need 30 Watt. It does not matter if the virtual machine is idle. As guest I&#8217;ve a RHEL6 Clone (Scientific Linux) running with the virtualization modules [...]]]></description>
			<content:encoded><![CDATA[<p>My home server needs in idle state less than 25 Watt (Intel Core i3-2100, SSD for the system, 2TB HD) but as soon as a KVM machine runs I need 30 Watt. It does not matter if the virtual machine is idle. As guest I&#8217;ve a RHEL6 Clone (Scientific Linux) running with the virtualization modules loaded:</p>
<p><code><br />
# lsmod | grep virt<br />
virtio_balloon 4281 0<br />
virtio_net 15741 0<br />
virtio_blk 5692 3<br />
virtio_pci 6653 0<br />
virtio_ring 7169 4 virtio_balloon,virtio_net,virtio_blk,virtio_pci<br />
virtio 4824 4 virtio_balloon,virtio_net,virtio_blk,virtio_pci<br />
</code></p>
<p>But take a look at the screenshots &#8211; the first without running KVM virtual machine &#8230;</p>
<p><img class="aligncenter size-full wp-image-368" title="powertop1" src="http://robert.penz.name/wp-content/uploads/2011/12/powertop1.png" alt="" width="649" height="497" /></p>
<p>&#8230; and as you see the CPU is 98% of the time in C3 (lowest power consumption). And flowing screenshot shows the same computer after starting a KVM virtual maschine and waiting some minutes to settle &#8230;.</p>
<p><img class="aligncenter size-full wp-image-369" title="powertop2" src="http://robert.penz.name/wp-content/uploads/2011/12/powertop2.png" alt="" width="631" height="497" /></p>
<p>&#8230; and now we&#8217;re 20% in C1 and only 75% in C3, and the reason with the highest percentage is qemu-kvm.</p>
<p>Now you ask how I know the power usage increase by 5 Watt? I have have a Watt-meter connected between the power outlet and the computer to measure the power usage.</p>
<p>Anyway, I currently don&#8217;t have a solution for this, maybe a reader has.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/367/idle-slcentos-machine-in-kvm-leads-to-5-watt-more-power-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A1 Telekom Austria uses internal IPs (10.x.x.x) for traffic between UMTS and DSL</title>
		<link>http://robert.penz.name/360/a1-telekom-austria-uses-internal-ips-10-x-x-x-for-traffic-between-umts-and-dsl/</link>
		<comments>http://robert.penz.name/360/a1-telekom-austria-uses-internal-ips-10-x-x-x-for-traffic-between-umts-and-dsl/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 10:13:59 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Austria]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=360</guid>
		<description><![CDATA[When I tried to connect from my mobile phone to my DSL router at home and had tcpdump running on the router at the same time I though there is something wrong. I saw connection requests from an 10.62.35.x IP address from the Internet. My router was of course dropping these packets, as this IP [...]]]></description>
			<content:encoded><![CDATA[<p>When I tried to connect from my mobile phone to my DSL router at home and had tcpdump running on the router at the same time I though there is something wrong. I saw connection requests from an 10.62.35.x IP address from the Internet. My router was of course dropping these packets, as this IP address cannot arrive on the Internet uplink interface.</p>
<p>After some checking I realized that my mobile phone is the 10.62.35.x source address, and I needed to accept packets from on the Internet with the source address within the range of 10.62.0.0/16. It is good that I don&#8217;t use 10.62.0.0/16 subnets at home &#8230;. but if someone does, he has a problem. <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Anyway has anyone more information which 10.x.x.x IP addresses the A1 Telekom Austria (and Bob for my mobile) does use?</p>
<p>ps: The DSL router has a worldwide IP address but the mobile IP is local, surely to force businesses into more expensive plans to have a worldwide IP address. <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/360/a1-telekom-austria-uses-internal-ips-10-x-x-x-for-traffic-between-umts-and-dsl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix the font for virt-manager via X forwarding</title>
		<link>http://robert.penz.name/354/how-to-fix-the-font-for-virt-manager-via-x-forwarding/</link>
		<comments>http://robert.penz.name/354/how-to-fix-the-font-for-virt-manager-via-x-forwarding/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 13:29:22 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=354</guid>
		<description><![CDATA[I&#8217;ve installed the virt-manager on one of my servers (RHEL/Centos/SL) and tried to access the virt-manager via X forwarding but I just got following: Other programs like xclock or xterm worked without problem .. after some searching and debugging I solved the problem with following command: yum install dejavu-lgc-sans-fonts Hope this solution spares someone-other some [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve installed the virt-manager on one of my servers (RHEL/Centos/SL) and tried to access the virt-manager via X forwarding but I just got following:</p>
<p><img class="size-full wp-image-355 aligncenter" title="virt-manager" src="http://robert.penz.name/wp-content/uploads/2011/12/virt-manager.png" alt="" width="698" height="583" /></p>
<p>Other programs like xclock or xterm worked without problem .. after some searching and debugging I solved the problem with following command:<br />
<code><br />
yum install dejavu-lgc-sans-fonts<br />
</code></p>
<p>Hope this solution spares someone-other some minutes. <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/354/how-to-fix-the-font-for-virt-manager-via-x-forwarding/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Teamspeak 3 Client on Kubuntu 11.10 (oneiric)</title>
		<link>http://robert.penz.name/348/teamspeak-3-client-on-kubuntu-11-10/</link>
		<comments>http://robert.penz.name/348/teamspeak-3-client-on-kubuntu-11-10/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 11:44:20 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=348</guid>
		<description><![CDATA[When you download the TeamSpeak3-Client-linux_*.run (tested with TeamSpeak3-Client-linux_amd64-3.0.2.run) file, extract everything and try to start the TS3 client with ./ts3client_runscript.sh on Kubuntu 11.10 you&#8217;ll get following error message: $ ./ts3client_runscript.sh Cannot mix incompatible Qt library (version 0x40704) with this library (version 0x40702) ./ts3client_runscript.sh: line 18: 2638 Aborted ./ts3client_linux_amd64 $@ To fix this you need to [...]]]></description>
			<content:encoded><![CDATA[<p>When you download the TeamSpeak3-Client-linux_*.run (tested with <code>TeamSpeak3-Client-linux_amd64-3.0.2.run</code>) file, extract everything and try to start the TS3 client with <code>./ts3client_runscript.sh</code> on Kubuntu 11.10 you&#8217;ll get following error message:</p>
<p><code><br />
$ ./ts3client_runscript.sh<br />
Cannot mix incompatible Qt library (version 0x40704) with this library (version 0x40702)<br />
./ts3client_runscript.sh: line 18: 2638 Aborted ./ts3client_linux_amd64 $@<br />
</code></p>
<p>To fix this you need to do following (found the hint <a href="http://forum.teamspeak.com/showthread.php/53169-latest-TS3-update-caused-it-to-FAIL/page2" target="_blank">here</a>):</p>
<ul>
<li>Add following<code><br />
export QTDIR="."<br />
export KDEDIRS=""<br />
export KDEDIR=""<br />
</code><br />
at line 5 in <code>ts3client_runscript.sh</code></li>
<li>create a file <code>qt.conf</code> with following content<code><br />
[Paths]<br />
Plugins = plugins<br />
</code></li>
</ul>
<p>Hope this works for you too.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/348/teamspeak-3-client-on-kubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Howto copy files from a damaged hard disk with Linux</title>
		<link>http://robert.penz.name/338/howto-copy-files-from-a-damaged-hard-disk-with-linux/</link>
		<comments>http://robert.penz.name/338/howto-copy-files-from-a-damaged-hard-disk-with-linux/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 17:36:47 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=338</guid>
		<description><![CDATA[I just got a hard disk which had bad blocks to try to rescue files, but which was too big to use dd_rescue to copy the whole partition on any other hard disk I had, before extracting the files. But in this case the file system directory structure was still readable, so I was able [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a hard disk which had bad blocks to try to rescue files, but which was too big to use dd_rescue to copy the whole partition on any other hard disk I had, before extracting the files. But in this case the file system directory structure was still readable, so I was able to use following method, which maybe helps someone else.</p>
<p>I mounted the file system read only with following <code>mount -r /dev/sdb1 /mnt</code> and than I created 2 shell scripts.</p>
<p>First File:<br />
<code><br />
#!/bin/bash<br />
cd /mnt/damagedHD/<br />
mkdir /mnt/dirForExtractedFiles/<br />
find . -type d -exec mkdir /mnt/dirForExtractedFiles/{} \;<br />
find . -type f -exec /path2secondscript/rescue_copy.sh {} \;<br />
</code></p>
<p>Second File:<br />
<code><br />
#!/bin/bash<br />
if [ ! -f "/mnt/dirForExtractedFiles/$1" ]<br />
then<br />
  dd_rescue "$1" "/mnt/dirForExtractedFiles/$1"<br />
fi<br />
</code></p>
<p>I use 2 scripts as sometimes the hard disk runs into a problem and than stops working until it is powered down and up again. In this case I use CRTL-C to break the loop followed by commenting the first 3 commands in the first file out, and than start it again after the harddisk is mounted again. The &#8220;if&#8221;-query in the second file makes sure we won&#8217;t try files which we already have or the one which lead to the error in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/338/howto-copy-files-from-a-damaged-hard-disk-with-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

