1

I am configuring a pgpool instance to get a HA of postgresql services. I am following this configuration.

I found a command and I ran it manually in my console:

arping_cmd = 'arping -U $_IP_$ -w 1'

But it doesn't work, then I want to find a similar behaviour because I am on ubuntu 12.04. How can I do that ?

The $_IP_$ variable is replaced by the ip value in the configuration. The main problem is the arping command.

1
  • Welcome to askubuntu. Why do you think it didn't work? did you get an error of some kind? by using -U you are guaranteeing you won't get a response. (source man arping)
    – Elder Geek
    Sep 30, 2014 at 15:52

3 Answers 3

1

When running the arping command in the terminal, I get the following output:

$ arping -U 192.168.13.1 -w -1
arping: device (option -I) is required.
Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination
  -f : quit on first reply
  -q : be quiet
  -b : keep broadcasting, don't go unicast
  -D : duplicate address detection mode
  -U : Unsolicited ARP mode, update your neighbours
  -A : ARP answer mode, update your neighbours
  -V : print version and exit
  -c count : how many packets to send
  -w timeout : how long to wait for a reply
  -I device : which ethernet device to use
  -s source : source ip address
  destination : ask for what ip address

The solution is in the first line after running the command. Use -I and -s to fix your problem. -I specifies the interface to do the arping on and -s is to specify the source your are doing the arping from. It's crappy, I know, but update your command to look like the below:

arping_cmd = 'arping -U $_IP_$ -w 1 -I ethX -s SOURCE_IP'

where ethx is your ethernet and SOURCE_IP is the IP you are going to do the arping from.

Hope this helps, Cheers

1

I had a similar problem on Fedora:

$ arping 192.168.1.162
arping: Suitable device could not be determined. Please, use option -I.
...

My solution was:

$ arping $ip_addr -I $(ip route get $ip_addr |  cut -d\  -f 3 |xargs)

Where ip_addr would contain the IP to be pinged.

To brake it down:

ip route get 192.168.1.162

would return the route and interface used by kernel for the specified ip:

192.168.1.162 dev eth1  src 192.168.1.1

then use:

cut -d\  -f 3

to split the string by delimiter '\ ' (escaped space) and return 3-th substring:

eth1

then use xargs to remove all whitespaces around interface.

Hope it will be helpfull.

0

I get the same error as the submitter, saying that "-U" is not a valid option:

root@pgpool-2:/var/log# arping -U 192.168.13.1 -w -1
arping: invalid option -- 'U'
ARPing 2.11, by Thomas Habets <thomas@habets.se>
usage: arping [ -0aAbdDeFpqrRuv ] [ -w <us> ] [ -S <host/ip> ]
              [ -T <host/ip ] [ -s <MAC> ] [ -t <MAC> ] [ -c <count> ]
              [ -i <interface> ] <host/ip/MAC | -B>
For complete usage info, use --help or check the manpage.

I'm on Ubuntu 14.04 and there is no mention of "-U" in the manpage:

root@pgpool-2:/var/log# man arping | grep '\-U'
root@pgpool-2:/var/log#

I changed mine to this:

arping_cmd = 'arping -v $_IP_$ -w 1 -c 100'

So basically:

  • -U doesn't exist, so remove it
  • Add -v to get verbose output, which may be helpful
  • Add -c 100 so that it eventually finishes... otherwise it runs forever

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.