Skip to content

Commit c30b28b

Browse files
Ticket #117 : Add clustering documentation
Ticket #118 : Add docker compose file to publish EventMesh cluster with two peers
1 parent 08a1450 commit c30b28b

38 files changed

+497
-246
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For project documentation, please visit [docs](https://simpleidserver.github.io/
1010

1111
| Command | Description |
1212
| -------------------------- | --------------------------------------- |
13-
| psake publishWebsite | Publish website |
13+
| psake publishWebsite | Publish website |
1414
| psake publishDockerCI | Build and publish docker images |
1515
| psake packTemplate | Build template package |
1616

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# Architecture
1+
# Architecture
2+
3+
**TODO**

docs/documentation/eventmesh/clustering.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To ensure fault tolerance, EventMesh replicates queues across peers using the [R
2828
Data is divided into partitions. Each partition has a number of replicas. Among the replica set, a leader is determined by the raft protocol which takes in requests and performs all of the processing.
2929
All other peers are passive followers. When the leader becomes unavailable, the followers transparently select a new leader.
3030

31-
Eah peer in the cluster my be both leader and follower at the same time of different partitions.
31+
Each peer in the cluster may be both leader and follower at the same time of different partitions.
3232

3333
In EventMesh, the partition key corresponds to the `groupId` or the `topic` name
3434

@@ -42,11 +42,35 @@ An EventMesh cluster can be formed in a number of ways :
4242
* Using etcd-based discovery (via a plugin).
4343
* Using in-memory list on nodes (enabled by default).
4444

45-
In order to have an up and running cluster one plugin must be enabled.
45+
In order to have an up and running cluster one of the plugin above must be enabled.
4646
For more information please refer to the `Plugins` chapter.
4747

4848
# Quick start
4949

5050
In this tutorial, we are going to install two EventMesh servers with the plugin `DiscoveryEtcd` enabled via Docker.
5151

52-
TODO
52+
Download the docker compose file
53+
54+
```
55+
https://raw.githubusercontent.com/simpleidserver/FaasNet/master/src/Samples/FaasNet.EventMesh.EtcdCluster/docker-compose.yml
56+
```
57+
58+
Open a command prompt and execute the following command
59+
60+
```
61+
docker-compose up
62+
```
63+
64+
Two peers will be deployed and are listening the ports `4000` and `4001`.
65+
66+
Always in a command prompt, add a new VPN
67+
68+
```
69+
FaasNet.EventMeshCTL.CLI.exe add_vpn --name=vpn --port=4001
70+
```
71+
72+
Check if the VPN is correctly replicated in the second node by executing the following command
73+
74+
```
75+
FaasNet.EventMeshCTL.CLI.exe get_all_vpn --port=4002
76+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Installing on Docker
2+
3+
This guide describes how EventMesh peer node can be installed on Docker.
4+
5+
## Deploy a windows service
6+
7+
> [!IMPORTANT]
8+
> Docker must be installed on your machine.
9+
10+
Open a command prompt and execute the following command line. An EventMesh peer node will be deployed and listening the port 4000.
11+
12+
```
13+
docker run --name eventmesh -p 4000:4000/udp eventmesh
14+
```

docs/documentation/eventmesh/installserveronwindows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Installing on Windows Manually
22

3-
This guide describes how EventMesh server can be installed and configured manually on Windows.
3+
This guide describes how EventMesh peer node can be installed and configured manually on Windows.
44

55
## Download zip
66

docs/documentation/eventmesh/pluginamqp.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ The ZIP file can be downloaded [here]().
2020
| maxFrameSize | Largest frame size that the sending peer is able to accept on this connection. | 1000 |
2121
| maxChannel | The channel-max value is the highest channel number that can be used on the connection | 1000 |
2222
| sessionLinkCredit | Current maximum number of messages that can be handled at the receiver endpoint of the link | 255 |
23-
| eventMeshVpn | EventMesh server VPN | default |
24-
| eventMeshUrl | EventMesh server URL | localhost |
25-
| eventMeshPort | EventMesh server Port | 4000 |
23+
| eventMeshVpn | EventMesh peer VPN | default |
24+
| eventMeshUrl | EventMesh peer URL | localhost |
25+
| eventMeshPort | EventMesh peer Port | 4000 |
2626

2727
## Quick start
2828

29-
Once you have an up and running EventMesh server with `ProtocolAmqp` plugin enabled, you can start using any client compliant with the [AMQP 1.0 protocol](http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf).
29+
Once you have an up and running EventMesh peer with `ProtocolAmqp` plugin installed, you can start using any client compliant with the [AMQP 1.0 protocol](http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf).
3030

3131
### Configure client and VPN
3232

@@ -59,9 +59,9 @@ If the plugin is not yet configured, it can be enabled like this
5959
FaasNet.EventMeshCTL.CLI.exe enable_plugin --name=ProtocolAmqp
6060
```
6161

62-
Its configuration can be updated either by [using CLI](cli.md) or by updating the configuration file `appsettings.json`.
62+
Its configuration can be updated either by [using CLI](cli.md) or by updating the configuration file `plugin.json`.
6363

64-
Don't forget that the EventMesh server must be restarted, otherwise the changes are not taken into account.
64+
Don't forget that the EventMesh peer must be restarted, otherwise the changes are not taken into account.
6565

6666
When the configuration is finished, a client can be created and can start publishing message.
6767

docs/documentation/eventmesh/pluginsinkamqp.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,67 +22,63 @@ The ZIP file can be downloaded [here]().
2222
| amqpTopicName | Name of the topic exchange | amq.topic |
2323
| amqpUserName | AMQP username | guest |
2424
| amqpPassword | AMQP password | guest |
25-
| eventMeshUrl | EventMesh server URL | localhost |
26-
| eventMeshPort | EventMesh server Port | 4000 |
27-
| eventMeshVpn | EventMesh server VPN | default |
25+
| eventMeshUrl | EventMesh peer URL | localhost |
26+
| eventMeshPort | EventMesh peer Port | 4000 |
27+
| eventMeshVpn | EventMesh peer VPN | default |
2828
| clientId | Client identifier used to publish message | publishClientId |
2929

3030
## Quick start
3131

32-
Once the plugin `SinkAMQP` is configured and enabled, you can deploy an AMQP 1.0 server such as RabbitMQ.
32+
Once you have an up and running EventMesh peer with `SinkAMQP` plugin installed, you can deploy an AMQP 1.0 server such as RabbitMQ.
3333

34-
In this tutorial we will explain how to deploy a local RabbitMQ server with the plugin `rabbitmq_amqp1_0` enabled via Kubernetes.
34+
In this tutorial we will explain how to deploy a local RabbitMQ server with the plugin `rabbitmq_amqp1_0` enabled via Docker.
3535

36-
### Deploy RabbitMQ via Kubernetes
36+
### Configure client and VPN
3737

38-
Open a command prompt and install the RabbitMQ Cluster Kubernetes Operator
38+
Before going further, a Virtual Private Network (VPN) and one client must be configured.
39+
Those information will be used to publish message.
3940

40-
```
41-
kubectl apply -f "https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml"
42-
```
43-
44-
Deploy RabbitMQ
41+
Open a command prompt and create a topic named `default` :
4542

4643
```
47-
kubectl apply -f "https://raw.githubusercontent.com/simpleidserver/FaasNet/master/src/Samples/FaasNet.EventMesh.AmqpSink/rabbitmq.yml"
44+
FaasNet.EventMeshCTL.CLI.exe add_vpn --name=default
4845
```
4946

50-
When the RabbitMQ server is running, fetch the default credentials username/password from the Kubernetes secrets.
51-
Both values are encoded in base64 and must be decoded.
47+
Add a client `publishClientId`, as the name suggests, it will be used to publish message.
5248

5349
```
54-
kubectl get secret hello-world-default-user -o jsonpath='{.data.user}'
55-
kubectl get secret hello-world-default-user -o jsonpath='{.data.password}'
50+
FaasNet.EventMeshCTL.CLI.exe add_client --vpn=default --identifier=publishClientId --publish_enabled=true --subscription_enabled=false
5651
```
5752

58-
### Update plugin configuration
53+
### Deploy RabbitMQ via Docker
5954

60-
Always in a command prompt, use the CLI to update the username and password with the values obtained from the previous step.
55+
Download the Docker file
6156

6257
```
63-
FaasNet.EventMeshCTL.CLI.exe update_plugin_configuration --name=SinkAMQP --key=amqpUserName --value=<USERNAME>
64-
FaasNet.EventMeshCTL.CLI.exe update_plugin_configuration --name=SinkAMQP --key=amqpPassword --value=<PASSWORD>
58+
https://raw.githubusercontent.com/simpleidserver/FaasNet/master/Samples/FaasNet.EventMesh.AmqpSink/AmqpServerDockerFile
6559
```
6660

67-
Use the AMQP port `30007`.
61+
Open a command prompt and build the docker image
6862

6963
```
70-
FaasNet.EventMeshCTL.CLI.exe update_plugin_configuration --name=SinkAMQP --key=amqpPort --value=30007
64+
docker build -t amqpserver -f AmqpServerDockerFile .
7165
```
7266

73-
And use the client identifier `publishClient`.
67+
Run RabbitMQ peer with the plugin `rabbitmq_amqp1_0` enabled.
7468

7569
```
76-
FaasNet.EventMeshCTL.CLI.exe update_plugin_configuration --name=SinkAMQP --key=clientId --value=publishClient
70+
docker run --name rabbitmq -p 5672:5672 -p 15672:15672 amqpserver
7771
```
7872

7973
### Enable the plugin
8074

81-
Enable the plugin and restart the EventMesh server to take into account your changes.
75+
Enable the plugin and restart the EventMesh peer to take into account your changes.
76+
77+
By default, the configuration is correct and there is no need to update it.
8278

8379
```
8480
FaasNet.EventMeshCTL.CLI.exe enable_plugin --name=SinkAMQP
8581
```
8682

87-
Now the EventMesh server is running, it should be able to capture all the events coming from the exchange name `amq.topic`.
88-
You can publish some messages in RabbitMQ and check if they are captured by the EventMesh server.
83+
Now the EventMesh peer is running, it should be able to capture all the events coming from the exchange name `amq.topic`.
84+
You can publish some messages in RabbitMQ and check if they are captured by the EventMesh peer.

docs/documentation/eventmesh/pluginsinkkafka.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,55 @@ The ZIP file can be downloaded [here]().
2121
| kafkaGroupId | Client group identifier | EventMeshKafka |
2222
| kafkaMetadataTimeout | Timeout in MS to fetch metadata from Kafka | 2 seconds |
2323
| kafkaTopicTimerMS | Timer in MS used to fetch kafka topics | 5 seconds |
24-
| eventMeshUrl | EventMesh server URL | localhost |
25-
| eventMeshPort | EventMesh server Port | 4000 |
26-
| eventMeshVpn | EventMesh server VPN | default |
24+
| eventMeshUrl | EventMesh peer URL | localhost |
25+
| eventMeshPort | EventMesh peer Port | 4000 |
26+
| eventMeshVpn | EventMesh peer VPN | default |
2727
| clientId | Client identifier used to publish message | publishClientId |
2828

2929
## Quick start
3030

31-
Once the plugin `SinkKafka` is configured and enabled, you can deploy an Apache Kafka server.
31+
Once you have an up and running EventMesh peer with `SinkKafka` plugin installed, you can deploy an Apache Kafka server.
3232

3333
In this tutorial we will explain how to deploy Apache Kafka by using Docker.
3434

35-
### Deploy Apache Kafka via Docker
35+
### Configure client and VPN
3636

37-
Download the file
37+
Before going further, a Virtual Private Network (VPN) and one client must be configured.
38+
Those information will be used to publish message.
39+
40+
Open a command prompt and create a topic named `default` :
3841

3942
```
40-
https://raw.githubusercontent.com/simpleidserver/FaasNet/master/Samples/FaasNet.EventMesh.KafkaSink/docker-compose.yml
43+
FaasNet.EventMeshCTL.CLI.exe add_vpn --name=default
4144
```
4245

43-
Open a command prompt and execute the command below to deploy Apache Kafka
46+
Add a client `publishClientId`, as the name suggests, it will be used to publish message.
4447

4548
```
46-
docker-compose up
49+
FaasNet.EventMeshCTL.CLI.exe add_client --vpn=default --identifier=publishClientId --publish_enabled=true --subscription_enabled=false
4750
```
4851

49-
### Update plugin configuration
52+
### Deploy Apache Kafka via Docker
5053

51-
Use the client identifier `publishClient`.
54+
Download the file
5255

5356
```
54-
FaasNet.EventMeshCTL.CLI.exe update_plugin_configuration --name=SinkKafka --key=clientId --value=publishClient
57+
https://raw.githubusercontent.com/simpleidserver/FaasNet/master/Samples/FaasNet.EventMesh.KafkaSink/docker-compose.yml
58+
```
59+
60+
Open a command prompt and execute the command below to deploy Apache Kafka
61+
62+
```
63+
docker-compose up
5564
```
5665

5766
### Enable the plugin
5867

59-
Enable the plugin and restart the EventMesh server to take into account your changes.
68+
Enable the plugin and restart the EventMesh peer to take into account your changes.
6069

6170
```
6271
FaasNet.EventMeshCTL.CLI.exe enable_plugin --name=SinkKafka
6372
```
6473

65-
Now the EventMesh server is running, it should be able to capture all the events coming from Apache Kafka.
66-
You can publish some messages in Apache Kafka and check if they are captured by the EventMesh server.
74+
Now the EventMesh peer is running, it should be able to capture all the events coming from Apache Kafka.
75+
You can publish some messages in Apache Kafka and check if they are captured by the EventMesh peer.

docs/documentation/eventmesh/pluginsinkvpnbridge.md

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,88 @@ The ZIP file can be downloaded [here]().
1919
| jobId | Job identifier | VpnBridge |
2020
| bridgeTimerMS | Timer in MS to get bridge servers | 5 seconds |
2121
| bridgeGroupId | Group identifier used to subscribe to a topic | VpnBridgeGroupId |
22-
| eventMeshUrl | EventMesh server URL | localhost |
23-
| eventMeshPort | EventMesh server Port | 4000 |
24-
| eventMeshVpn | EventMesh server VPN | default |
22+
| eventMeshUrl | EventMesh peer URL | localhost |
23+
| eventMeshPort | EventMesh peer Port | 4000 |
24+
| eventMeshVpn | EventMesh peer VPN | default |
2525
| clientId | Client identifier used to publish message | publishClientId |
2626

27-
TODO
27+
## Quick start
28+
29+
To establish a link between two VPN, we are going to use Docker to deploy two EventMesh cluster.
30+
31+
Download the Docker compose file
32+
33+
```
34+
https://raw.githubusercontent.com/simpleidserver/FaasNet/master/src/Samples/FaasNet.EventMesh.TwoCluster/docker-compose.yml
35+
```
36+
37+
Open a command prompt and execute the following command
38+
39+
```
40+
docker-compose up
41+
```
42+
43+
Two EventMesh clusters will be deployed and will listen the ports `4001` and `4002`.
44+
45+
### Configure the client, VPN and the bridge
46+
47+
Add a new VPN `default` in both cluster.
48+
49+
```
50+
FaasNet.EventMeshCTL.CLI.exe add_vpn --name=default --port=4001
51+
FaasNet.EventMeshCTL.CLI.exe add_vpn --name=default --port=4002
52+
```
53+
54+
Add a client `publishClient` in the cluster `4002`. It will be used by the CLI to publish message
55+
56+
```
57+
FaasNet.EventMeshCTL.CLI.exe add_client --vpn=default --identifier=publishClient --publish_enabled=true --subscription_enabled=false --port=4002
58+
```
59+
60+
Add a client `subscribeClient` in the cluster `4002`. It will be used by the cluster `4001` to receive message.
61+
62+
```
63+
FaasNet.EventMeshCTL.CLI.exe add_client --vpn=default --identifier=subscribeClient --publish_enabled=false --subscription_enabled=true --port=4002
64+
```
65+
66+
Add a client `publishClientId` in the cluster `4001`. It will be used by the SinkVpnBridge to publish message.
67+
68+
```
69+
FaasNet.EventMeshCTL.CLI.exe add_client --vpn=default --identifier=publishClientId --publish_enabled=true --subscription_enabled=false --port=4001
70+
```
71+
72+
73+
Add a client `subscribeClient` in the cluster `4001`. It will be used by the CLI to receive message.
74+
75+
```
76+
FaasNet.EventMeshCTL.CLI.exe add_client --vpn=default --identifier=subscribeClient --publish_enabled=false --subscription_enabled=true --port=4001
77+
```
78+
79+
Add a bridge between both VPN
80+
81+
```
82+
FaasNet.EventMeshCTL.CLI.exe add_vpn_bridge --vpn=default --tvpn=default --turn=evtmeshnode2 --tport=4000 --tid=subscribeClient --port=4001
83+
```
84+
85+
### Configure and enable the plugin
86+
87+
Enable the plugin and restart the EventMesh cluster to take into account your changes.
88+
89+
```
90+
FaasNet.EventMeshCTL.CLI.exe enable_plugin --name=SinkVpnBridge --port=4001
91+
```
92+
93+
Now both EventMesh cluster are running, the cluster `4001` should be able to capture all the events coming from the cluster `4002`.
94+
95+
Publish a message TODO
96+
97+
```
98+
FaasNet.EventMeshCTL.CLI.exe publish_message --vpn=default --identifier=publishClient --topic=topic --message=hello --port=4002
99+
```
100+
101+
102+
Read the message TODO
103+
104+
```
105+
FaasNet.EventMeshCTL.CLI.exe read_message --vpn=default --identifier=subscribeClient --topic=topic --port=4001
106+
```

0 commit comments

Comments
 (0)