Managing Endpoints

The ArangoDB server can listen for incoming requests on multiple endpoints.

The endpoints are normally specified either in ArangoDB’s configuration file oron the command-line, using the —server.endpoint. ArangoDB supports differenttypes of endpoints:

  • tcp://ipv4-address:port - TCP/IP endpoint, using IPv4
  • tcp://[ipv6-address]:port - TCP/IP endpoint, using IPv6
  • ssl://ipv4-address:port - TCP/IP endpoint, using IPv4, SSL encryption
  • ssl://[ipv6-address]:port - TCP/IP endpoint, using IPv6, SSL encryption
  • unix:///path/to/socket - Unix domain socket endpointIf a TCP/IP endpoint is specified without a port number, then the default port(8529) will be used. If multiple endpoints need to be used, the option can berepeated multiple times.

The default endpoint for ArangoDB is tcp://127.0.0.1:8529 ortcp://localhost:8529.

EXAMPLES

  1. unix> ./arangod --server.endpoint tcp://127.0.0.1:8529
  2. --server.endpoint ssl://127.0.0.1:8530
  3. --ssl.keyfile server.pem /tmp/vocbase
  4. 2012-07-26T07:07:47Z [8161] INFO using SSL protocol version 'TLSv1'
  5. 2012-07-26T07:07:48Z [8161] INFO using endpoint 'ssl://127.0.0.1:8530' for http ssl requests
  6. 2012-07-26T07:07:48Z [8161] INFO using endpoint 'tcp://127.0.0.1:8529' for http tcp requests
  7. 2012-07-26T07:07:49Z [8161] INFO ArangoDB (version 1.1.alpha) is ready for business
  8. 2012-07-26T07:07:49Z [8161] INFO Have Fun!

TCP Endpoints

Given a hostname:

—server.endpoint tcp://hostname:port

Given an IPv4 address:

—server.endpoint tcp://ipv4-address:port

Given an IPv6 address:

—server.endpoint tcp://[ipv6-address]:port

On one specific ethernet interface each port can only be bound exactlyonce. You can look up your available interfaces using the ifconfig commandon Linux / MacOSX - the Windows equivalent is ipconfig (See Wikipedia formore details). The general names of theinterfaces differ on OS’s and hardwares they run on. However, typically everyhost has a so calledloopback interface,which is a virtual interface. By convention it always has the address127.0.0.1 or ::1 (ipv6), and can only be reached from exactly the very samehost. Ethernet interfaces usually have names like eth0, wlan0, eth1:17,le0 or a plain text name in Windows.

To find out which services already use ports (so ArangoDB can’t bind themanymore), you can use thenetstat command(it behaves a little different on each platform, run it with -lnpt on Linux,-p tcp on MacOSX or with -an on windows for valuable information).

ArangoDB can also do a so called broadcast bind usingtcp://0.0.0.0:8529. This way it will be reachable on all interfaces of thehost. This may be useful on development systems that frequently change theirnetwork setup like laptops.

ArangoDB can also listen to IPv6 link-local addresses via adding the zone IDto the IPv6 address in the form [ipv6-link-local-address%zone-id]. However,what you probably instead want is to bind to a local IPv6 address. Local IPv6addresses start with fd. If you only see a fe80: IPv6 address in yourinterface configuration but no IPv6 address starting with fd your interfacehas no local IPv6 address assigned. You can read more about IPv6 link-localaddresses here.

Example

Bind to a link-local and local IPv6 address.

  1. unix> ifconfig

This command lists all interfaces and assigned ip addresses. The link-localaddress may be fe80::6257:18ff:fe82:3ec6%eth0 (IPv6 address plus interface name).A local IPv6 address may be fd12:3456::789a. To bind ArangoDB to it startarangod with —server.endpoint tcp://[fe80::6257:18ff:fe82:3ec6%eth0]:8529.Use telnet to test the connection.

  1. unix> telnet fe80::6257:18ff:fe82:3ec6%eth0 8529
  2. Trying fe80::6257:18ff:fe82:3ec6...
  3. Connected to my-machine.
  4. Escape character is '^]'.
  5. GET / HTTP/1.1
  6. HTTP/1.1 301 Moved Permanently
  7. Location: /_db/_system/_admin/aardvark/index.html
  8. Content-Type: text/html
  9. Server: ArangoDB
  10. Connection: Keep-Alive
  11. Content-Length: 197
  12. <html><head><title>Moved</title></head><body><h1>Moved</h1><p>This page has moved to <a href="/_db/_system/_admin/aardvark/index.html">/_db/_system/_admin/aardvark/index.html</a>.</p></body></html>

Reuse address

—tcp.reuse-address

If this boolean option is set to true then the socket option SOREUSEADDR isset on all server endpoints, which is the default. If this option is set to_false it is possible that it takes up to a minute after a server hasterminated until it is possible for a new server to use the same endpointagain. This is why this is activated by default.

Please note however that under some operating systems this can be a securityrisk because it might be possible for another process to bind to the sameaddress and port, possibly hijacking network traffic. Under Windows, ArangoDBadditionally sets the flag SO_EXCLUSIVEADDRUSE as a measure to alleviate thisproblem.

Backlog size

—tcp.backlog-size

Allows to specify the size of the backlog for the listen system call Thedefault value is 10. The maximum value is platform-dependent. Specifying ahigher value than defined in the system header’s SOMAXCONN may result in awarning on server start. The actual value used by listen may also be silentlytruncated on some platforms (this happens inside the listen system call).