You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
Copy file name to clipboardexpand all lines: readme.md
+32-30
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,20 @@
1
-
# Tarantool engine for Centrifugo based on Tarantool Cartridge
1
+
# Tarantool Cartridge engine for Centrifugo
2
2
3
-
This is a Lua part of Centrifugo integration with [Tarantool](https://www.tarantool.io/en/) database/platform as a possible Engine option. The integration provides an efficient PUB/SUB, ephemeral publication streams and channel presence functionality. See [additional details](https://centrifugal.dev/docs/server/engines#tarantool-engine) in Centrifugo documentation.
3
+
This is a Lua part of [Centrifugo integration](https://centrifugal.dev/docs/server/engines#tarantool-engine) with [Tarantool](https://www.tarantool.io/en/) as a possible Engine option.
4
+
5
+
The integration provides an efficient PUB/SUB, ephemeral history streams and channel presence functionality.
4
6
5
7
This repo is an engine built with Tarantool Cartridge framework. For other possible Tarantool setups (without Cartridge) refer to the [tarantool-centrifuge](https://github.com/centrifugal/tarantool-centrifuge) repo.
6
8
9
+
## Status
10
+
7
11
At this stage we consider this **experimental**: API and repo structure can still evolve as we get more feedback from the Centrifugo community.
8
12
9
13
## Local setup
10
14
11
15
Prerequisites: Go language and Tarantool should be installed.
12
16
13
-
Also install dependencies:
17
+
Also, install dependencies:
14
18
15
19
```bash
16
20
tarantoolctl rocks install cartridge 2.6.0
@@ -23,43 +27,39 @@ Then run:
23
27
cartridge start
24
28
```
25
29
26
-
## Centrifugo server version
27
-
28
-
These examples require Centrifugo >= 3.0.0
30
+
This will run Cartridge with 2 nodes from `instances.yml`, you can then go to http://localhost:8081 and configure topology.
29
31
30
-
A beta release of Centrifugo v3 available [here](https://github.com/centrifugal/centrifugo/releases/tag/v3.0.0-beta.1)
31
-
32
-
## Topologies
33
-
34
-
This section describes topologies available with Tarantool Cartridge. Use `init.lua` as starting point.
35
-
36
-
### Single node
32
+
Alternatively, you can run single node Tarantool with already configured `centrifuge` role using this command:
37
33
38
34
```bash
39
35
tarantool init.lua --bootstrap true
40
36
```
41
37
42
-
`--bootstrap true` automatically assigns Centrifuge role for node on `127.0.0.1:3301`
43
-
44
-
### Multinode
38
+
`--bootstrap true` automatically assigns `centrifuge` role for node on `127.0.0.1:3301`
45
39
46
-
Create a couple of Tarantool instances managed by Cartridge:
47
-
48
-
First instance on `127.0.0.1:3301`:
40
+
Two manually run several Cartridge nodes run in one terminal:
49
41
50
42
```bash
51
43
tarantool init.lua --advertise-uri 127.0.0.1:3301 --workdir one
52
44
```
53
45
54
-
Second instance on `127.0.0.1:3302`:
46
+
And then in another terminal:
55
47
56
48
```bash
57
49
tarantool init.lua --advertise-uri 127.0.0.1:3302 --http-enabled false --workdir two
58
50
```
59
51
60
-
Now let's look at available Tarantool topologies in Cartridge cluster.
52
+
## Centrifugo server version
53
+
54
+
These examples require Centrifugo >= 3.0.0
55
+
56
+
A beta release of Centrifugo v3 available [here](https://github.com/centrifugal/centrifugo/releases/tag/v3.0.0-beta.1)
57
+
58
+
## Topologies
61
59
62
-
#### High availability
60
+
This section describes topologies available with Tarantool Cartridge.
61
+
62
+
### High availability (leader-follower setup)
63
63
64
64
- Configure topology on web ui http://127.0.0.1:8081
65
65
- Configure on first node
@@ -84,7 +84,7 @@ Then run Centrifugo with config like:
84
84
}
85
85
```
86
86
87
-
####Sharded
87
+
### Sharded (to scale engine)
88
88
89
89
- Configure topology on web ui http://127.0.0.1:8081
90
90
- Configure on first node
@@ -107,7 +107,9 @@ Then run Centrifugo with config like:
107
107
}
108
108
```
109
109
110
-
#### Combined (Sharded + Highly Available)
110
+
Centrifugo will consistently shard data by channel between running Tarantool nodes.
111
+
112
+
### Combined (Sharded + Highly Available)
111
113
112
114
It's possible to combine sharded and high availability setups. For example start 4 Tarantool nodes in Cartridge, create 2 shards, join replicas to each shard. I.e. sth like this:
113
115
@@ -138,7 +140,7 @@ Then run Centrifugo with config like:
0 commit comments