0

I have RH 3.6 installed and I try to configure it to work with replicaset but something is wrong because it doesn't work:

mongodb://user:password@ip:27017,ip:27017,ip:27017/?readPreference=primary&replicaSet=rsdigital&authSource=userManagement

Does anyone know what's wrong with the format?

Georgy
  • 12,464
  • 7
  • 65
  • 73
  • What do you mean by "doesnt work"? – Nico Haase Jan 24 '19 at 13:09
  • i tried to run the command : – user10952749 Jan 24 '19 at 13:35
  • java -server -jar /home/dsadm/restheart-3.6.0/restheart.jar /home/dsadm/restheart-3.6.0/etc/restheart_replica_dev.yml --fork --envfile /home/dsadm/restheart-3.6.0/etc/replica_dev.properties – user10952749 Jan 24 '19 at 13:36
  • Exception in thread "main" org.restheart.ConfigurationException: wrong parameter mongo-uri at org.restheart.Configuration.(Configuration.java:868) at org.restheart.Bootstrapper.loadConfiguration(Bootstrapper.java:198) at org.restheart.Bootstrapper.main(Bootstrapper.java:145) Caused by: java.lang.IllegalArgumentException: The connection string contains an invalid option 'replicaSet=rsdigital'. 'replicaSet' is missing the value delimiter eg 'replicaSet=value' at com.mongodb.ConnectionString..... – user10952749 Jan 24 '19 at 13:37
  • Please add all information to the question itself, not to the comment section. Additionally, where do these values come from? – Nico Haase Jan 24 '19 at 13:50
  • Hi, you are apparently using the new configuration properties feature that unfortunately has a bug with escaping characters. Please check the below answer by Andrea Di Cesare (https://stackoverflow.com/a/54351223/615095), but the fix is available in release 3.7.0 only (https://github.com/SoftInstigate/restheart/releases/tag/3.7.0). Alternatively, you can edit your yaml configuration file (usually called restheart.yml) to use triple instead of double curly braces. – mturatti Jan 28 '19 at 10:50

1 Answers1

1

You are setting the mongo-uri in the env properties file. The mongo-uri variable in the yml configuration file is defined as {{mongo-uri}}. This way special chars (as the equal sign =) are escaped leading to the error.

Just define the variable as {{{mongo-uri}}} to fix it.

The conf file is being fixed (with triple {{{var}}} declarations) in upcoming RESTHeart version 3.6.3

More information on https://github.com/SoftInstigate/restheart/issues/327

Andrea Di Cesare
  • 1,125
  • 6
  • 11