mongodb ficando travado no servidor

0

Oi eu estou tendo problemas com o mongo db no meu servidor. Mongo db está ficando caiu em poucos dias. Eu adicionei um script de shell para reiniciar o serviço mongod no servidor se caiu, mas eu quero saber o que devo fazer para se certificar de que não falha em nada.

O arquivo mongodb.log em "/var/log/mongodb" não está mostrando o motivo da falha. Isso me mostra conexões fechando e terminando apenas.

Estou adicionando algumas linhas do arquivo de log aqui:

2017-06-06T06:49:52.305+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35871 #279 (11 connections now open)
2017-06-06T06:50:39.846+0000 I NETWORK  [conn278] end connection 127.0.0.1:35869 (10 connections now open)
2017-06-06T06:51:03.870+0000 I NETWORK  [conn264] end connection 127.0.0.1:35819 (9 connections now open)
2017-06-06T06:51:05.048+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35875 #280 (10 connections now open)
2017-06-06T06:51:32.902+0000 I NETWORK  [conn276] end connection 127.0.0.1:35865 (9 connections now open)
2017-06-06T06:52:13.954+0000 I NETWORK  [conn266] end connection 127.0.0.1:35826 (8 connections now open)
2017-06-06T06:52:20.958+0000 I NETWORK  [conn221] end connection 127.0.0.1:35457 (7 connections now open)
2017-06-06T06:52:22.432+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35882 #281 (8 connections now open)
2017-06-06T06:52:39.052+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35883 #282 (9 connections now open)
2017-06-06T06:52:44.981+0000 I NETWORK  [conn268] end connection 127.0.0.1:35829 (8 connections now open)
2017-06-06T06:52:46.619+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35885 #283 (9 connections now open)
2017-06-06T06:53:03.509+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35886 #284 (10 connections now open)
2017-06-06T06:53:04.399+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35887 #285 (11 connections now open)
2017-06-06T06:53:06.160+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35888 #286 (12 connections now open)
2017-06-06T06:54:25.183+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35889 #287 (13 connections now open)
2017-06-06T06:54:55.284+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35890 #288 (14 connections now open)
2017-06-06T06:55:27.122+0000 I NETWORK  [conn279] end connection 127.0.0.1:35871 (13 connections now open)
2017-06-06T06:55:28.117+0000 I NETWORK  [conn269] end connection 127.0.0.1:35832 (12 connections now open)
2017-06-06T06:57:09.066+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35894 #289 (13 connections now open)
2017-06-06T06:57:09.092+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35895 #290 (14 connections now open)
2017-06-06T06:57:17.206+0000 I NETWORK  [conn287] end connection 127.0.0.1:35889 (13 connections now open)
2017-06-06T06:57:24.214+0000 I NETWORK  [conn281] end connection 127.0.0.1:35882 (12 connections now open)
2017-06-06T06:58:59.404+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35898 #291 (13 connections now open)
2017-06-06T06:59:17.301+0000 I NETWORK  [conn277] end connection 127.0.0.1:35866 (12 connections now open)
2017-06-06T06:59:46.326+0000 I NETWORK  [conn288] end connection 127.0.0.1:35890 (11 connections now open)
2017-06-06T06:59:49.328+0000 I NETWORK  [conn274] end connection 127.0.0.1:35860 (10 connections now open)
2017-06-06T07:00:03.342+0000 I NETWORK  [conn290] end connection 127.0.0.1:35895 (9 connections now open)
2017-06-06T07:05:46.650+0000 I NETWORK  [conn275] end connection 127.0.0.1:35863 (8 connections now open)
2017-06-06T13:15:43.047+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35995 #292 (9 connections now open)
2017-06-06T13:25:08.760+0000 I NETWORK  [conn292] end connection 127.0.0.1:35995 (8 connections now open)
2017-06-07T04:07:48.262+0000 I NETWORK  [conn285] end connection 127.0.0.1:35887 (7 connections now open)
2017-06-07T06:00:43.026+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:36231 #293 (8 connections now open)
2017-06-07T06:10:21.038+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:36236 #294 (9 connections now open)
2017-06-07T06:12:08.906+0000 I NETWORK  [conn293] end connection 127.0.0.1:36231 (8 connections now open)
2017-06-07T06:13:03.738+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:36238 #295 (9 connections now open)
2017-06-07T06:13:13.005+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:36239 #296 (10 connections now open)
2017-06-07T06:14:10.995+0000 I NETWORK  [conn294] end connection 127.0.0.1:36236 (9 connections now open)
2017-06-07T06:15:02.038+0000 I NETWORK  [conn291] end connection 127.0.0.1:35898 (8 connections now open)
2017-06-07T06:15:16.486+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:36244 #297 (9 connections now open)
2017-06-07T06:15:26.680+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:36245 #298 (10 connections now open)
2017-06-07T06:16:43.118+0000 I NETWORK  [conn282] end connection 127.0.0.1:35883 (9 connections now open)
2017-06-07T06:17:07.667+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:36248 #299 (10 connections now open)
2017-06-07T06:17:19.869+0000 I CONTROL  [main] ***** SERVER RESTARTED *****
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] MongoDB starting : pid=26429 port=27017 dbpath=/var/lib/mongodb 64-bit host=ip-172-31-28-133
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] db version v3.2.6
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] git version: 05552b562c7a0b3143a729aaa0838e558dc49b25
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] modules: none
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] build environment:
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten]     distmod: ubuntu1404
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-06-07T06:17:19.919+0000 I CONTROL  [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1", port: 27017 }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2017-06-07T06:17:19.963+0000 I -        [initandlisten] Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-06-07T06:17:19.963+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-06-07T06:17:20.514+0000 I CONTROL  [initandlisten] 
2017-06-07T06:17:20.514+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-06-07T06:17:20.514+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-06-07T06:17:20.515+0000 I CONTROL  [initandlisten] 
2017-06-07T06:17:20.515+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-06-07T06:17:20.515+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-06-07T06:17:20.515+0000 I CONTROL  [initandlisten] 
2017-06-07T06:17:20.553+0000 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2017-06-07T06:17:20.554+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'

Eu notei que as informações são fornecidas quando o serviço é reiniciado. Mas não consigo descobrir o problema por trás dos acidentes.

Suspeito que seja um problema de memória, pois as pesquisas do Google mostram erros de memória. Mas desde que eles não são registrados no arquivo de log.

Eu tenho uma instância t2.micro no AWS EC2 onde o script mongo está sendo executado. Como posso evitar que o mongo caia?

    
por Curious Developer 08.06.2017 / 12:07

0 respostas