Skip to content

Commit c8553ee

Browse files
committed
Add description of ability to pass several URIs in configuration parameter and the new syntax for that
Part of #2492
1 parent d133741 commit c8553ee

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

doc/reference/configuration/index.rst

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ Some configuration parameters and some functions depend on a URI, or
7575
So it may contain (in order) a user name
7676
for login, a password, a host name or host IP address, and a port number. Only
7777
the port number is always mandatory. The password is mandatory if the user
78-
name is specified, unless the user name is 'guest'. So, formally, the URI
78+
name is specified, unless the user name is 'guest'.
79+
80+
Formally, the URI
7981
syntax is ``[host:]port`` or ``[username:password@]host:port``.
8082
If host is omitted, then '0.0.0.0' or '[::]' is assumed,
8183
meaning respectively any IPv4 address or any IPv6 address,
8284
on the local machine.
83-
If username:password is omitted, then 'guest' is assumed. Some examples:
85+
If ``username:password`` is omitted, then 'guest' is assumed. Some examples:
8486

8587
.. container:: table
8688

@@ -97,10 +99,39 @@ If username:password is omitted, then 'guest' is assumed. Some examples:
9799
| username:password@host:port | notguest:[email protected]:3301 |
98100
+-----------------------------+------------------------------+
99101

100-
In certain circumstances a Unix domain socket may be used
101-
where a URI is expected, for example "unix/:/tmp/unix_domain_socket.sock" or
102+
In certain circumstances, a Unix domain socket may be used
103+
where a URI is expected, for example, "unix/:/tmp/unix_domain_socket.sock" or
102104
simply "/tmp/unix_domain_socket.sock".
103105

106+
Starting from version 2.10.0, a user can open several listening iproto sockets on a Tarantool instance
107+
and, consequently, can specify several URIs in the configuration parameters such as :ref:`box.cfg.listen <cfg_basic-listen>` and :ref:`box.cfg.replication <cfg_replication-replication>`.
108+
109+
In addition to specifying URI as a number or a string, a number of other ways to pass URI values is available starting from Tarantool 2.10.0:
110+
111+
* As a string with one or several URIs separated by commas (provides backward compatibility)
112+
113+
code-block:: lua
114+
115+
box.cfg { listen = "127.0.0.1:3301, /unix.sock, 3302" }
116+
117+
* As an array that contains URIs in a string format
118+
119+
code-block:: lua
120+
121+
box.cfg { listen = {"127.0.0.1:3301", "/unix.sock", "3302"} }
122+
123+
* As an array of tables with the ``uri`` field
124+
125+
code-block:: lua
126+
127+
box.cfg { listen = {
128+
{uri = "127.0.0.1:3301"},
129+
{uri = "/unix.sock"},
130+
{uri = 3302}
131+
}
132+
}
133+
134+
104135
A method for parsing URIs is illustrated in :ref:`Module uri <uri-parse>`.
105136

106137
.. _index-init_label:

0 commit comments

Comments
 (0)