1

I try to run a Seyren instance locally, and I would like to do it using the dockerized MongoDB image. After I pulled the latest docker image, I run it and expose the 27017 port:

docker run --name mongodb -v /data/db:/data/db -p 27017:27017 -d mongo

Next thing to do is compile the seyren jar file and passing it some variables. docker.local is mapped to the IP of the docker toolbox in /etc/hosts

java -jar seyren-1.3.0.jar GRAPHITE_URL=https://graphiteurl.io MONGO_URL=mongodb://docker.local:27017

But I then got the following errors:

30/03/2016 13:58:02.643 [localhost-startStop-1]

INFO com.seyren.mongo.MongoStore - Ensuring that we have all the indices we need 30/03/2016 13:58:12.661 [localhost-startStop-1]

ERROR com.seyren.mongo.MongoStore - Failure while bootstrapping Mongo indexes. If you've hit this problem it's possible that you have two checks which are named the same and violate an index which we've tried to add. Please correct the problem by removing the clash. If it's something else, please let us know on Github!

com.mongodb.MongoTimeoutException: Timed out after 10000 ms while waiting for a server that matches AnyServerSelector{}. Client view of cluster state is {type=Unknown, servers=[{address=localhost:27017, type=Unknown, state=Connecting, exception={com.mongodb.MongoException$Network: Exception opening the socket}, caused by {java.net.ConnectException: Connection refused}}]

What do I do I miss here?

EDIT:

The thing when I compile the seyren jar file. I indeed have a seyren database which is created in my mongo instance ... So there must be a connection established.

Mornor
  • 3,471
  • 8
  • 31
  • 69
  • Is the MongoDB instance you're starting really listening on *localhost*? More to the point: are you using Docker Toolbox, or similar? Please add the output of `netstat -lntp | grep 27017` (or `lsof -n -i:27017 | grep LISTEN` if you're on a Mac). – ThatsNinja Mar 30 '16 at 12:53
  • Hell. I think you point the main issue. I indeed use docker toolbox. When I run the command in MAC (where I use the docker toolbox) I got nothing. When in my VM (Ubuntu 14.04), the port is listening. Nevertheless, even when the port is listening (VM), it does not work though the seyren database is created in the mongo instance. Also, how can I connect the mongo instance within the Mac (toolbox) – Mornor Mar 30 '16 at 13:04
  • You have to use the ip of the vm running docker host. You can find the ip by running "docker-machine ip default". mongodb would be listening on port 27017 at that IP – lamirap Mar 30 '16 at 13:19
  • Still not able to connect: `Failed to bootstrap Mongo indexes` – Mornor Mar 30 '16 at 13:29

2 Answers2

3

As I understood you are using docker toolbox on Mac. Docker toolbox is running not in your localhost (it's running in instance of VBox virtual machine). And you should to use the IP of this machine instead of localhost. You can get it using docker-machine env command in terminal. IP of DOCKER_HOST env variable will be the IP of your mongoDB instance host.

Cortwave
  • 4,747
  • 2
  • 25
  • 42
  • `docker-machine ip default` will return just the IP of the default Docker Toolbox Docker Machine instance. – ThatsNinja Mar 30 '16 at 17:41
  • I did have do this, but I still have the same error (`Failed to bootstrap Mongo indexes` and `Connection refused`) – Mornor Mar 31 '16 at 07:17
  • 1
    It's seyren issue. You can track it here https://github.com/scobal/seyren/issues/354 – Cortwave Mar 31 '16 at 07:38
  • I checked that. The thing when I compile the seyren jar file. I indeed have a `seyren` database which is created in my mongo instance ... So there is a connection ! – Mornor Mar 31 '16 at 08:31
0

Found the solution. I had to use mongo:2.7 image since this is the only workable one.

Mornor
  • 3,471
  • 8
  • 31
  • 69