Diferencia entre revisiones de «Instalación Mongodb»
Ir a la navegación
Ir a la búsqueda
Línea 7: | Línea 7: | ||
==== Debian 11 Bulleye ==== | ==== Debian 11 Bulleye ==== | ||
===== MongoDB 6.x ===== | |||
echo "deb http://repo.mongodb.org/apt/debian | echo "deb http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list | ||
sudo apt-get update | curl -sSL https://www.mongodb.org/static/pgp/server-6.0.asc -o mongoserver.asc | ||
gpg --no-default-keyring --keyring ./mongo_key_temp.gpg --import ./mongoserver.asc | |||
gpg --no-default-keyring --keyring ./mongo_key_temp.gpg --export > ./mongoserver_key.gpg | |||
sudo mv mongoserver_key.gpg /etc/apt/trusted.gpg.d/ | |||
sudo apt-get update | |||
sudo apt install mongodb-org | sudo apt install mongodb-org | ||
Línea 19: | Línea 23: | ||
Sale por pantalla: | Sale por pantalla: | ||
db version | db version v6.0.4 | ||
Build Info: { | Build Info: { | ||
"version": " | "version": "6.0.4", | ||
"gitVersion": " | "gitVersion": "44ff59461c1353638a71e710f385a566bcd2f547", | ||
"openSSLVersion": "OpenSSL 1.1.1n 15 Mar 2022", | "openSSLVersion": "OpenSSL 1.1.1n 15 Mar 2022", | ||
"modules": [], | "modules": [], | ||
"allocator": "tcmalloc", | "allocator": "tcmalloc", | ||
"environment": { | "environment": { | ||
"distmod": " | "distmod": "debian11", | ||
"distarch": "x86_64", | "distarch": "x86_64", | ||
"target_arch": "x86_64" | "target_arch": "x86_64" | ||
Línea 36: | Línea 40: | ||
sudo systemctl enable --now mongod | sudo systemctl enable --now mongod | ||
sudo systemctl status mongod | sudo systemctl status mongod --no-pager -l | ||
== Docker == | == Docker == |
Revisión del 20:24 11 feb 2023
Instalación
GNU/Linux
Debian
Debian 11 Bulleye
MongoDB 6.x
echo "deb http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list curl -sSL https://www.mongodb.org/static/pgp/server-6.0.asc -o mongoserver.asc gpg --no-default-keyring --keyring ./mongo_key_temp.gpg --import ./mongoserver.asc gpg --no-default-keyring --keyring ./mongo_key_temp.gpg --export > ./mongoserver_key.gpg sudo mv mongoserver_key.gpg /etc/apt/trusted.gpg.d/ sudo apt-get update sudo apt install mongodb-org
La versión de mongodb:
mongod --version
Sale por pantalla:
db version v6.0.4 Build Info: { "version": "6.0.4", "gitVersion": "44ff59461c1353638a71e710f385a566bcd2f547", "openSSLVersion": "OpenSSL 1.1.1n 15 Mar 2022", "modules": [], "allocator": "tcmalloc", "environment": { "distmod": "debian11", "distarch": "x86_64", "target_arch": "x86_64" } }
Hacer correr servicio:
sudo systemctl enable --now mongod sudo systemctl status mongod --no-pager -l
Docker
Bajando imagen
docker run -dp 27017:27017 -v local-mongo:/data/db --name local-mongo --restart=always mongo
Run container
docker exec -it local-mongo sh