-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add getting started with TCM tutorial (#4022)
Resolves #4000 Co-authored-by: Andrey Aksenov <[email protected]>
- Loading branch information
1 parent
55bdd9a
commit f4a3941
Showing
22 changed files
with
459 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
doc/code_snippets/snippets/config/instances.enabled/tcm_get_started_config/config.yaml
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,30 @@ | ||
credentials: | ||
users: | ||
guest: | ||
roles: [super] | ||
groups: | ||
group-001: | ||
replicasets: | ||
replicaset-001: | ||
replication: | ||
failover: manual | ||
leader: instance-001 | ||
instances: | ||
instance-001: | ||
iproto: | ||
listen: | ||
- uri: '127.0.0.1:3301' | ||
advertise: | ||
client: '127.0.0.1:3301' | ||
instance-002: | ||
iproto: | ||
listen: | ||
- uri: '127.0.0.1:3302' | ||
advertise: | ||
client: '127.0.0.1:3302' | ||
instance-003: | ||
iproto: | ||
listen: | ||
- uri: '127.0.0.1:3303' | ||
advertise: | ||
client: '127.0.0.1:3303' |
3 changes: 3 additions & 0 deletions
3
doc/code_snippets/snippets/config/instances.enabled/tcm_get_started_config/instances.yml
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 @@ | ||
instance-001: | ||
instance-002: | ||
instance-003: |
5 changes: 5 additions & 0 deletions
5
doc/code_snippets/snippets/config/instances.enabled/tcm_get_started_tt/config.yaml
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,5 @@ | ||
config: | ||
etcd: | ||
endpoints: | ||
- http://localhost:2379 | ||
prefix: /default |
3 changes: 3 additions & 0 deletions
3
doc/code_snippets/snippets/config/instances.enabled/tcm_get_started_tt/instances.yml
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 @@ | ||
instance-001: | ||
instance-002: | ||
instance-003: |
20 changes: 20 additions & 0 deletions
20
doc/code_snippets/snippets/config/instances.enabled/tcm_get_started_tt/myapp.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function create_space() | ||
box.schema.space.create('bands') | ||
box.space.bands:format({ | ||
{ name = 'id', type = 'unsigned' }, | ||
{ name = 'band_name', type = 'string' }, | ||
{ name = 'year', type = 'unsigned' } | ||
}) | ||
box.space.bands:create_index('primary', { type = "tree", parts = { 'id' } }) | ||
box.schema.user.grant('guest', 'read,write,execute', 'universe') | ||
end | ||
|
||
function load_data() | ||
box.space.bands:insert { 1, 'Roxette', 1986 } | ||
box.space.bands:insert { 2, 'Scorpions', 1965 } | ||
box.space.bands:insert { 3, 'Ace of Base', 1987 } | ||
end | ||
|
||
function select_data() | ||
box.space.bands:select { 3 } | ||
end |
Oops, something went wrong.