eos icon indicating copy to clipboard operation
eos copied to clipboard

make nodeos use mongod.conf to change dbpath

Open murray1337 opened this issue 8 years ago • 1 comments

Currently when trying to use the mongodb plugin, I get this error

2018-10-11T15:47:15.635 thread-0   mongo_db_plugin.cpp:513       handle_mongo_excepti ] mongo exception, mongo init, line 1391, code 15, generic server error

It did work before, but then I did a few tweaks here and there to change the dbpath to save the db on the other HDD.

I figured out, when I run solely mongo in the terminal, I get the a related error --> Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

When I run mongod (daemon) --> ERROR: dbpath (/data/db) does not exist. Create this directory or give existing directory in --dbpath.

In case I run mongod --config /etc/mongod.conf, to use the adjusted config file with specific dbpath, everything works as expected. mongo afterwards as well

When starting nodeos it seems to use the old dbpath and NOT dbpath from /etc/mongod.conf and /etc/mongo.conf, although I ran mongod before with the right path.

The question is how can I make nodeos use mongod --config /etc/mongod.conf? Or how can I change this globally ?

Running Ubuntu 16.04 on DigitalOcean and eos 1.3 with the following config.ini

http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9876
bnet-endpoint = 0.0.0.0:4321

blocks-dir = "/mnt/volume_lon1_01/blocks"

bnet-follow-irreversible = 0
bnet-no-trx = false
bnet-peer-log-format = ["${_name}" ${_ip}:${_port}]
read-mode = read-only
validation-mode = light
mongodb-uri = mongodb://localhost:27017/EOS
mongodb-queue-size = 2048
mongodb-abi-cache-size = 2048
mongodb-block-start = 1
mongodb-store-transactions = 1
mongodb-store-transaction-traces = 1
mongodb-store-action-traces = 1
mongodb-filter-on = *
mongodb-filter-out = eosio:onblock:
mongodb-filter-out = gu2tembqgage::
mongodb-filter-out = blocktwitter::

wasm-runtime = wabt
p2p-max-nodes-per-host = 1
http-validate-host = false
https-client-validate-peers = 1
abi-serializer-max-time-ms = 5000
chain-state-db-size-mb = 32000
reversible-blocks-db-size-mb = 340
contracts-console = false
allowed-connection = any
max-clients = 100
network-version-match = 0
sync-fetch-span = 500
connection-cleanup-period = 30
max-implicit-request = 1500

access-control-allow-origin = *
access-control-allow-headers = *
access-control-allow-credentials = false
verbose-http-errors = true

plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::bnet_plugin
plugin = eosio::http_plugin
plugin = eosio::mongo_db_plugin

murray1337 avatar Oct 11 '18 16:10 murray1337

nodeos does not use mongod.conf and does not ever launch mongod itself. It is your responsibility to match your mongodb-uri = configuration with whatever listen port you have configured in your mongod.conf. If the listen port has changed from 27017, you will need to make the same change in the nodeos config.ini.

jgiszczak avatar Oct 11 '18 20:10 jgiszczak