cybertec-postgresql / vip-manager

Manages a virtual IP based on state kept in etcd or Consul
BSD 2-Clause "Simplified" License
207 stars 41 forks source link

bind ipv6 failed #231

Closed zhongyibill closed 3 months ago

zhongyibill commented 5 months ago

mytest machine ip config is :

[root@qmjnode1 log]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 0c:da:41:1d:38:26 brd ff:ff:ff:ff:ff:ff
    inet6 1200::174:12/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::eda:41ff:fe1d:3826/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

log information:

May 24 11:21:32 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:32 Using config from file: /etc/default/vip-manager.yml
May 24 11:21:32 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:32 This is the config that will be used:
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011config : /etc/default/vip-manager.yml
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011consul-token : *****
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011dcs-endpoints : [http://[::1]:8500]
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011dcs-type : consul
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011hosting-type : basic
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011hostingtype : basic
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011interface : enp1s0
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011interval : 1000
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011ip : 1200::174c:101
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011manager-type : basic
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011netmask : 64
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011retry-after : 250
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011retry-num : 2
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011trigger-key : /pg/test001/leader
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011trigger-value : test001-1
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011verbose : false
May 24 11:21:32 qmjnode1 vip-manager[72381]: #011version : false
May 24 11:21:32 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:32 IP address 1200::174c:101/64 state is false, desired false
May 24 11:21:32 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:32 IP address 1200::174c:101/64 state is false, desired true
May 24 11:21:32 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:32 Problems with producing the arp client: no IPv4 address available for interface
May 24 11:21:33 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:33 Problems with producing the arp client: no IPv4 address available for interface
May 24 11:21:33 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:33 too many retries
May 24 11:21:33 qmjnode1 vip-manager[72381]: 2024/05/24 11:21:33 Couldn't create an Arp client: no IPv4 address available for interface

I find vip-manager user ARP proctol,but arp not support ipv6. for example:

func (c *BasicConfigurer) createArpClient() error {
    var err error
    var arpClient *arp.Client
    for i := 0; i < c.RetryNum; i++ {
        arpClient, err = arp.Dial(&c.Iface)
        if err != nil {
            log.Printf("Problems with producing the arp client: %s", err)
        } else {
            break
        }
        time.Sleep(time.Duration(c.RetryAfter) * time.Millisecond)
    }
    if err != nil {
        log.Print("too many retries")
        return err
    }
    c.arpClient = arpClient
    return nil
}
pashagolub commented 5 months ago

But it was your pull request with IPv6 support. Why didn't you test it thoroughly?

github-actions[bot] commented 3 months ago

📅 This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. ♻️ If you think there is new information allowing us to address the issue, please reopen it and provide us with updated details. 🤝 Thank you for your contributions.