0

Im using freebsd 10 and trying to set up tarantool 1.6. Installed with pkg and created default example instance:

cp /usr/local/etc/tarantool/instances.enabled/example.lua /usr/local/etc/tarantool/instances.enabled/example.lua

Now it starts successfully via rc.d, but it is listening only ipv6:

# ps axu | grep tar
tarantool 32878   0.0  1.2 1086608   9004  -  Is    1:40PM      0:00.05 tarantool example.lua <running> (tarantool)

# sockstat -l | grep tar
tarantool tarantool 32878 10 tcp6   *:3301                *:*
tarantool tarantool 32878 16 stream /var/run/tarantool/example.control

Its a bit strange it listen only ipv6 *:3301. I see no option to set listen ip or protocol in the instance config file:

# grep -i -e listen -e port -e host /usr/local/etc/tarantool/instances.enabled/example.lua
    -- The read/write data port number or URI
    listen = 3301;
--        { uri = [[host1.com:4301]]; zone = [[0]]; };
--        { uri = [[host2.com:4302]]; zone = [[1]]; };

This is what i have in the ifconfig:

# ifconfig 
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
xn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:9b:b0:8b
        inet x.x.x.x. netmask 0xffffff00 broadcast x.x.x.x
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet manual
        status: active

So the question is: how to setup IPv4 listen and how to restrict list of addresses to listen?

Galimov Albert
  • 7,269
  • 1
  • 24
  • 50
  • 1
    Use an URI string with hostname in it, for example, listen="localhost:3301" – Kostja Mar 25 '16 at 14:34
  • @Kostja thanks, it worked. But isnt a bug that it listens only ipv6 if `*` is requested? – Galimov Albert Mar 25 '16 at 14:53
  • If there is more than one interface matching the uri we bind to the first one returned by the resolver. We could bind to all, yes, but nobody asked for this before. – Kostja Mar 25 '16 at 15:16

1 Answers1

1

Use an URI string with hostname in it, for example, listen="localhost:3301". If there is more than one interface matching the uri Tarantool binds to the first one returned by the resolver.

Kostja
  • 1,607
  • 10
  • 17