Comments (5)
FLAGS + CONFIG FILE UPDATE -> This is reasonable to me because you are changing one or two flags based on the startup-config.
PASSING NEW CONFIG FILE -> I think this can be achieved like this:
docker create --name memgraph_container -p 7687:7687 memgraph/memgraph --flag-file=/etc/memgraph/my.conf
docker cp my.conf memgraph_container:/etc/memgraph/my.conf
docker start memgraph_container
The key is to first create a container pointing to non-existent file, paste a file and then start.
Obviously, it's not critical, but it's useful for deployment if a company uses a lot of custom flags, and want to version the config files, very relevant for HA and replicaiton due to increased number of flags. .
from documentation.
Please add docker version for env flags: https://github.com/memgraph/documentation/pull/691/files#diff-3d9eed09cb1145f8eca058ea41ee667ced86663f6d04c5a291f19f278cbc7474R367
from documentation.
FLAGS + CONFIG FILE UPDATE
- Started Memgraph with log level and telemetry set
docker run -p 7687:7687 -p 7444:7444 memgraph/memgraph-mage --telemetry-enabled=false --log-level=TRACE
All is applied well (check withSHOW CONFIG
) - Enter the container and install vim
docker ps
(get container id)
docker exec -it <container_id> bash
apt-get update && apt-get install -y vim
- Edit config file
vim /etc/memgraph/memgraph.conf
- Change log level to
DEBUG
and savememgraph.conf
- Restart the container
docker restart <container_id>
- Run
SHOW CONFIG
- log level is set toTRACE
because of the flags left in the docker run command
-> My conclusion: Flags from docker run command overwrite anything defined in the config file. It's easier to set config via flags in Docker.
PASSING NEW CONFIG FILE
When passing file to MEMGRAPH_CONFIG
env var, I am facing similar issues as with init file - new conf file has to be inside the Docker container and Memgraph has to be started with the correctly set MEMGRAPH_CONFIG
env var. Conclusion:
- Create Dockerfile
FROM memgraph/memgraph-mage:latest
COPY ./new.conf /etc/memgraph/new.conf
ENV MEMGRAPH_CONFIG=/etc/memgraph/new.conf
- Build Docker image
docker build -t my-image .
- Run the image
docker run -p 7687:7687 -p 7444:7444 my-image
Another idea was to set env var to future path in advance, c/p new conf to a running Docker container and restart the db. That does not work:
Assertion failed in file at line 38.
Expression: 'fs::exists(path)'
Message: 'MEMGRAPH_CONFIG environment variable set to nonexisting path: /etc/memgraph/new.conf'
NEW CONFIG FILE + FLAGS
Flags override new config file set via env var.
Based on the above, I would recommend Docker users to change config using the flags, if possible. This would be recommended for sensitive information such as username/password, but other than that, it's easier. I can document the above, but best practice is surfacing here somehow.
from documentation.
What you suggested works well and seems like a better approach than with Dockerfile. I like it.
I checked, and it works with MEMGRAPH_CONFIG
env var as well.
from documentation.
FLAGS + CONFIG FILE UPDATE -> This is reasonable to me because you are changing one or two flags based on the startup-config.
PASSING NEW CONFIG FILE -> I think this can be achieved like this:
docker create --name memgraph_container -p 7687:7687 memgraph/memgraph --flag-file=/etc/memgraph/my.conf docker cp my.conf memgraph_container:/etc/memgraph/my.conf docker start memgraph_container
The key is to first create a container pointing to non-existent file, paste a file and then start.
Obviously, it's not critical, but it's useful for deployment if a company uses a lot of custom flags, and want to version the config files, very relevant for HA and replicaiton due to increased number of flags. .
I will then add this as a possibility on config page. On a separate Docker page for deployment, I will recommend setting config with flags as a best practice/easiest approach. Wdyt?
from documentation.
Related Issues (20)
- Replace Memgraph Platform image with Memgraph MAGE image where applicable
- Add Docker installation option for Memgraph Lab HOT 2
- Document an Request limit error
- Usage in node2vec procedures is not correct
- Rhel 8 Installation proces failes because of OpenSSL
- Add a hint that you can use projections on the meta_util query module
- Replica - Physical Resources Clarity HOT 5
- New documentation page about Memgraph Platform migration
- Replication clarity in different storage modes
- Feedback for “Frequently asked questions” HOT 2
- New auto index creation only works in IN_MEMORY_TRANSACTIONAL HOT 2
- Wrong info on replication page
- Feedback for “Release notes” HOT 5
- Add subgraph as an optional argument to MAGE procedures HOT 1
- Update `CASE` syntax with null values (using `is null`)
- BP - Deployment - Phase 2
- Granting privileges query not working HOT 1
- Replication ports are not correct
- Link does not exist anymore
- Update values for vertex
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.