Skip to content

3.0 new iproto format #3947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ groups:
instances:
instance001:
iproto:
listen: "3301"
listen:
- uri: '127.0.0.1:3301'
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
iproto:
listen: "3301"
listen:
- uri: '127.0.0.1:3301'

groups:
group001:
replicasets:
replicaset001:
instances:
instance001: {}
instance001: { }
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
groups:
group001:
iproto:
listen: "3301"
listen:
- uri: '127.0.0.1:3301'
replicasets:
replicaset001:
instances:
instance001: {}
instance001: { }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ groups:
instances:
instance001:
iproto:
listen: "3301"
listen:
- uri: '127.0.0.1:3301'
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ groups:
replicasets:
replicaset001:
iproto:
listen: "3301"
listen:
- uri: '127.0.0.1:3301'
instances:
instance001: {}
instance001: { }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ credentials:

iproto:
advertise:
peer: replicator@
peer:
login: replicator

replication:
failover: election
Expand All @@ -18,14 +19,17 @@ groups:
instances:
instance001:
iproto:
listen: 127.0.0.1:3301
listen:
- uri: '127.0.0.1:3301'
instance002:
iproto:
listen: 127.0.0.1:3302
listen:
- uri: '127.0.0.1:3302'
instance003:
iproto:
listen: 127.0.0.1:3303
listen:
- uri: '127.0.0.1:3303'

# Load sample data
app:
file: 'data.lua'
file: 'myapp.lua'
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ credentials:

iproto:
advertise:
peer: replicator@
peer:
login: replicator

replication:
failover: election
Expand All @@ -21,10 +22,13 @@ groups:
instances:
instance001:
iproto:
listen: 127.0.0.1:3301
listen:
- uri: '127.0.0.1:3301'
instance002:
iproto:
listen: 127.0.0.1:3302
listen:
- uri: '127.0.0.1:3302'
instance003:
iproto:
listen: 127.0.0.1:3303
listen:
- uri: '127.0.0.1:3303'
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ credentials:

iproto:
advertise:
peer: replicator@
peer:
login: replicator

replication:
failover: manual
Expand All @@ -19,13 +20,16 @@ groups:
instances:
instance001:
iproto:
listen: 127.0.0.1:3301
listen:
- uri: '127.0.0.1:3301'
instance002:
iproto:
listen: 127.0.0.1:3302
listen:
- uri: '127.0.0.1:3302'
instance003:
iproto:
listen: 127.0.0.1:3303
listen:
- uri: '127.0.0.1:3303'

# Load sample data
app:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ credentials:

iproto:
advertise:
peer: replicator@
peer:
login: replicator

replication:
failover: off
Expand All @@ -20,12 +21,14 @@ groups:
database:
mode: rw
iproto:
listen: 127.0.0.1:3301
listen:
- uri: '127.0.0.1:3301'
instance002:
database:
mode: rw
iproto:
listen: 127.0.0.1:3302
listen:
- uri: '127.0.0.1:3302'

# Load sample data
app:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ groups:
instances:
instance001:
iproto:
listen: 127.0.0.1:3301
listen:
- uri: '127.0.0.1:3301'
instance002:
iproto:
listen: 127.0.0.1:3302
listen:
- uri: '127.0.0.1:3302'
instance003:
iproto:
listen: 127.0.0.1:3303
listen:
- uri: '127.0.0.1:3303'
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ A sample application demonstrating how to configure a [sharded](https://www.tara

To run the cluster, go to the `sharding` directory in the terminal and perform the following steps:

1. Install `vshard`:
1. Install dependencies defined in the `*.rockspec` file:

```console
$ tt rocks install vshard
$ tt build
```

2. Run the cluster:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ credentials:
roles: [replication]
storage:
password: 'secret'
roles: [super]
roles: [sharding]

iproto:
advertise:
peer: replicator@
sharding: storage@
peer:
login: replicator
sharding:
login: storage

sharding:
bucket_count: 1000
Expand All @@ -29,19 +31,23 @@ groups:
instances:
storage-a-001:
iproto:
listen: 127.0.0.1:3301
listen:
- uri: '127.0.0.1:3301'
storage-a-002:
iproto:
listen: 127.0.0.1:3302
listen:
- uri: '127.0.0.1:3302'
storage-b:
leader: storage-b-001
instances:
storage-b-001:
iproto:
listen: 127.0.0.1:3303
listen:
- uri: '127.0.0.1:3303'
storage-b-002:
iproto:
listen: 127.0.0.1:3304
listen:
- uri: '127.0.0.1:3304'
routers:
app:
module: router
Expand All @@ -52,4 +58,5 @@ groups:
instances:
router-a-001:
iproto:
listen: 127.0.0.1:3300
listen:
- uri: '127.0.0.1:3300'
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ credentials:
roles: [replication]
{{.sharding_user_name}}:
password: '{{.sharding_user_password}}'
roles: [super]
roles: [sharding]

iproto:
advertise:
peer: {{.replicator_user_name}}@
sharding: {{.sharding_user_name}}@
peer:
login: {{.replicator_user_name}}
sharding:
login: {{.sharding_user_name}}

sharding:
bucket_count: {{.sharding_bucket_count}}
Expand All @@ -29,19 +31,23 @@ groups:
instances:
storage-a-001:
iproto:
listen: {{.listen_uri}}:3301
listen:
- uri: '{{.listen_uri}}:3301'
storage-a-002:
iproto:
listen: {{.listen_uri}}:3302
listen:
- uri: '{{.listen_uri}}:3302'
storage-b:
leader: storage-b-001
instances:
storage-b-001:
iproto:
listen: {{.listen_uri}}:3303
listen:
- uri: '{{.listen_uri}}:3303'
storage-b-002:
iproto:
listen: {{.listen_uri}}:3304
listen:
- uri: '{{.listen_uri}}:3304'
routers:
app:
module: router
Expand All @@ -52,4 +58,5 @@ groups:
instances:
router-a-001:
iproto:
listen: {{.listen_uri}}:3300
listen:
- uri: '{{.listen_uri}}:3300'
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package = '{{ .name }}'
version = 'scm-1'
source = {
url = '/dev/null',
}

dependencies = {
'vshard == 0.1.25'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I can see, the latest vshard version is 0.1.24. Suppose, tt rocks make will not work with this rockspec until 0.1.25 is out.

Copy link
Contributor Author

@andreyaksenov andreyaksenov Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Totktonada Am I correct that the latest config should work with vshard 0.1.25 only? If the new version will be released at the same time as 3.0.0, keeping the new vshard option in the doc sample should be OK. Otherwise, don't know what decision is the best.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vshard was released today. It was carefully planned :)

}
build = {
type = 'none';
}
Loading