From 9d307a1c6a47a255f204f656f0443f62a66fdc0a Mon Sep 17 00:00:00 2001 From: Andi Skrgat Date: Wed, 17 Jul 2024 12:12:21 +0200 Subject: [PATCH] Add nuraft log, persist logs, remove NodePort Service for coordinator mgmt server --- .../templates/cluster-setup.yaml | 4 +-- .../templates/coordinators.yaml | 3 +- .../templates/services-coordinators.yaml | 4 --- charts/memgraph-high-availability/values.yaml | 28 ++++++++++++------- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/charts/memgraph-high-availability/templates/cluster-setup.yaml b/charts/memgraph-high-availability/templates/cluster-setup.yaml index 66855ff..e533b61 100644 --- a/charts/memgraph-high-availability/templates/cluster-setup.yaml +++ b/charts/memgraph-high-availability/templates/cluster-setup.yaml @@ -28,8 +28,8 @@ spec: # Run the mgconsole commands echo "Running mgconsole commands..." - echo 'ADD COORDINATOR 2 WITH CONFIG {"bolt_server": "memgraph-coordinator-2.default.svc.cluster.local:7687", "management_server": "memgraph-coordinator-2.default.svc.cluster.local:30000", "coordinator_server": "memgraph-coordinator-2.default.svc.cluster.local:12000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 - echo 'ADD COORDINATOR 3 WITH CONFIG {"bolt_server": "memgraph-coordinator-3.default.svc.cluster.local:7687", "management_server": "memgraph-coordinator-3.default.svc.cluster.local:30000", "coordinator_server": "memgraph-coordinator-3.default.svc.cluster.local:12000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 + echo 'ADD COORDINATOR 2 WITH CONFIG {"bolt_server": "memgraph-coordinator-2.default.svc.cluster.local:7687", "management_server": "memgraph-coordinator-2.default.svc.cluster.local:10000", "coordinator_server": "memgraph-coordinator-2.default.svc.cluster.local:12000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 + echo 'ADD COORDINATOR 3 WITH CONFIG {"bolt_server": "memgraph-coordinator-3.default.svc.cluster.local:7687", "management_server": "memgraph-coordinator-3.default.svc.cluster.local:10000", "coordinator_server": "memgraph-coordinator-3.default.svc.cluster.local:12000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 echo 'REGISTER INSTANCE instance_1 WITH CONFIG {"bolt_server": "memgraph-data-0.default.svc.cluster.local:7687", "management_server": "memgraph-data-0.default.svc.cluster.local:10000", "replication_server": "memgraph-data-0.default.svc.cluster.local:20000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 echo 'REGISTER INSTANCE instance_2 WITH CONFIG {"bolt_server": "memgraph-data-1.default.svc.cluster.local:7687", "management_server": "memgraph-data-1.default.svc.cluster.local:10000", "replication_server": "memgraph-data-1.default.svc.cluster.local:20000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 echo 'SET INSTANCE instance_1 TO MAIN;' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 diff --git a/charts/memgraph-high-availability/templates/coordinators.yaml b/charts/memgraph-high-availability/templates/coordinators.yaml index 1e14405..fe43910 100644 --- a/charts/memgraph-high-availability/templates/coordinators.yaml +++ b/charts/memgraph-high-availability/templates/coordinators.yaml @@ -100,6 +100,7 @@ spec: requests: storage: {{ $.Values.memgraph.coordinators.volumeClaim.storagePVCSize }} {{- end }} + {{- if $.Values.memgraph.coordinators.volumeClaim.logPVC }} - metadata: name: memgraph-coordinator-{{ $coordinator.id }}-log-storage @@ -111,7 +112,7 @@ spec: {{- end }} resources: requests: - storage: {{ $.Values.memgraph.coordinators.volumeClaim.storagePVC.logPVCSize }} + storage: {{ $.Values.memgraph.coordinators.volumeClaim.logPVCSize }} {{- end }} --- {{- end }} diff --git a/charts/memgraph-high-availability/templates/services-coordinators.yaml b/charts/memgraph-high-availability/templates/services-coordinators.yaml index c30af16..f8a4153 100644 --- a/charts/memgraph-high-availability/templates/services-coordinators.yaml +++ b/charts/memgraph-high-availability/templates/services-coordinators.yaml @@ -40,8 +40,4 @@ spec: name: bolt port: {{ .boltPort }} targetPort: {{ .boltPort }} - - protocol: TCP - name: management - port: {{ .managementPort }} - targetPort: {{ .managementPort }} {{- end }} diff --git a/charts/memgraph-high-availability/values.yaml b/charts/memgraph-high-availability/values.yaml index 8680f74..d882fbc 100644 --- a/charts/memgraph-high-availability/values.yaml +++ b/charts/memgraph-high-availability/values.yaml @@ -26,7 +26,7 @@ memgraph: storagePVC: true storagePVCSize: "1Gi" logPVCClassName: "" - logPVC: false + logPVC: true logPVCSize: "256Mi" coordinators: volumeClaim: @@ -34,7 +34,7 @@ memgraph: storagePVC: true storagePVCSize: "1Gi" logPVCClassName: "" - logPVC: false + logPVC: true logPVCSize: "256Mi" @@ -49,7 +49,7 @@ data: - "--bolt-port=7687" - "--also-log-to-stderr" - "--log-level=TRACE" - - "--replication-restore-state-on-startup=true" + - "--log-file=/var/log/memgraph/memgraph.log" - id: "1" boltPort: 7687 @@ -61,45 +61,53 @@ data: - "--bolt-port=7687" - "--also-log-to-stderr" - "--log-level=TRACE" - - "--replication-restore-state-on-startup=true" + - "--log-file=/var/log/memgraph/memgraph.log" coordinators: - id: "1" boltPort: 7687 - managementPort: 30000 + managementPort: 10000 coordinatorPort: 12000 args: - "--experimental-enabled=high-availability" - "--coordinator-id=1" - "--coordinator-port=12000" - - "--management-port=30000" + - "--management-port=10000" - "--bolt-port=7687" - "--also-log-to-stderr" - "--log-level=TRACE" - "--coordinator-hostname=memgraph-coordinator-1.default.svc.cluster.local" + - "--log-file=/var/log/memgraph/memgraph.log" + - "--nuraft-log-file=/var/log/memgraph/memgraph.log" + - id: "2" boltPort: 7687 - managementPort: 30000 + managementPort: 10000 coordinatorPort: 12000 args: - "--experimental-enabled=high-availability" - "--coordinator-id=2" - "--coordinator-port=12000" - - "--management-port=30000" + - "--management-port=10000" - "--bolt-port=7687" - "--also-log-to-stderr" - "--log-level=TRACE" - "--coordinator-hostname=memgraph-coordinator-2.default.svc.cluster.local" + - "--log-file=/var/log/memgraph/memgraph.log" + - "--nuraft-log-file=/var/log/memgraph/memgraph.log" + - id: "3" boltPort: 7687 - managementPort: 30000 + managementPort: 10000 coordinatorPort: 12000 args: - "--experimental-enabled=high-availability" - "--coordinator-id=3" - "--coordinator-port=12000" - - "--management-port=30000" + - "--management-port=10000" - "--bolt-port=7687" - "--also-log-to-stderr" - "--log-level=TRACE" - "--coordinator-hostname=memgraph-coordinator-3.default.svc.cluster.local" + - "--log-file=/var/log/memgraph/memgraph.log" + - "--nuraft-log-file=/var/log/memgraph/memgraph.log"