-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replicaset: vshard bootstrap for cluster config
@TarantoolBot document Title: `tt replicaset vshard bootstrap` - bootstraps vshard in the cluster This patch introduces new subcommand for the replicaset module. `tt replicaset vshard` - manages vshard in the cluster. `tt replicaset vshard bootstrap [--cartridge|--config] [flags] (<APP_NAME> | <APP_NAME:INSTANCE_NAME> | <URI>)` * Bootstraps vshard in the replicaset. * Cartridge: by fact, it is the clone of `cartridge-cli replicasets bootstrap-vshard`. * Centralized config (3.0): lookups for the router in the cluster and calls `vshard.router.bootstrap()` on it. Part of #316
- Loading branch information
Showing
10 changed files
with
371 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
local ok, vshard = pcall(require, 'vshard') | ||
if not ok then | ||
error("failed to require vshard module") | ||
end | ||
|
||
local config = require('config') | ||
local is_router = false | ||
for _, role in ipairs(config:get().sharding.roles) do | ||
if role == "router" then | ||
is_router = true | ||
break | ||
end | ||
end | ||
|
||
if not is_router then | ||
error("instance must be a router to bootstrap vshard") | ||
end | ||
|
||
local ok, err = vshard.router.bootstrap() | ||
assert(ok, tostring(err)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.