Skip to content
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

Persistent storage using the default settings doesn't survive 'docker compose down' #34

Open
dreadedhamish opened this issue Jul 16, 2023 · 4 comments
Assignees
Labels

Comments

@dreadedhamish
Copy link

I was trying to track down why my stream ID's were changing.

The provided docker compose files attempt persistent storage by using volumes (top level), and mounting graylog files within.
The volumes however are not persistent and are remade after a docker compose down and up.

@kroepke
Copy link
Member

kroepke commented Jul 17, 2023

Does this mean the entire database is re-created every time?

@dreadedhamish
Copy link
Author

Does this mean the entire database is re-created every time?

I'll have to double-check the database entries. Interestingly when I do a docker compose down && up I'm seeing the inputs preserved, but the node_id isn't preserved, so all my inputs that had a local node set are all disabled until I specifiy a new node. I seem to remember from playing with Postgres that even though it's dockerised it's still using the host filesystem for storage - perhaps mariadb does the same, making it immune to container deletion?

@netr0m
Copy link

netr0m commented Jul 18, 2023

The data is persisted by default (with the volume mount defined in the mongodb service), but the node-id is not (by default).

In the docker-compose.yml, the environment variable GRAYLOG_NODE_ID_FILE specifies the filepath for the node-id to be /usr/share/graylog/data/config/node-id, which is not mounted as a volume from the host. As such, any time the Graylog container is recreated, the node-id will be regenerated.

Simply add

services:
  graylog:
    [...]
    volumes:
      # Persist the graylog config
      - "graylog_cfg:/usr/share/graylog/data/config"

volumes:
  [...]
  # Define the volume
  graylog_cfg:

to ensure that the node-id is consistent across restarts.

@hertell
Copy link

hertell commented Oct 29, 2023

It looks to me that this is the same issue as this:
#27
Default Volumes in docker-compose.yml looks like this

volumes:
  - "graylog_data:/usr/share/graylog/data/data"
  - "graylog_journal:/usr/share/graylog/data/journal"

graylog_data should point to /usr/share/graylog/data. Also graylog_journal should point to an own path, eg. /usr/share/graylog/journal, and in graylog.conf

message_journal_dir=journal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants