Skip to content

Add an alternative CLI example for setting up Cartridge topology #2618

@akudiyar

Description

@akudiyar
Contributor

Only one way of configuring Cartridge topology is described in the tutorials at the moment -- via UI (see https://www.tarantool.io/en/doc/2.5/getting_started/getting_started_cartridge/ and all examples in the https://github.com/tarantool/examples contain the same).

An alternative way of applying topology configuration must be present, via Cartridge API (with the corresponding links to the documentation). Currently, there are no snippets of doing the bootstrap from CLI anywhere.

Example of a snippet which may be added to the getting started page:

$ tarantoolctl connect 'admin:testdb-cluster-cookie@localhost:3301'
connected to localhost:3301
localhost:3301> cartridge = require'cartridge'                                                                                                                                                                                                                                                                                                                                      ---
...

localhost:3301> replicasets = {                                                                                                                                                                                                                                                                                                                                                                   > {
              >     alias = 'app-router',
              >     roles = {'vshard-router'},
              >     join_servers = {{uri = 'localhost:3301'}},
              > },
              > {
              >     alias = 's1-storage',
              >     roles = {'vshard-storage', 'metrics'},
              >     join_servers = {{uri = 'localhost:3302'},{uri = 'localhost:3303'}},
              > },
              > {
              >     alias = 's2-storage',
              >     roles = {'vshard-storage', 'metrics'},
              >     join_servers = {{uri = 'localhost:3304'},{uri = 'localhost:3305'}},
              > }}
---
...

localhost:3301> cartridge.admin_edit_topology({replicasets = replicasets})
---
- error: Peer closed
...

Here the user will have to connect again and do the following:

$ tarantoolctl connect 'admin:testdb-cluster-cookie@localhost:3301'
connected to localhost:3301
localhost:3301> cartridge = require'cartridge'                                                                                                                                                                                                                                                                                                                                      ---
...

localhost:3301> cartridge.admin_bootstrap_vshard()
---
- true
...

Also, it would be very nice to explain what the user sees in the logs after executing these commands.

Activity

changed the title [-]Add an alternative CLI example for setting up Cartridge topology[/-] [+][2pt] Add an alternative CLI example for setting up Cartridge topology[/+] on Aug 26, 2020
Kasen

Kasen commented on Apr 9, 2021

@Kasen

I suggest adding examples about each thing this function does. Such as the example of how to bootstrap cluster from scratch, how to add a server to a replicaset, etc.

changed the title [-][2pt] Add an alternative CLI example for setting up Cartridge topology[/-] [+]Add an alternative CLI example for setting up Cartridge topology[/+] on Apr 30, 2021
added
cartridge[project] Commit to Tarantool Cartridge
exampleProblem with a code example.
tutorial[area] Related to Tutorials
on Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cartridge[project] Commit to Tarantool CartridgeexampleProblem with a code example.tutorial[area] Related to Tutorials

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Kasen@akudiyar@patiencedaur

        Issue actions

          Add an alternative CLI example for setting up Cartridge topology · Issue #2618 · tarantool/doc