On Wed, Dec 23, 2009 at 5:24 PM, Tim Serong <[email protected]> wrote:
> On 12/23/2009 at 12:42 AM, Jiaju Zhang <[email protected]> wrote:
>> On Tue, Dec 22, 2009 at 8:56 PM, Dejan Muhamedagic <[email protected]>
>> wrote:
>> >
>> >> Thank you for stepping forward!
>> >
>> > Jiaju, many thanks for the contribution. Any chance to also
>> > implement the suggested improvements?
>>
>> Sure :)
>> Thanks for all the suggestions. I'll improve it and update it soon.
>
> Another suggestion:
>
> # diff -u IPaddr2 IPaddr2.new
> --- IPaddr2 2009-12-23 20:10:33.089860727 +1100
> +++ IPaddr2.new 2009-12-23 20:17:31.656957776 +1100
> @@ -532,13 +532,14 @@
> }
>
> save_tcp_connections() {
> + [ -z "$OCF_RESKEY_tickle_dir" ] && return
> mydir=$OCF_RESKEY_tickle_dir/`hostname`
> rm -f $mydir/*
> netstat -tn |egrep
> '^tcp[[:space:]]+[0-9]+[[:space:]]+[0-9]+[[:space:]]+[0-9\.]+:[0-9]+.*ESTABLISHED'
> |
> awk '{print $4" "$5}' |
> while read server client; do
> ip=${server%:*}
> - echo $client $server >> $mydir/$ip
> + [ "$ip" == "$OCF_RESKEY_ip" ] && echo $client $server
> >> $mydir/$ip
Yeah, This is an improvement. In fact, I have ever thought of adding
this, but at that time I thought we evetually only care about the
$OCF_RESKEY_ip, so it will also work if we doesn't add the [ "$ip" ==
"$OCF_RESKEY_ip" ] condition, the side effect is just having saved
some useless files.
But I also plan to add this condition, thanks :)
> done
> }
>
>
> My change might not be optimal (not sure what it'd do with IPv6),
> but the idea is:
>
> 1) Do nothing if tickle_dir isn't specified.
I think so too, as the code
+ if [ -n "$OCF_RESKEY_tickle_dir" ]; then
...... ......
+ run_tickle_tcp
+ fi
But forgot to judge the $OCF_RESKEY_tickle_dir when saving the TCP connections
in that patch.
> 2) Only save open connections to $OCF_RESKEY_ip (currently it saves
> open connections to all IPs active on the host)
As stated above :)
>
> Also, I suppose it's kind of obvious, but might be worth mentioning
> in the tickle_dir metadata that the directory needs to be on shared
> storage.
I think the tickle_dir should be in the storage to which the node who
holds the floating IP has the right to access. I'm not sure if we
should call it as "shared" storage.
For example, drbd, Active-Passive mode. Each node access their local
storage, but the local storage has been made a mirrored device.When
the floating IP is on node A, node B has no right to access the
storage as it is in secondary mode. But when the floating IP is
failovered to node B, node B will have the access right and can do the
work.
So I'm only concerned about if drbd can be called shared storage, so
haven't said the "shared".
Thanks,
Jiaju
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/