Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Documentation Errata: Deploy Rocket.Chat without Docker

Open MuhClaren opened this issue 11 years ago • 22 comments

ENVIRONMENT: VPS, non-docker installation on Ubuntu 14.04 clean install, stock kernel 3.13.0-55-generic, mongoDB 3.0.6

WHAT: Error during rs.instantiate()

WHERE: Wiki guide "Deploying Rocket.Chat without Docker", Section 2

WHEN / HOW: After editing /etc/mongod.conf file per instructions, upon executing command rs.instantiate() from mongodb shell, output is as follows:

{ 
"info2" : "no configuration explicitly specified -- making one",
"errmsg" : "exception: bad --replSet config string format is: <'setname'>[<'seedhost1'>,<'seedhost2'>",...]", 
"code" : 13093, "ok" : 0 
}

Incidentally, using either replSet=001-rs or replication: replSetName: "001-rs" results in the error.

SOLUTION: Using replicaSet=001-rs worked for me, resulting in the following output from rs.initiate():

{
    "info2" : "no configuration explicitly specified -- making one",
    "me" : "my_hostname.com:27017",
    "ok" : 1
}

MuhClaren avatar Oct 07 '15 06:10 MuhClaren

@MuhClaren could you please update the referred wiki article and close this issue?

gmsecrieru avatar Oct 09 '15 22:10 gmsecrieru

Of course, my pleasure.

MuhClaren avatar Oct 10 '15 08:10 MuhClaren

mongodb-org version 3.0.7 reintroduves the yaml syntax, so with it you'll want something like

replication: replSetName: "rs01"

MyPod-zz avatar Oct 14 '15 13:10 MyPod-zz

The message now as following:

> rs.initiate()
{
    "info2" : "no configuration explicitly specified -- making one",
    "me" : "ubuntu:27017",
    "ok" : 0,
    "errmsg" : "No host described in new configuration 1 for replica set 001-rs maps to this node",
    "code" : 93
}

Is this correct?

leftstick avatar Oct 15 '15 02:10 leftstick

@leftstick

No that's not correct. I believe you're getting that error because you have your hostname set to "ubuntu", thus the errmsg ""No host described in new configuration 1...".

Try using your FQDN and see if that works. For example, in my setup it is: "me" : "chat.my_domain.com:27017"

Have you edited your /etc/hosts file?

MuhClaren avatar Oct 15 '15 11:10 MuhClaren

Actually, you need to make sure that the anwser of hostname is contained into /etc/hosts and pointing to 127.0.0.1; there's no need to set the hostname to the expected/actual FQDN.

MyPod-zz avatar Oct 15 '15 12:10 MyPod-zz

True. As long as the hostname is mapped in the hosts file so Mongo can resolve it to 127.0.0.1 it should work, unless it's a remote 3rd party mongo provider.

MuhClaren avatar Oct 15 '15 12:10 MuhClaren

Hi I have same problem in ubuntu 14.04 64bit

mongo --help | grep "version:"

MongoDB shell version: 3.0.7

cat /etc/hosts

127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters

Auto-generated hostname. Please do not remove this comment.

xxx.xxx.xxx.xxx MY-REAL.IP-ADDERESS.ORG MY-REAL 127.0.0.1 chat.myrealdoman.org chat

then: hostnamectl set-hostname chat hostname chat

cat /etc/mongod.conf | grep rep #replication: replicaSet=001-rs

service mongod restart stop: Unknown instance: mongod start/running, process 27731

mongo MongoDB shell version: 3.0.7 connecting to: test 2015-10-25T18:49:50.570+0100 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2015-10-25T18:49:50.572+0100 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at connect (src/mongo/shell/mongo.js:179:14) at (connect):1:6 at src/mongo/shell/mongo.js:179 exception: connect failed

my firewall is open.

deleting the "replicaSet=001-rs" from configuration the service can restart. I tried with replSetName: "001-rs" and replicaSet=001-rs with no success. Mongod won't restart

There is something that I can do to solve?

A question the replica is necessary for a simple chat in a server?

maxlinux2000 avatar Oct 25 '15 17:10 maxlinux2000

I have seen replSet = xyz in a few setups. Could you please try that instead of replicaSet or replSetName?

gmsecrieru avatar Oct 25 '15 18:10 gmsecrieru

It still resit me!!

cat /etc/mongod.conf | grep rep #replication: #replicaSet=001-rs #replSetName: "001-rs" #replicaSet=001-rs replicaSet = xyz root@chat:~# root@chat:~# mongo MongoDB shell version: 3.0.7 connecting to: test 2015-10-25T19:09:56.942+0100 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2015-10-25T19:09:56.943+0100 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at connect (src/mongo/shell/mongo.js:179:14) at (connect):1:6 at src/mongo/shell/mongo.js:179 exception: connect failed

maxlinux2000 avatar Oct 25 '15 18:10 maxlinux2000

Not replicaSet, replSet! :)

gmsecrieru avatar Oct 25 '15 18:10 gmsecrieru

no... doesn't works for me

#replicaSet=001-rs #replSetName: "001-rs" #replicaSet=001-rs #replicaSet = xyz replSet = 001-rs

root@chat:~#

:(

maxlinux2000 avatar Oct 25 '15 18:10 maxlinux2000

That looks more like the mongo daemon is not running, try typing mongod and see if it starts then try mongo

emcguinness avatar Oct 25 '15 19:10 emcguinness

No, the daemon won't start with the replica configuration.

Tomorrow I will create a new fresh vps with ubuntu, so I will check again. El 25/10/2015 20:23, "Ed" [email protected] escribió:

That looks more like the mongo daemon is not running, try typing mongod and see if it starts then try mongo

— Reply to this email directly or view it on GitHub https://github.com/RocketChat/Rocket.Chat/issues/1026#issuecomment-150960410 .

maxlinux2000 avatar Oct 25 '15 19:10 maxlinux2000

Ran into the same issue with 3.0.7 on Ubuntu. Running mongod with: mongod --replSet "001-rs" seems to fix it.

dimisdas avatar Oct 25 '15 21:10 dimisdas

At least as far as getting 3.0.7 daemon to start, the following changes to /etc/mongod.conf helped...

net: port: 27017 bindIp: localhost

replication: replSetName: "001-rs"

unquietwiki avatar Oct 28 '15 18:10 unquietwiki

I confirm that it's works.

root@chat:~# mcedit /etc/mongod.conf

root@chat:~# service mongodb restart stop: Unknown instance: mongodb start/running, process 1096 root@chat:~# service mongodb restart mongodb stop/waiting mongodb start/running, process 1123

Only a question: Followinf with the instructions in https://github.com/RocketChat/Rocket.Chat/wiki/Deploy-Rocket.Chat-without-docker

I can read that in my mongodb console is missing this info message:

"info" : "Config now saved locally. Should come online in about a minute.",

it's normal? Please have a loo below.


root@chat:~# mongo MongoDB shell version: 3.0.7 connecting to: test Server has startup warnings: 2015-10-28T21:43:26.599+0100 I CONTROL [initandlisten] 2015-10-28T21:43:26.599+0100 I CONTROL [initandlisten] ** WARNING: You are running in OpenVZ which can cause issues on versions of RHEL older than RHEL6. 2015-10-28T21:43:26.599+0100 I CONTROL [initandlisten]

rs.initiate() { "info2" : "no configuration explicitly specified -- making one", "me" : "chat:27017", "ok" : 1 } 001-rs:OTHER> 001-rs:PRIMARY> exit bye

root@chat:~#

regards MaX

On 10/28/15, unquietwiki [email protected] wrote:

At least as far as getting 3.0.7 daemon to start, the following changes to /etc/mongod.conf helped...

net: port: 27017 bindIp: localhost

replication: replSetName: "001-rs"


Reply to this email directly or view it on GitHub: https://github.com/RocketChat/Rocket.Chat/issues/1026#issuecomment-151951218

ciao, MaX

maxlinux2000 avatar Oct 28 '15 20:10 maxlinux2000

also issue on clean ubuntu, with mongo 3.0.7. when trying to run mongod:

image

ghost avatar Nov 06 '15 15:11 ghost

mkdir -p /data/db

tfl961205 avatar Sep 22 '16 10:09 tfl961205

If you are reading this and you are feeling hopeless. This may help you out:

Assuming that dbpath is : /var/lib/mongodb

1/ You may (or may not ) need to set host name to localhost

hostnamectl set-hostname localhost

Verify using hostname command => localhost

2/ In you /etc/mongod.conf : set bindIP

  net:
    port: 27017

    bindIp: localhost

3/ now stop mongod

4/ Run this command : mongod --port 27017 --dbpath /var/lib/mongodb --replSet "001-rs"

5/ exit; then go to /var/lib/mongodb, set ownership to /var/lib/mongodb

6/ service mongod start => SHOULD be SUCCESS

ghost avatar Nov 27 '17 09:11 ghost