This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use test_run cluster utils to manage shard nodes. Always use replication to maintain redundancy. * Validate shard.init options. Part of #38
- Loading branch information
Showing
87 changed files
with
655 additions
and
2,148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
box.cfg{} | ||
|
||
require('console').listen(os.getenv('ADMIN')) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
../lua/ |
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
#!/usr/bin/env tarantool | ||
shard = require('shard') | ||
os = require('os') | ||
fiber = require('fiber') | ||
util = require('util') | ||
|
||
local cfg = { | ||
servers = { | ||
{ uri = util.instance_uri(0), zone = '0' }, | ||
{ uri = util.instance_uri(1), zone = '0' }, | ||
{ uri = util.instance_uri(2), zone = '0' }, | ||
{ uri = util.instance_uri(3), zone = '1' }, | ||
{ uri = util.instance_uri(4), zone = '1' }, | ||
{ uri = util.instance_uri(5), zone = '1' }, | ||
}, | ||
login = 'tester', | ||
password = 'pass', | ||
monitor = true, | ||
redundancy = 2, | ||
binary = util.instance_port(util.INSTANCE_ID), | ||
} | ||
|
||
require('console').listen(os.getenv('ADMIN')) | ||
|
||
local replication = {} | ||
if util.INSTANCE_ID <= 2 then | ||
replication = { | ||
util.instance_uri(util.INSTANCE_ID), | ||
util.instance_uri(util.INSTANCE_ID + 3) | ||
} | ||
else | ||
replication = { | ||
util.instance_uri(util.INSTANCE_ID - 3), | ||
util.instance_uri(util.INSTANCE_ID) | ||
} | ||
end | ||
|
||
box.cfg { | ||
listen = cfg.binary, | ||
replication = replication, | ||
} | ||
util.create_replica_user(cfg) | ||
|
||
if util.INSTANCE_ID <= 2 then | ||
local demo = box.schema.create_space('demo', {if_not_exists = true}) | ||
demo:create_index('primary', {type = 'tree', parts = {1, 'unsigned'}, if_not_exists = true}) | ||
else | ||
while box.space.demo == nil or box.space.demo.index[0] == nil do | ||
fiber.sleep(0.01) | ||
end | ||
end | ||
|
||
fiber.create(function() shard.init(cfg) end) |
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 |
---|---|---|
@@ -1,44 +1,2 @@ | ||
#!/usr/bin/env tarantool | ||
shard = require('shard') | ||
os = require('os') | ||
fiber = require('fiber') | ||
|
||
local cfg = { | ||
servers = { | ||
{ uri = 'localhost:33130', zone = '0' }; | ||
{ uri = 'localhost:33131', zone = '0' }; | ||
{ uri = 'localhost:33132', zone = '0' }; | ||
{ uri = 'localhost:33133', zone = '1' }; | ||
{ uri = 'localhost:33134', zone = '1' }; | ||
{ uri = 'localhost:33135', zone = '1' }; | ||
}; | ||
login = 'tester'; | ||
password = 'pass'; | ||
monitor = false; | ||
redundancy = 2; | ||
replication = true; | ||
binary = 33131; | ||
} | ||
|
||
box.cfg { | ||
slab_alloc_arena = 0.1; | ||
listen = cfg.binary; | ||
custom_proc_title = "master" | ||
} | ||
|
||
require('console').listen(os.getenv('ADMIN')) | ||
|
||
if not box.space.demo then | ||
box.schema.user.create(cfg.login, { password = cfg.password }) | ||
box.schema.user.grant(cfg.login, 'read,write,execute', 'universe') | ||
box.schema.user.grant('guest', 'read,write,execute', 'universe') | ||
|
||
local demo = box.schema.create_space('demo') | ||
demo:create_index('primary', {type = 'tree', parts = {1, 'num'}}) | ||
end | ||
|
||
-- init shards | ||
fiber.create(function() | ||
shard.init(cfg) | ||
end) | ||
|
||
dofile('master0.lua') |
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 |
---|---|---|
@@ -1,44 +1,2 @@ | ||
#!/usr/bin/env tarantool | ||
shard = require('shard') | ||
os = require('os') | ||
fiber = require('fiber') | ||
|
||
local cfg = { | ||
servers = { | ||
{ uri = 'localhost:33130', zone = '0' }; | ||
{ uri = 'localhost:33131', zone = '0' }; | ||
{ uri = 'localhost:33132', zone = '0' }; | ||
{ uri = 'localhost:33133', zone = '1' }; | ||
{ uri = 'localhost:33134', zone = '1' }; | ||
{ uri = 'localhost:33135', zone = '1' }; | ||
}; | ||
login = 'tester'; | ||
password = 'pass'; | ||
redundancy = 2; | ||
monitor = false; | ||
replication = true; | ||
binary = 33132; | ||
} | ||
|
||
box.cfg { | ||
slab_alloc_arena = 0.1; | ||
listen = cfg.binary; | ||
custom_proc_title = "master" | ||
} | ||
|
||
require('console').listen(os.getenv('ADMIN')) | ||
|
||
if not box.space.demo then | ||
box.schema.user.create(cfg.login, { password = cfg.password }) | ||
box.schema.user.grant(cfg.login, 'read,write,execute', 'universe') | ||
box.schema.user.grant('guest', 'read,write,execute', 'universe') | ||
|
||
local demo = box.schema.create_space('demo') | ||
demo:create_index('primary', {type = 'tree', parts = {1, 'num'}}) | ||
end | ||
|
||
-- init shards | ||
fiber.create(function() | ||
shard.init(cfg) | ||
end) | ||
|
||
dofile('master0.lua') |
Oops, something went wrong.