Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement ability to pass several URIs in different ways #2492

Closed
TarantoolBot opened this issue Dec 13, 2021 · 1 comment · Fixed by #2687
Closed

implement ability to pass several URIs in different ways #2492

TarantoolBot opened this issue Dec 13, 2021 · 1 comment · Fixed by #2687
Assignees
Labels
feature A new functionality server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Dec 13, 2021

Product: Tarantool
Since: 2.10.0
Audience/target: Tarantool users
Root document: TBD sections to update

SME: @ EvgenyMekhanik

Details

Now there are several ways to pass multiple URIs for box.cfg.listen
and box.cfg.replication:

-- As a string with one or several URIs separated by commas
-- (provides backward compatibility):
box.cfg { listen = "127.0.0.1:3301, /unix.sock, 3302" }
-- As an array which contains string URIs (unambiguous short form):
box.cfg { listen = {"127.0.0.1:3301", "/unix.sock", "3302"} }
-- As an array of tables with 'uri' field
-- (may be extended with more fields in future):
box.cfg {  listen = {
        {uri = "127.0.0.1:3301"},
        {uri = "/unix.sock"},
        {uri = 3302}
    }
}

Requested by @EvgenyMekhanik in tarantool/tarantool@4d10e25


While describing the new functional capabilities above, take into account the info from the related doc issue and dev PR


Из обсуждения с @ EvgenyMekhanik :

Указаны только эти варианты (синтаксиса), так они являются рекомендованными к использованию и не будут гарантированно изменяться со временем.

По этой фиче были вопросы у продактов. Эти указанные способы гарантированно сохранятся, и их и нужно (и только их!) указывать пользователям.
Возможно стоит сделать акцент на том, что эти способы рекомендованы.

@patiencedaur patiencedaur added this to the Estimate [@patiencedaur] milestone Dec 15, 2021
@patiencedaur patiencedaur added server [area] Task relates to Tarantool's server (core) functionality feature A new functionality labels Dec 16, 2021
@patiencedaur patiencedaur changed the title implement ability to pass several URIs in different ways [2pt] implement ability to pass several URIs in different ways Dec 16, 2021
@patiencedaur patiencedaur changed the title [2pt] implement ability to pass several URIs in different ways [3pt] implement ability to pass several URIs in different ways Dec 17, 2021
@patiencedaur patiencedaur changed the title [3pt] implement ability to pass several URIs in different ways [2pt] implement ability to pass several URIs in different ways Dec 17, 2021
@patiencedaur patiencedaur removed this from the Estimate [@patiencedaur] milestone Dec 17, 2021
@patiencedaur patiencedaur added 3sp and removed 3sp labels Jan 26, 2022
@veod32 veod32 self-assigned this Feb 2, 2022
@patiencedaur patiencedaur added 1sp and removed 2sp labels Feb 9, 2022
@patiencedaur patiencedaur changed the title [2pt] implement ability to pass several URIs in different ways implement ability to pass several URIs in different ways Feb 9, 2022
@EvgenyMekhanik
Copy link

EvgenyMekhanik commented Feb 10, 2022

There are many ways of passing URI with different parameters (same as in URI library tarantool/tarantool@37c3567):

-- Single URI, passed as before
box.cfg({ listen = "/tmp/unix.sock" })
-- Single URI, with query paramters
box.cfg({ listen = "/tmp/unix.sock?q1=v1&q2=v2" })
-- Several URIs with parameters in one string, separated by commas
box.cfg({ listen = "/tmp/unix.sock_1?q=v, /tmp/unix.sock_2?q=v" })
-- Single URI passed in table, with additional parameters, passed
-- in "params" table. This parameters overwrite parameters from
-- URI string (q1 = "v2" in example below).
box.cfg({ listen = {"/tmp/unix.sock?q1=v1", params = {q1 = "v2"}} })
-- Several URIs passed in table with default parameters, passed
-- in "default_params" table, which are used for parameters, which
-- not specified for URI (q3 parameter with "v3" value corresponds
-- to all URIs, and used if there is no such parameter in URI).
box.cfg({ listen = {
        "/tmp/unix.sock_1?q1=v1",
        { uri = "/tmp/unix.sock_2", params = { q2 = "v2" } },
        default_params = { q3 = "v3" }
    }
}) 

Recommended ways for URIs without parameters:

-- As a string with one or several URIs separated by commas
-- (provides backward compatibility):
box.cfg { listen = "127.0.0.1:3301, /unix.sock, 3302" }
-- As an array which contains string URIs (unambiguous short form):
box.cfg { listen = {"127.0.0.1:3301", "/unix.sock", "3302"} }
-- As an array of tables with 'uri' field
-- (may be extended with more fields in future):
box.cfg {  listen = {
        {uri = "127.0.0.1:3301"},
        {uri = "/unix.sock"},
        {uri = 3302}
    }
}

Recommended ways for URIs with parameters:

box.cfg ({  listen = {
        {uri = "127.0.0.1:3301", params = {q1 = "v1"}},
        {uri = "/unix.sock", params = {q2 = "v2"}},
        {uri = 3302, params = {q3 = "v3"}}
    }
})
-- For single URI with parameter is also ok
box.cfg ({ listen = {
    uri = 'localhost:3301',
    params = {
        transport = "ssl",
        ssl_ca_file = "/path_to_ca_file",
        ssl_cert_file = "/path_to_cert_file",
        ssl_key_file = "/path_to_key_file"
    }
}})

veod32 added a commit that referenced this issue Feb 16, 2022
@veod32 veod32 linked a pull request Feb 16, 2022 that will close this issue
veod32 added a commit that referenced this issue Feb 17, 2022
…cfg.listen and box.cfg.replication description

Part of #2492
veod32 added a commit that referenced this issue Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants