-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker-compose example #31
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ADD COORDINATOR 2 WITH CONFIG {"bolt_server": "coord2:7691", "coordinator_server": "coord2:10112"}; | ||
ADD COORDINATOR 3 WITH CONFIG {"bolt_server": "coord3:7692", "coordinator_server": "coord3:10113"}; | ||
|
||
REGISTER INSTANCE instance_1 WITH CONFIG {"bolt_server": "instance1:7687", "management_server": "instance1:10011", "replication_server": "instance1:10001"}; | ||
REGISTER INSTANCE instance_2 WITH CONFIG {"bolt_server": "instance2:7688", "management_server": "instance2:10012", "replication_server": "instance2:10002"}; | ||
REGISTER INSTANCE instance_3 WITH CONFIG {"bolt_server": "instance3:7689", "management_server": "instance3:10013", "replication_server": "instance3:10003"}; | ||
SET INSTANCE instance_3 TO MAIN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Instructions | ||
|
||
This directory contains all necessary code needed to run your own highly-available Memgraph cluster with one command, `docker compose up`. | ||
The only thing you need to do is add your `ORGANIZATION NAME` and `ENTERPRISE LICENSE` in license.cypher file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
networks: | ||
antejavor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
memgraph_ha: | ||
name: memgraph_ha | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: "172.21.0.0/16" | ||
|
||
services: | ||
coord1: | ||
image: "memgraph/memgraph" | ||
container_name: coord1 | ||
volumes: | ||
- ./license.cypher:/tmp/init/license.cypher:ro | ||
- ./HA_register.cypher:/tmp/init/HA_register.cypher:ro | ||
environment: | ||
- MEMGRAPH_HA_CLUSTER_INIT_QUERIES=/tmp/init/HA_register.cypher | ||
command: [ "--init-file=/tmp/init/license.cypher", "--log-level=TRACE", "--data-directory=/tmp/mg_data_coord1", "--log-file=/tmp/coord1.log", "--also-log-to-stderr", "--coordinator-id=1", "--coordinator-port=10111", "--coordinator-hostname=coord1", "--experimental-enabled=high-availability"] | ||
networks: | ||
memgraph_ha: | ||
ipv4_address: 172.21.0.4 | ||
|
||
coord2: | ||
image: "memgraph/memgraph" | ||
container_name: coord2 | ||
volumes: | ||
- ./license.cypher:/tmp/init/license.cypher:ro | ||
command: [ "--init-file=/tmp/init/license.cypher", "--log-level=TRACE", "--data-directory=/tmp/mg_data_coord2", "--log-file=/tmp/coord2.log", "--also-log-to-stderr", "--coordinator-id=2", "--coordinator-port=10112", "--coordinator-hostname=coord2", "--experimental-enabled=high-availability"] | ||
networks: | ||
memgraph_ha: | ||
ipv4_address: 172.21.0.2 | ||
|
||
coord3: | ||
image: "memgraph/memgraph" | ||
container_name: coord3 | ||
volumes: | ||
- ./license.cypher:/tmp/init/license.cypher:ro | ||
command: [ "--init-file=/tmp/init/license.cypher", "--log-level=TRACE", "--data-directory=/tmp/mg_data_coord3", "--log-file=/tmp/coord3.log", "--also-log-to-stderr", "--coordinator-id=3", "--coordinator-port=10113", "--coordinator-hostname=coord3", "--experimental-enabled=high-availability"] | ||
|
||
networks: | ||
memgraph_ha: | ||
ipv4_address: 172.21.0.3 | ||
|
||
instance1: | ||
image: "memgraph/memgraph" | ||
container_name: instance1 | ||
volumes: | ||
- ./license.cypher:/tmp/init/license.cypher:ro | ||
command: ["--init-file=/tmp/init/license.cypher","--data-recovery-on-startup=true", "--log-level=TRACE", "--data-directory=/tmp/mg_data_instance1", "--log-file=/tmp/instance1.log", "--also-log-to-stderr", "--management-port=10011", "--experimental-enabled=high-availability"] | ||
networks: | ||
memgraph_ha: | ||
ipv4_address: 172.21.0.6 | ||
|
||
instance2: | ||
image: "memgraph/memgraph" | ||
container_name: instance2 | ||
volumes: | ||
- ./license.cypher:/tmp/init/license.cypher:ro | ||
command: ["--init-file=/tmp/init/license.cypher","--data-recovery-on-startup=true", "--log-level=TRACE", "--data-directory=/tmp/mg_data_instance2", "--log-file=/tmp/instance2.log", "--also-log-to-stderr", "--management-port=10012", "--experimental-enabled=high-availability"] | ||
networks: | ||
memgraph_ha: | ||
ipv4_address: 172.21.0.7 | ||
|
||
instance3: | ||
image: "memgraph/memgraph" | ||
container_name: instance3 | ||
volumes: | ||
- ./license.cypher:/tmp/init/license.cypher:ro | ||
command: ["--init-file=/tmp/init/license.cypher","--data-recovery-on-startup=true", "--log-level=TRACE", "--data-directory=/tmp/mg_data_instance3", "--log-file=/tmp/instance3.log", "--also-log-to-stderr", "--management-port=10013", "--experimental-enabled=high-availability"] | ||
networks: | ||
memgraph_ha: | ||
ipv4_address: 172.21.0.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SET DATABASE SETTING 'organization.name' TO '<YOUR_ORGANIZATION_NAME>'; | ||
SET DATABASE SETTING 'enterprise.license' TO '<YOUR_ENTERPRISE_LICENSE>'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just elaborate on why this exists in this repository? "To test locally HA..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not? I think users should now that they must change license info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, we have a misunderstanding 😄; I was referring to elaborate in
README.md
why the docker-compose exists and what is the idea behind it, not why the README.md exists.