Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 7df1b8d

Browse files
committed
fix bootstrap, better readme
1 parent 4c32950 commit 7df1b8d

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ __pycache__
2020
node_modules
2121
/tmp/*
2222
!/tmp/.keep
23+
*.cookie

init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if opts.bootstrap then
5959
log.info("Bootstrapping in %s", workdir)
6060
require("membership.options").ACK_TIMEOUT_SECONDS = 0.5
6161
local all = {
62-
["app"] = true
62+
["centrifuge"] = true
6363
}
6464

6565
local _, err =

readme.md

+32-30
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
# Tarantool engine for Centrifugo based on Tarantool Cartridge
1+
# Tarantool Cartridge engine for Centrifugo
22

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.
46

57
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.
68

9+
## Status
10+
711
At this stage we consider this **experimental**: API and repo structure can still evolve as we get more feedback from the Centrifugo community.
812

913
## Local setup
1014

1115
Prerequisites: Go language and Tarantool should be installed.
1216

13-
Also install dependencies:
17+
Also, install dependencies:
1418

1519
``` bash
1620
tarantoolctl rocks install cartridge 2.6.0
@@ -23,43 +27,39 @@ Then run:
2327
cartridge start
2428
```
2529

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.
2931

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:
3733

3834
``` bash
3935
tarantool init.lua --bootstrap true
4036
```
4137

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`
4539

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:
4941

5042
```bash
5143
tarantool init.lua --advertise-uri 127.0.0.1:3301 --workdir one
5244
```
5345

54-
Second instance on `127.0.0.1:3302`:
46+
And then in another terminal:
5547

5648
```bash
5749
tarantool init.lua --advertise-uri 127.0.0.1:3302 --http-enabled false --workdir two
5850
```
5951

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
6159

62-
#### High availability
60+
This section describes topologies available with Tarantool Cartridge.
61+
62+
### High availability (leader-follower setup)
6363

6464
- Configure topology on web ui http://127.0.0.1:8081
6565
- Configure on first node
@@ -84,7 +84,7 @@ Then run Centrifugo with config like:
8484
}
8585
```
8686

87-
#### Sharded
87+
### Sharded (to scale engine)
8888

8989
- Configure topology on web ui http://127.0.0.1:8081
9090
- Configure on first node
@@ -107,7 +107,9 @@ Then run Centrifugo with config like:
107107
}
108108
```
109109

110-
#### Combined (Sharded + Highly Available)
110+
Centrifugo will consistently shard data by channel between running Tarantool nodes.
111+
112+
### Combined (Sharded + Highly Available)
111113

112114
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:
113115

@@ -138,7 +140,7 @@ Then run Centrifugo with config like:
138140
}
139141
```
140142

141-
# Tests
143+
## Tests
142144

143145
``` bash
144146
tarantoolctl rocks install luatest
@@ -150,17 +152,17 @@ tarantoolctl rocks install luatest
150152
.rocks/bin/luatest
151153
```
152154

153-
# Deploy
155+
## Deploy
154156

155157
See [releases](https://github.com/centrifugal/tarantool-engine-cartridge/releases) for assets.
156158

157-
## Install
159+
### Install
158160

159161
```
160162
sudo yum install centrifuge-tarantool-engine-$RELEASE.rpm
161163
```
162164

163-
## Configuring
165+
### Configuring
164166

165167
- `/etc/tarantool/conf.d/centrifuge-tarantool-engine.yml`
166168
```
@@ -173,7 +175,7 @@ sudo yum install centrifuge-tarantool-engine-$RELEASE.rpm
173175
advertise_uri: 127.0.0.1:3302
174176
```
175177

176-
## Start
178+
### Start
177179

178180
```
179181
sudo systemctl start centrifuge-tarantool-engine@x
@@ -186,7 +188,7 @@ sudo systemctl start centrifuge-tarantool-engine@y
186188
- Goto web admin
187189
- Configure topology you want
188190

189-
## Manual packing
191+
### Manual packing
190192

191193
```
192194
sudo yum install tarantool tarantool-devel cartridge-cli

0 commit comments

Comments
 (0)