Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Problema na instalação

Bom dia.

Estou com problema para instalar/rodar o node...

Estou usando Ubuntu 16.04 x64 e criei uma pasta no meu diretorio /home/rodrigo/mongo/db para inserir meus bancos. Eu instalei o mongo 3.4 via apt (https://docs.mongodb.com/master/tutorial/install-mongodb-on-ubuntu/?_ga=1.261164493.1947547865.1490919319)

Entao eu executei esse comando: mongod --dbpath /home/rodrigo/mongo/db

E me retornou isso

rodrigo@rodrigo-MS-7788:~$ mongod --dbpath /home/rodrigo/mongo/db
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] MongoDB starting : pid=21016 port=27017 dbpath=/home/rodrigo/mongo/db 64-bit host=rodrigo-MS-7788
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] db version v3.4.3
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] git version: f07437fb5a6cca07c10bafa78365456eb1d6d5e1
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] allocator: tcmalloc
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] modules: none
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] build environment:
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten]     distmod: ubuntu1604
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten]     distarch: x86_64
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten]     target_arch: x86_64
2017-03-30T21:57:18.568-0300 I CONTROL  [initandlisten] options: { storage: { dbPath: "/home/rodrigo/mongo/db" } }
2017-03-30T21:57:18.592-0300 E NETWORK  [initandlisten] listen(): bind() failed Address already in use for socket: 0.0.0.0:27017
2017-03-30T21:57:18.592-0300 E NETWORK  [initandlisten]   addr already in use
2017-03-30T21:57:18.592-0300 E NETWORK  [initandlisten] Failed to set up sockets during startup.
2017-03-30T21:57:18.592-0300 E STORAGE  [initandlisten] Failed to set up listener: InternalError: Failed to set up sockets
2017-03-30T21:57:18.592-0300 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2017-03-30T21:57:18.592-0300 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2017-03-30T21:57:18.592-0300 I CONTROL  [initandlisten] now exiting
2017-03-30T21:57:18.592-0300 I CONTROL  [initandlisten] shutting down with code:48

Ele me retorna algumas falhas...

Dai eu executei o comando mongod

2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] MongoDB starting : pid=21282 port=27017 dbpath=/data/db 64-bit host=rodrigo-MS-7788
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] db version v3.4.3
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] git version: f07437fb5a6cca07c10bafa78365456eb1d6d5e1
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] allocator: tcmalloc
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] modules: none
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] build environment:
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten]     distmod: ubuntu1604
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten]     distarch: x86_64
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten]     target_arch: x86_64
2017-03-30T22:01:20.119-0300 I CONTROL  [initandlisten] options: {}
2017-03-30T22:01:20.120-0300 I STORAGE  [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating
2017-03-30T22:01:20.120-0300 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2017-03-30T22:01:20.120-0300 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2017-03-30T22:01:20.120-0300 I CONTROL  [initandlisten] now exiting
2017-03-30T22:01:20.120-0300 I CONTROL  [initandlisten] shutting down with code:100

E tambem nao funcionou. E na minha pasta db o banco não foi criado.

Tem alguma ideia de como resolver isso ?

Abraço

1 resposta
solução!

Consegui arrumar.

O erro estava na porta. Fui em etc/mongod.conf e troquei a porta para 28017

"Restartei" o mongod e foi.

Abraço