mongodb : SyncSourceFeedbackThread] SEVERE: Invalid access at address: 0xa8 - linux

last night out mongodb replset r1 was crashed ,then monit restart it.
this is process stats:
mongod 1390 1 0 Aug15 ? 00:39:29 /usr/bin/mongod -f /etc/mongod.conf
root 1967 1 8 Aug15 ? 18:53:29 /usr/bin/mongos -f /etc/mongod_route.conf
mongod 2127 1 0 Aug15 ? 00:56:07 /usr/bin/mongod -f /etc/mongod_r2.conf
mongod 2514 1 0 Aug15 ? 01:07:33 /usr/bin/mongod -f /etc/mongod_config.conf
mongod 2552 1 0 Aug15 ? 00:49:41 /usr/bin/mongod -f /etc/mongod_arbiter.conf
root 7722 21913 0 03:04 ? 00:00:00 [mongod_r1] <defunct>
mongod 7733 1 0 03:04 ? 00:05:06 /usr/bin/mongod -f /etc/mongod_r1.conf
root 13964 12745 0 11:52 pts/0 00:00:00 grep --color mongo
this is mongodb log:
2015-08-25T03:03:53.425+0800 [conn140823] authenticate db: local { authenticate: 1, nonce: "xxx", user: "__system", key: "xxx" }
2015-08-25T03:03:53.430+0800 [conn140823] replset couldn't find a slave with id 0, not tracking 53d71c612ea2da0bd4c469e6
2015-08-25T03:03:53.432+0800 [SyncSourceFeedbackThread] SEVERE: Invalid access at address: 0xa8
2015-08-25T03:03:53.565+0800 [SyncSourceFeedbackThread] SEVERE: Got signal: 11 (Segmentation fault).
Backtrace:0x11bd301 0x11bc6de 0x11bc7cf 0x33d060f710 0xeacaf6 0xeb19e8 0x1145332 0x1201c99 0x33d06079d1 0x36818e88fd
/usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x11bd301]
/usr/bin/mongod() [0x11bc6de]
/usr/bin/mongod() [0x11bc7cf]
/lib64/libpthread.so.0() [0x33d060f710]
/usr/bin/mongod(_ZN5mongo18SyncSourceFeedback13replHandshakeEv+0xb86) [0xeacaf6]
/usr/bin/mongod(_ZN5mongo18SyncSourceFeedback3runEv+0x9b8) [0xeb19e8]
/usr/bin/mongod(_ZN5mongo13BackgroundJob7jobBodyEv+0xd2) [0x1145332]
/usr/bin/mongod() [0x1201c99]
/lib64/libpthread.so.0() [0x33d06079d1]
/lib64/libc.so.6(clone+0x6d) [0x36818e88fd]
2015-08-25T03:04:17.172+0800 ***** SERVER RESTARTED *****
2015-08-25T03:04:17.178+0800 [initandlisten] MongoDB starting : pid=7733 port=1201 dbpath=/data/mongo_r1 64-bit host=x2
2015-08-25T03:04:17.178+0800 [initandlisten] db version v2.6.0
2015-08-25T03:04:17.178+0800 [initandlisten] git version: 1c1c76aeca21c5983dc178920f5052c298db616c
2015-08-25T03:04:17.178+0800 [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-08-25T03:04:17.178+0800 [initandlisten] allocator: tcmalloc
2015-08-25T03:04:17.178+0800 [initandlisten] options: { config: "/etc/mongod_r1.conf", net: { bindIp: "10.165.46.132", port: 1201 }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod_r1.pid" },
what happened?

Related

NodeJS converting Docker Redis hostname to localhost

It seems the Redis container hostname is being converted to localhost by NodeJS.
Here are my files:
.env
REDIS_HOST=redis-eventsystem
REDIS_PORT=6379
REDIS_SECRET=secret
index.ts
// there are things above this
let Redis = require('redis');
let client : any = Redis.createClient({
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT,
legacyMode: true
});
client.on('error', (err : Error) : void => {
console.error(
`Redis connection error: ${err}`
);
});
client.on('connect', (err : Error) : void => {
console.info(
`Redis connection success.`
);
});
client.connect();
// there are things bellow this
docker-compose.yml
version: '3.8'
services:
eventsystem:
image: eventsystem
restart: always
depends_on:
- "redis-eventsystem"
ports:
- "80:3000"
networks:
- eventsystem
redis-eventsystem:
image: redis
command: ["redis-server", "--bind", "redis-eventsystem", "--port", "6379", "--protected-mode", "no"]
restart: always
networks:
- eventsystem
networks:
eventsystem:
driver: bridge
docker log
2022-11-21 17:50:41 eventsystem-redis-eventsystem-1 | 1:C 21 Nov 2022 20:50:41.106 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
2022-11-21 17:50:41 eventsystem-redis-eventsystem-1 | 1:C 21 Nov 2022 20:50:41.106 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
2022-11-21 17:50:41 eventsystem-redis-eventsystem-1 | 1:C 21 Nov 2022 20:50:41.106 # Configuration loaded
2022-11-21 17:50:41 eventsystem-redis-eventsystem-1 | 1:M 21 Nov 2022 20:50:41.106 * monotonic clock: POSIX clock_gettime
2022-11-21 17:50:41 eventsystem-redis-eventsystem-1 | 1:M 21 Nov 2022 20:50:41.108 * Running mode=standalone, port=6379.
2022-11-21 17:50:41 eventsystem-redis-eventsystem-1 | 1:M 21 Nov 2022 20:50:41.108 # Server initialized
2022-11-21 17:50:41 eventsystem-redis-eventsystem-1 | 1:M 21 Nov 2022 20:50:41.108 * Ready to accept connections
2022-11-21 17:50:41 eventsystem-eventsystem-1 |
2022-11-21 17:50:41 eventsystem-eventsystem-1 | > eventsystem#1.0.0 start
2022-11-21 17:50:41 eventsystem-eventsystem-1 | > node index.js serve
2022-11-21 17:50:41 eventsystem-eventsystem-1 |
2022-11-21 17:50:42 eventsystem-eventsystem-1 | Application is listening at http://localhost:3000
2022-11-21 17:50:42 eventsystem-eventsystem-1 | Mon Nov 21 2022 20:50:42 GMT+0000 (Coordinated Universal Time) - Redis connection error: Error: connect ECONNREFUSED 127.0.0.1:6379
As you all can see the connection is refused for the IP 127.0.0.1 but on my application the redis is set to work on the hostname for the container which holds the redis server. I can't think of anything that may be causing this problem.
So to answer my own question, basically the problem was related to the variables passed on createClient at my code.
It seems that for some unknown reason the host and port variables need to be passed inside a variable called socket inside the createClient argument object.
So, instead of doing the usual and passing the host and port inside the argument object, you must do the following:
let client : any = Redis.createClient({
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT,
socket: {
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT
},
legacyMode: true
});
Hope to have helped someone else besides me.
Cheers!

Can't connect to mongo with nodeJs on raspberry Pi

with this code on nodeJS :
var MongoClient = require('mongodb').MongoClient;
...
MongoClient.connect('mongodb://127.0.0.1:27017', { useUnifiedTopology: true }, (error, db) => {
if (error) {
obs.error(this.throwExceptionError(error));
} else {
this.dbConnect = db.db(dbb);
obs.next(true);
}
});
i can connect to MongoDB on windows and it works well.
I try to execute this code on my raspberry Pi but the code didn't work.
I installed mongodb, launch :
service mongodb start
When i execute mongo in a console, it works and i see my dbs and my collections.
The log of the mongoDb are :
Sun Jun 28 13:43:51.566 [initandlisten]
Sun Jun 28 13:43:51.566 [initandlisten] db version v2.4.14
Sun Jun 28 13:43:51.566 [initandlisten] git version: nogitversion
Sun Jun 28 13:43:51.566 [initandlisten] build info: Linux bm-wb-03 3.19.0-trunk-armmp #1 SMP Debian 3.19.1-1~exp1+plugwash1 (2015-03-28) armv7l BOOST_LIB_VERSION=1_58
Sun Jun 28 13:43:51.566 [initandlisten] allocator: system
Sun Jun 28 13:43:51.566 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", journal: "true", logappend: "true", logpath: "/var/log/mongodb/mongodb.log", port: 27017 }
Sun Jun 28 13:43:51.578 [initandlisten] journal dir=/var/lib/mongodb/journal
Sun Jun 28 13:43:51.578 [initandlisten] recover : no journal files present, no recovery needed
Sun Jun 28 13:43:51.606 [websvr] admin web console waiting for connections on port 28017
Sun Jun 28 13:43:51.606 [initandlisten] waiting for connections on port 27017
And the command "netstat -tulpn"
pi#raspberrypi:~ $ sudo netstat -tulpn
Connexions Internet actives (seulement serveurs)
Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 3407/mongod
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 486/vncserver-x11-c
tcp 0 0 127.0.0.1:28017 0.0.0.0:* LISTEN 3407/mongod
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 495/sshd
So i think the server is running...
I don't understand why i can't connect to mongoDB on my raspberry pi.
help plz ^^

sequelize and react won't connect postgresql without an error

I have a react app with express server. It's not working on one of my pc(others are fine exact same versions and setup). Problem is even though i can connect to my postgresql db both from terminal and pgadmin interface, neither express server or sequelize can't find/connect it and they don't produce any error. sequelize db:migrate finishes without an error or additional migration/table created message. This leads infinite loading on app but all pending requests eventually fail.
Here is my sequelize config file:
{
"development": {
"username": "postgres",
"password": "postgres",
"database": "db",
"host": "localhost",
"dialect": "postgres",
"port": 5432
},
"test": {
"username": "postgres",
"password": "postgres",
"database": "db",
"host": "127.0.0.1",
"dialect": "postgres",
"port": 5432
},
"production": {
"username": "postgres",
"password": "postgres",
"database": "db",
"host": "127.0.0.1",
"dialect": "postgres",
"port": 5432
}
}
and react config in .env and express server
.env
DB_PASSWORD=postgres
DB_PORT=5432
DB_DATABASE=db
DB_HOST=localhost
DB_USER=postgres
server.js
const connectionString = `postgresql://${process.env.DB_USER}:${
process.env.DB_PASSWORD
}#${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_DATABASE}`;
sudo systemctl status postgresql.service returns this:
postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2020-06-04 20:47:20 +03; 9min ago
Process: 38637 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=0/SUCCESS)
Main PID: 38640 (postgres)
Tasks: 14 (limit: 19096)
Memory: 123.1M
CGroup: /system.slice/postgresql.service
├─38640 /usr/bin/postgres -D /var/lib/postgres/data
├─38644 postgres: checkpointer
├─38645 postgres: background writer
├─38646 postgres: walwriter
├─38647 postgres: autovacuum launcher
├─38648 postgres: stats collector
├─38649 postgres: logical replication launcher
├─38662 postgres: postgres db ::1(42040) idle
├─38834 postgres: postgres db1 ::1(42242) idle
├─38899 postgres: postgres db2 ::1(42352) idle
├─38912 postgres: postgres db3 ::1(42378) idle
├─38949 postgres: postgres db4 ::1(42450) idle
├─38960 postgres: postgres db5 ::1(42470) idle
└─38971 postgres: postgres db6 ::1(42492) idle
Jun 04 20:47:20 archPC postgres[38640]: 2020-06-04 20:47:20.535 +03 [38640] LOG: starting PostgreSQL 12.3 on x8>
Jun 04 20:47:20 archPC postgres[38640]: 2020-06-04 20:47:20.536 +03 [38640] LOG: listening on IPv6 address "::1>
Jun 04 20:47:20 archPC postgres[38640]: 2020-06-04 20:47:20.536 +03 [38640] LOG: listening on IPv4 address "127>
Jun 04 20:47:20 archPC postgres[38640]: 2020-06-04 20:47:20.541 +03 [38640] LOG: listening on Unix socket "/run>
Jun 04 20:47:20 archPC postgres[38643]: 2020-06-04 20:47:20.565 +03 [38643] LOG: database system was shut down >
Jun 04 20:47:20 archPC postgres[38640]: 2020-06-04 20:47:20.573 +03 [38640] LOG: database system is ready to ac>
Jun 04 20:47:20 archPC systemd[1]: Started PostgreSQL database server.
I've been trying to fix this issue and finally found a solution.
If you are using Node v14 just like me, you need to update pg module from npm and that's all

Wikimedia with Parsoid 0.4.0 doesn't start or doesn't connect properly with nodejs

I have parsoid 0.4.0 from mediawiki, nodejs v0.10.25, when I /etc/init.d/parsoid start, I receive workers restarting having the next messages in the parsoid.log, this message is repeated indefinitely, making my parsoid.log growing indefinitely, another hand I don't recerive any response at http://localhost:8142, 8142 is the port where my parsoid says is serving when I start with "/etc/init.d/parsoid start with the output message:
root#vscj016mlinuxserver:/usr/lib# /etc/init.d/parsoid start
Started Parsoid server on port 8142
root#vscj016mlinuxserver:/usr/lib#
/var/log/parsoid.log output :
[info][master][13876] initializing 4 workers
[info][worker][13879] loading ...
[info][worker][13882] loading ...
[info][worker][13878] loading ...
[info][worker][13881] loading ...
[fatal][worker][13879] uncaught exception Object function createApplication() {
var app = function(req, res, next) {
app.handle(req, res, next);
};
mixin(app, EventEmitter.prototype, false);
mixin(app, proto, false);
app.request = { __proto__: req, app: app };
app.response = { __proto__: res, app: app };
app.init();
return app;
} has no method 'createServer'
TypeError: Object function createApplication() {
var app = function(req, res, next) {
app.handle(req, res, next);
};
mixin(app, EventEmitter.prototype, false);
mixin(app, proto, false);
app.request = { __proto__: req, app: app };
app.response = { __proto__: res, app: app };
app.init();
return app;
} has no method 'createServer'
at new ParsoidService (/usr/lib/parsoid/src/api/ParsoidService.js:23:20)
at Object.<anonymous> (/usr/lib/parsoid/src/api/server.js:202:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
On another hand I can see de processes started with "ps -ef | grep parsoid", de pids of the processes change everytime as you can see with the next output like:
parsoid 920 1 0 09:08 ? 00:00:00 /bin/sh -c /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js >> /var/log/parsoid/parsoid.log 2>&1
parsoid 949 920 0 09:08 ? 00:00:01 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2563 949 18 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2565 949 19 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2567 949 17 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2569 949 5 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
root 2572 2134 0 09:13 pts/0 00:00:00 grep --color=auto parsoid
root#vscj016mlinuxserver:/var/log/parsoid# ps -ef| grep parsoid
parsoid 920 1 0 09:08 ? 00:00:00 /bin/sh -c /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js >> /var/log/parsoid/parsoid.log 2>&1
parsoid 949 920 0 09:08 ? 00:00:01 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2579 949 23 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2581 949 23 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2583 949 0 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2585 949 0 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
root 2588 2134 0 09:13 pts/0 00:00:00 grep --color=auto parsoid
root#vscj016mlinuxserver:/var/log/parsoid# ps -ef| grep parsoid
parsoid 920 1 0 09:08 ? 00:00:00 /bin/sh -c /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js >> /var/log/parsoid/parsoid.log 2>&1
parsoid 949 920 0 09:08 ? 00:00:01 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2581 949 22 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2583 949 30 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2585 949 28 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2589 949 15 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
I show the /etc/mediawiki/parsoid/settings.js aswell:
exports.setup = function(parsoidConfig) {
// Set your own user-agent string
// Otherwise, defaults to "Parsoid/<current-version-defined-in- package.json>"
//parsoidConfig.userAgent = "My-User-Agent-String";
// The URL of your MediaWiki API endpoint.
parsoidConfig.setMwApi('localhost', {uri: 'http://localhost/mediawiki/api.php'} );
// To specify a proxy (or proxy headers) specific to this prefix (which
// overrides defaultAPIProxyURI) use:
/*
parsoidConfig.setMwApi('localhost', {
uri: 'http://localhost/w/api.php',
// set `proxy` to `null` to override and force no proxying.
proxy: {
uri: 'http://my.proxy:1234/',
headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
}
});
*/
......
......
......
Here I show the packets installed and the version of my ubuntu server:
root#vscj016mlinuxserver:/usr/lib# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
root#vscj016mlinuxserver:/usr/lib#
root#vscj016mlinuxserver:/usr/lib#
root#vscj016mlinuxserver:/usr/lib# dpkg -l parsoid
Deseado=Desconocido/Instalar/Eliminar/Purgar/Retener
| Estado=No/Instalado/Config-files/Desempaquetado/Medio-conf/Medio- inst/espera-disparo/pendiente-disparo
|/ Err?=(ninguno)/Requiere-reinst (Estado,Err: mayúsc.=malo)
||/ Nombre Versión Arquitectura Descripción
+++-=================================-=====================- =====================- =======================================================================
ii parsoid 0.4.0 amd64 Web service converting HTML+RDFa to MediaWiki wikitext and back
root#vscj016mlinuxserver:/usr/lib# dpkg -l nodejs
Deseado=Desconocido/Instalar/Eliminar/Purgar/Retener
| Estado=No/Instalado/Config-files/Desempaquetado/Medio-conf/Medio- inst/espera-disparo/pendiente-disparo
|/ Err?=(ninguno)/Requiere-reinst (Estado,Err: mayúsc.=malo)
||/ Nombre Versión Arquitectura Descripción
+++-=================================-=====================- =====================- =======================================================================
ii nodejs 0.10.25~dfsg2-2ubuntu amd64 evented I/O for V8 javascript
root#vscj016mlinuxserver:/usr/lib# dpkg -l nodejs-legacy
Deseado=Desconocido/Instalar/Eliminar/Purgar/Retener
| Estado=No/Instalado/Config-files/Desempaquetado/Medio-conf/Medio- inst/espera-disparo/pendiente-disparo
|/ Err?=(ninguno)/Requiere-reinst (Estado,Err: mayúsc.=malo)
||/ Nombre Versión Arquitectura Descripción
+++-=================================-=====================- =====================- =======================================================================
ii nodejs-legacy 0.10.25~dfsg2-2ubuntu all evented I/O for V8 javascript (legacy symlink)
root#vscj016mlinuxserver:/usr/lib#
You're going to have a much better time with a newer version of Node, for example >=4.3. You can use NVM to run manage different versions of Node: https://github.com/creationix/nvm
this my /etc/mediawiki/parsoid configuration:
exports.setup = function(parsoidConfig) {
// Set your own user-agent string
// Otherwise, defaults to "Parsoid/<current-version-defined-in- package.json>"
//parsoidConfig.userAgent = "My-User-Agent-String";
// The URL of your MediaWiki API endpoint.
parsoidConfig.setMwApi('localhost', { uri: 'http://localhost/mediawiki/api.php' });
// To specify a proxy (or proxy headers) specific to this prefix (which
// overrides defaultAPIProxyURI) use:
/*
parsoidConfig.setMwApi('localhost', {
uri: 'http://localhost/w/api.php',
// set `proxy` to `null` to override and force no proxying.
proxy: {
uri: 'http://my.proxy:1234/',
headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
}
});
*/
This is my parsoid configuration , I don't Know if this is the problema:
exports.setup = function(parsoidConfig) {
// Set your own user-agent string
// Otherwise, defaults to "Parsoid/<current-version-defined-in- package.json>"
//parsoidConfig.userAgent = "My-User-Agent-String";
// The URL of your MediaWiki API endpoint.
parsoidConfig.setMwApi('localhost', { uri: 'http://localhost/mediawiki/api.php' });
// To specify a proxy (or proxy headers) specific to this prefix (which
// overrides defaultAPIProxyURI) use:
/*
parsoidConfig.setMwApi('localhost', {
uri: 'http://localhost/w/api.php',
// set `proxy` to `null` to override and force no proxying.
proxy: {
uri: 'http://my.proxy:1234/',
headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
}
});
*/

The MongoDB process is shutting down each day. how run mongod forever in the server?

I am beginner in MongoDB and I have a problem with the execution of this in the server.
My project is hosted in servers of hostmonster.com but they don't give me support for MongoDB data bases, although they say that I can install it under my own responsability.
Then, I installed MongoDB 2.4.1 without problems into Linux 64, after, in the MongoDB bin folder (with: mongo, mongod, mongodump ... ) I created a folder called 'data' and 'data/db' for doing some tests.
from console, I connect to the server across the SSH protocol and I run
./mongod --dbpath 'data/db'
and it works.
But, I need that it run automatically forever.
I followed the steps of Mongodb can't start and run the next line:
./mongod --fork --dbpath 'data/db' --smallfiles --logpath 'data/mongodb.log' --logappend
It also worked, It started the process and I closed the console, this process continued running and I could view my data across my domain.
The problem is that the process takes a day to close, ie, I can't see my data across domain, then, I need run mongod again. with:
./mongod --fork --dbpath 'data/db' --smallfiles --logpath 'data/mongodb.log' --logappend
I don't want do it everyday, my question is:
What may be the problem?, why the mongod process dies each day?
how can I run the process forever?
Sorry for my English.
Edit: Add the last error log. I don't understand it.
Fri Apr 12 03:19:34.577 [TTLMonitor] query local.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:0 keyUpdates:0 locks(micros) r:141663 nreturned:0 reslen:20 141ms
Fri Apr 12 03:19:34.789 [TTLMonitor] query users.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:3 keyUpdates:0 locks(micros) r:211595 nreturned:0 reslen:20 211ms
Fri Apr 12 03:20:57.869 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 18215ms
Fri Apr 12 03:20:57.931 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 8ms
Fri Apr 12 03:22:14.155 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 32ms
Fri Apr 12 03:22:14.215 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 14ms
Fri Apr 12 03:22:30.670 [TTLMonitor] query actarium.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:2 keyUpdates:0 locks(micros) r:430204 nreturned:0 reslen:20 430ms
Fri Apr 12 03:23:14.825 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 7ms
Fri Apr 12 03:23:31.133 [TTLMonitor] query actarium.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:2 keyUpdates:0 locks(micros) r:179175 nreturned:0 reslen:20 168ms
Fri Apr 12 03:25:19.201 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 505ms
Fri Apr 12 03:25:23.370 [TTLMonitor] query local.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:0 keyUpdates:0 locks(micros) r:3604735 nreturned:0 reslen:20 3604ms
Fri Apr 12 03:25:25.294 [TTLMonitor] query users.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:3 keyUpdates:0 numYields: 1 locks(micros) r:3479328 nreturned:0 reslen:20 1882ms
Fri Apr 12 03:26:26.647 [TTLMonitor] query actarium.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:2 keyUpdates:0 numYields: 1 locks(micros) r:1764712 nreturned:0 reslen:20 1044ms
Fri Apr 12 04:09:27.804 [TTLMonitor] query actarium.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:2 keyUpdates:0 locks(micros) r:200919 nreturned:0 reslen:20 200ms
Fri Apr 12 04:43:54.002 got signal 15 (Terminated), will terminate after current cmd ends
Fri Apr 12 04:43:54.151 [interruptThread] now exiting
Fri Apr 12 04:43:54.151 dbexit:
Fri Apr 12 04:43:54.157 [interruptThread] shutdown: going to close listening sockets...
Fri Apr 12 04:43:54.160 [interruptThread] closing listening socket: 9
Fri Apr 12 04:43:54.160 [interruptThread] closing listening socket: 10
Fri Apr 12 04:43:54.160 [interruptThread] closing listening socket: 11
Fri Apr 12 04:43:54.160 [interruptThread] removing socket file: /tmp/mongodb-27017.sock
Fri Apr 12 04:43:54.160 [interruptThread] shutdown: going to flush diaglog...
Fri Apr 12 04:43:54.160 [interruptThread] shutdown: going to close sockets...
Fri Apr 12 04:43:54.176 [interruptThread] shutdown: waiting for fs preallocator...
Fri Apr 12 04:43:54.176 [interruptThread] shutdown: lock for final commit...
Fri Apr 12 04:43:54.176 [interruptThread] shutdown: final commit...
Fri Apr 12 04:43:54.176 [interruptThread] shutdown: closing all files...
Fri Apr 12 04:43:54.212 [interruptThread] closeAllFiles() finished
Fri Apr 12 04:43:54.220 [interruptThread] journalCleanup...
Fri Apr 12 04:43:54.246 [interruptThread] removeJournalFiles
Fri Apr 12 04:43:54.280 [interruptThread] error removing journal files
boost::filesystem::directory_iterator::construct: No such file or directory: "/home2/anuncio3/bin/mongodb-linux-x86_64-2.4.1/bin/data/db/journal"
Fri Apr 12 04:43:54.280 [interruptThread] error couldn't remove journal file during shutdown boost::filesystem::directory_iterator::construct: No such file or directory: "/home2/anuncio3/bin/mongodb-linux-x86_64-2.4.1/bin/data/db/journal"
Fri Apr 12 04:43:54.285 shutdown failed with exception
Fri Apr 12 04:43:54.285 dbexit: really exiting now
Your answer is here:
Fri Apr 12 04:43:54.002 got signal 15 (Terminated), will terminate after current cmd ends
Fri Apr 12 04:43:54.151 [interruptThread] now exiting
Your process is receiving signal 15, which is the default kill signal. It's possible that their systems are automatically killing long-running processes or something similar. If that is indeed what's happening, then your host would have to resolve that.
Additionally, these errors:
Fri Apr 12 04:43:54.280 [interruptThread] error removing journal files
boost::filesystem::directory_iterator::construct: No such file or directory: "/home2/anuncio3/bin/mongodb-linux-x86_64-2.4.1/bin/data/db/journal"
Fri Apr 12 04:43:54.280 [interruptThread] error couldn't remove journal file during shutdown boost::filesystem::directory_iterator::construct: No such file or directory: "/home2/anuncio3/bin/mongodb-linux-x86_64-2.4.1/bin/data/db/journal"
indicate that something is wrong with your install's data directory. The journal files either don't exist, or are going missing; if some process on the system is trying to clean things up, then it wouldn't surprise me if something is nuking your journal files.
I know this is old question but my experience might be helpful for other reviewers.
Based on my tests, They only let you run a program for 5 minutes (sometimes more than this) before killing it, so it’s fairly useless to install MongoDB unless you have a dedicated IP.

Resources