- Adicionar a chave.
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- Criando a lista repositório
- sudo echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
- Atualizando a lista de repositório
- sudo apt-get update
- Instalando o MongoDb
- sudo apt-get install mongodb-org
- Checando se está funcionando
- sudo systemctl status mongd
- Caso não funcione reinicie o servidor
- Caso ainda não funcione crie o script abaixo e o invoque:
echo '[Unit]
Description=High-performance, schema-free document-oriented database
After=syslog.target network.target
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod -f /etc/mongod.conf
[Install]
WantedBy=multi-user.target' > /lib/systemd/system/mongod.service
# Setup the required directories
mkdir -p /var/run/mongodb/
mkdir -p /var/log/mongodb/
mkdir -p /var/lib/mongodb/
mkdir -p /data/db/
chown mongodb:mongodb /var/run/mongodb/
chown mongodb:mongodb /var/log/mongodb/
chown mongodb:mongodb /var/lib/mongodb/
chown mongodb:mongodb /data/db
chmod 0755 /var/log/mongodb/
chmod 0755 /var/run/mongodb/
chmod 0755 /var/lib/mongodb/
chmod 0755 /data/db/
# Start the new service and enable it on boot
systemctl --system daemon-reload
systemctl enable mongod.service
echo "Starting"
systemctl start mongod.service
Traduzido de: http://askubuntu.com/questions/724749/install-mongo-3-2-on-ubuntu-15-10
Nenhum comentário:
Postar um comentário