-
-
Save rodde177/c6e9168efc0c2f77976ddf4d0ec67b28 to your computer and use it in GitHub Desktop.
Setting up mongod using podman
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
1. Create podman container using the docker mongo image: docker.io/library/mongo:latest | |
`sudo podman run -d --name mongod -p 27017:27017 -v /var/lib/mongodb:/data/db:Z mongo` | |
2. Create service file `/etc/systemd/system/mongod.service` to run container: | |
``` | |
[Unit] | |
Description=MongoDB Podman container | |
After=network.target firewalld.service | |
Wants=network.target | |
[Service] | |
Restart=always | |
ExecStart=/usr/bin/podman start -a mongod | |
ExecStop=/usr/bin/podman stop -t 10 mongod | |
[Install] | |
WantedBy=multi-user.target | |
``` | |
3. start container: | |
``` | |
systemctl start mongod.service | |
systemctl enable mongod.service | |
``` | |
4. Restore data to database: | |
`podman run -it --rm -v $HOME/Downloads/sra:/tmp/sra:Z --network=host mongo mongorestore -d sra -c ncbi --gzip /tmp/sra/ncbi.bson.gz` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment