-
Notifications
You must be signed in to change notification settings - Fork 20
Add session storage clustering support #3555
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
acfd175
replaced dual session DB impl to go-cache impl
woutslakhorst 877531b
added memcached impl
woutslakhorst 39aa9aa
link memcached
woutslakhorst 9272fa0
add e2e test with redis sentinel clustered session memory
woutslakhorst 93aa329
added e2e-tests
woutslakhorst 57d1f62
reuse oauth2.js
woutslakhorst e9f3eaa
remove unused files
woutslakhorst 5a3013a
reduce added lines by removing comments from redis conf files
woutslakhorst ae2e0c6
add documentation on clustering
woutslakhorst 1126341
some godoc
woutslakhorst bb6abcd
deduplicate configs
woutslakhorst 2aa24c0
deduplicate configs
woutslakhorst 5e7844d
add session DB to health check
woutslakhorst 0d38af5
added comment on default memcached behaviour
woutslakhorst 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 hidden or 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 hidden or 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 hidden or 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,21 @@ | ||
| .. _clustering: | ||
|
|
||
| Clustering | ||
| ########## | ||
|
|
||
| Clustering is currently limited to nodes that have the ``did:nuts`` method disabled. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe state what NOT to do (use default on-disk/in-memory stores for private keys and stuff)? |
||
| To enable clustering, you must support the following: | ||
|
|
||
| - A clustered SQL database (SQLite is not supported) | ||
| - A clustered session storage (Redis sentinel is recommended) | ||
| - A clustered private key storage (Hashicorp Vault or Azure Keyvault) | ||
| - Read only mounts for configuration, policy, discovery and JSON-LD context files. | ||
|
|
||
| It's recommended to use a level 4 load balancer to distribute the load across the nodes. | ||
| Each node should have a reverse proxy for TLS termination. | ||
|
|
||
| Clustering will not work if you use one of the following: | ||
|
|
||
| - The did:nuts method | ||
| - SQLite | ||
| - Disk based private key storage | ||
This file contains hidden or 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 hidden or 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 hidden or 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,65 @@ | ||
| services: | ||
| memcached: | ||
| image: memcached | ||
| command: | ||
| - --conn-limit=1024 | ||
| - --memory-limit=64 | ||
| - --threads=4 | ||
| nodeA-backend: | ||
| image: "${IMAGE_NODE_A:-nutsfoundation/nuts-node:master}" | ||
| ports: | ||
| - "18081:8081" | ||
| environment: | ||
| NUTS_CONFIGFILE: /opt/nuts/nuts.yaml | ||
| NUTS_URL: "https://nodeA" | ||
| NUTS_DISCOVERY_SERVER_IDS: "e2e-test" | ||
| NUTS_STORAGE_SESSION_MEMCACHED_ADDRESS: "memcached:11211" | ||
| volumes: | ||
| - "../shared/nuts.yaml:/opt/nuts/nuts.yaml:ro" | ||
| - "../../tls-certs/nodeA-backend-certificate.pem:/opt/nuts/certificate-and-key.pem:ro" | ||
| - "../../tls-certs/truststore.pem:/opt/nuts/truststore.pem:ro" | ||
| # did:web resolver uses the OS CA bundle, but e2e tests use a self-signed CA which can be found in truststore.pem | ||
| # So we need to mount that file to the OS CA bundle location, otherwise did:web resolving will fail due to untrusted certs. | ||
| - "../../tls-certs/truststore.pem:/etc/ssl/certs/Nuts_RootCA.pem:ro" | ||
| - "../shared/presentationexchangemapping.json:/opt/nuts/policies/presentationexchangemapping.json:ro" | ||
| - "../shared/discovery:/nuts/discovery:ro" | ||
| healthcheck: | ||
| interval: 1s # Make test run quicker by checking health status more often | ||
| nodeA: | ||
| image: nginx:1.25.1 | ||
| ports: | ||
| - "10443:443" | ||
| volumes: | ||
| - "../shared/node-A/nginx.conf:/etc/nginx/nginx.conf:ro" | ||
| - "../../tls-certs/nodeA-certificate.pem:/etc/nginx/ssl/server.pem:ro" | ||
| - "../../tls-certs/nodeA-certificate.pem:/etc/nginx/ssl/key.pem:ro" | ||
| - "../../tls-certs/truststore.pem:/etc/nginx/ssl/truststore.pem:ro" | ||
| - "../../scripts/oauth2.js:/etc/nginx/oauth2.js:ro" | ||
| nodeB-backend: | ||
| image: "${IMAGE_NODE_B:-nutsfoundation/nuts-node:master}" | ||
| ports: | ||
| - "28081:8081" | ||
| environment: | ||
| NUTS_CONFIGFILE: /opt/nuts/nuts.yaml | ||
| NUTS_URL: "https://nodeB" | ||
| volumes: | ||
| - "../shared/nuts.yaml:/opt/nuts/nuts.yaml:ro" | ||
| - "../../tls-certs/nodeB-certificate.pem:/opt/nuts/certificate-and-key.pem:ro" | ||
| - "../../tls-certs/truststore.pem:/opt/nuts/truststore.pem:ro" | ||
| - "../../tls-certs/truststore.pem:/etc/ssl/certs/truststore.pem:ro" | ||
| # did:web resolver uses the OS CA bundle, but e2e tests use a self-signed CA which can be found in truststore.pem | ||
| # So we need to mount that file to the OS CA bundle location, otherwise did:web resolving will fail due to untrusted certs. | ||
| - "../../tls-certs/truststore.pem:/etc/ssl/certs/Nuts_RootCA.pem:ro" | ||
| - "../shared/presentationexchangemapping.json:/opt/nuts/policies/presentationexchangemapping.json:ro" | ||
| - "../shared/discovery:/nuts/discovery:ro" | ||
| healthcheck: | ||
| interval: 1s # Make test run quicker by checking health status more often | ||
| nodeB: | ||
| image: nginx:1.25.1 | ||
| ports: | ||
| - "20443:443" | ||
| volumes: | ||
| - "../../shared_config/nodeB-http-nginx.conf:/etc/nginx/conf.d/nuts-http.conf:ro" | ||
| - "../../tls-certs/nodeB-certificate.pem:/etc/nginx/ssl/server.pem:ro" | ||
| - "../../tls-certs/nodeB-certificate.pem:/etc/nginx/ssl/key.pem:ro" | ||
| - "../../tls-certs/truststore.pem:/etc/nginx/ssl/truststore.pem:ro" |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.