Skip to content

Commit

Permalink
Update network
Browse files Browse the repository at this point in the history
  • Loading branch information
as51340 committed Nov 26, 2024
1 parent 3e60e2d commit 3e41c2e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 65 deletions.
4 changes: 2 additions & 2 deletions charts/memgraph-high-availability/aws/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ managedNodeGroups:
instanceSelector: {}
instanceType: t3.small
labels:
alpha.eksctl.io/cluster-name: test-cluster-ha
alpha.eksctl.io/cluster-name: mg-ha
alpha.eksctl.io/nodegroup-name: standard-workers
maxSize: 5
minSize: 5
Expand All @@ -58,7 +58,7 @@ managedNodeGroups:
volumeThroughput: 125
volumeType: gp3
metadata:
name: test-cluster-ha
name: mg-ha
region: eu-west-1
version: "1.30"
privateCluster:
Expand Down
18 changes: 12 additions & 6 deletions charts/memgraph-high-availability/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ The cluster setup requires the proper enterprise license to work since HA is an
You can connect to Memgraph instances via Lab, mgconsole, or any other client. By default, all Memgraph instances (coordinators and data instances) listen on port 7687 for a bolt connection.
Make sure your are connecting to the correct ip address and port. For details check the configuration on your cloud provider(aws, gcp, azure, etc.)

If you are using NodePort as the service type for the external access, use node IP and node port to connect. Example using mgconsole:
mgconsole --host=<NODE-IP> --port=<NODE-PORT>
To start, you should add coordinators and register data instances in order to completely setup cluster. In both cases you only need to modify 'bolt_server' part and set it to the DNS
of the node on which instance is being started. Node ports are fixed. Example:

If you are using LoadBalancer as the service type for the external access, use IP of the load balancer and its target port to connect. Example using mgconsole:
mgconsole --host=<LOAD-BALANCER-IP> --port=<TARGET-PORT>
ADD COORDINATOR 2 WITH CONFIG {"bolt_server": "<NODE-2-IP>:32002", "management_server": "memgraph-coordinator-2.default.svc.cluster.local:10000", "coordinator_server": "memgraph-coordinator-2.default.svc.cluster.local:12000"};
ADD COORDINATOR 3 WITH CONFIG {"bolt_server": "<NODE-3-IP>:32003", "management_server": "memgraph-coordinator-3.default.svc.cluster.local:10000", "coordinator_server": "memgraph-coordinator-3.default.svc.cluster.local:12000"};
REGISTER INSTANCE instance_1 WITH CONFIG {"bolt_server": "<NODE-4-IP>:32010", "management_server": "memgraph-data-0.default.svc.cluster.local:10000", "replication_server": "memgraph-data-0.default.svc.cluster.local:20000"};
REGISTER INSTANCE instance_2 WITH CONFIG {"bolt_server": "<NODE-5-IP>:32011", "management_server": "memgraph-data-1.default.svc.cluster.local:10000", "replication_server": "memgraph-data-1.default.svc.cluster.local:20000"};

If you are connecting via Lab, specify your instance IP address and port in Memgraph Lab GUI.
If you are connecting via Lab, specify your coordinator instance IP address and port in Memgraph Lab GUI and select Memgraph HA cluster type of connection.

If you are using minikube, you can find out your instance ip using `minikube ip`.
If you are using minikube, you can find out your node ip using `minikube ip`.

ADD COORDINATOR 3 WITH CONFIG {"bolt_server": "34.251.38.32:32003", "management_server": "memgraph-coordinator-3.default.svc.cluster.local:10000", "coordinator_server": "memgraph-coordinator-3.default.svc.cluster.local:12000"};
REGISTER INSTANCE instance_1 WITH CONFIG {"bolt_server": "52.50.209.155:32010", "management_server": "memgraph-data-0.default.svc.cluster.local:10000", "replication_server": "memgraph-data-0.default.svc.cluster.local:20000"};
REGISTER INSTANCE instance_2 WITH CONFIG {"bolt_server": "34.24.10.69:32011", "management_server": "memgraph-data-1.default.svc.cluster.local:10000", "replication_server": "memgraph-data-1.default.svc.cluster.local:20000"};
51 changes: 0 additions & 51 deletions charts/memgraph-high-availability/templates/cluster-setup.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{{- if $.Values.memgraph.coordLoadBalancer.enabled}}
apiVersion: v1
kind: Service
metadata:
name: external-access
spec:
{{- if eq $.Values.memgraph.externalAccess.serviceType "NodePort"}}
type: NodePort
{{- else }}
type: LoadBalancer
{{- end }}
selector:
instance-type: coordinator
ports:
- protocol: TCP
name: bolt
port: {{ $.Values.memgraph.ports.boltPort }}
targetPort: {{ $.Values.memgraph.ports.boltPort }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,22 @@ spec:
port: {{ $.Values.memgraph.ports.managementPort }}
targetPort: {{ $.Values.memgraph.ports.managementPort }}
{{- end }}

# Service for coordinators instances external
{{- range .Values.coordinators }}
---
apiVersion: v1
kind: Service
metadata:
name: memgraph-coordinator-{{ .id }}-external
spec:
type: NodePort
selector:
app: memgraph-coordinator-{{ .id }}
ports:
- protocol: TCP
name: bolt
port: {{ $.Values.memgraph.ports.boltPort }}
targetPort: {{ $.Values.memgraph.ports.boltPort }}
nodePort: {{ add 32000 .id }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ spec:
name: bolt
port: {{ $.Values.memgraph.ports.boltPort }}
targetPort: {{ $.Values.memgraph.ports.boltPort }}
nodePort: {{ add 32010 .id }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/memgraph-high-availability/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ memgraph:
managementPort: 10000
replicationPort: 20000
coordinatorPort: 12000
externalAccess:
serviceType: "LoadBalancer"
coordLoadBalancer:
enabled: true


data:
Expand Down

0 comments on commit 3e41c2e

Please sign in to comment.