Skip to content

Commit

Permalink
Add getting started with TCM tutorial (#4022)
Browse files Browse the repository at this point in the history
Resolves #4000 

Co-authored-by: Andrey Aksenov <[email protected]>
  • Loading branch information
p7nov and andreyaksenov authored Feb 1, 2024
1 parent 55bdd9a commit f4a3941
Show file tree
Hide file tree
Showing 22 changed files with 459 additions and 0 deletions.
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'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance-001:
instance-002:
instance-003:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config:
etcd:
endpoints:
- http://localhost:2379
prefix: /default
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance-001:
instance-002:
instance-003:
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
Loading

0 comments on commit f4a3941

Please sign in to comment.