0

I have problem installing CYGNUS using docker as source, simply i cannot understand where i should map what specific agent.conf.

Image i am using is from here.

When i try to map agent.conf witch have my specific setup to container it starts and run but fail to copy, and not only that any change i made to file inside container wont stay it returns to previous default state.

While i have no issues with grouping_rules.conf using same approach.

I used docker and docker compose both same results. Path on witch i try to copy opt/apache-flume/conf/agent.conf

docker run -v /home/igor/Documents/cygnus/agent.conf:/opt/apache-flume/conf/agent.conf fiware/cygnus-ngsi

Can some who managed to run it using his config tell me if i misunderstood location of agent.conf or something because this is weird, i used many docker images and never had issue where i was not able to copy from my machine to docker container.

Thanks in advance.

** EDIT **

Link of agent.conf

Igor
  • 225
  • 1
  • 9
  • Could you provide the following info: (1) The error that is giving you (2) version of components that you are using and perhaps (3) the agent.conf? Thanks! – Emiliano Viotti Sep 13 '18 at 18:23
  • 1. No error, container runs fine but wont change default agent.config, try with volumes -v mapping and direct changes to container. Version in use: {"success":"true","version":"1.9.0_SNAPSHOT.d492237ae17c2a4df30c3633148f261a2cef1fd6"} – Igor Sep 17 '18 at 12:41
  • Another option that you have is adapt the docker file to your needs and build your own image. – anmunoz Sep 18 '18 at 12:23

1 Answers1

0

Did you copy the agent.conf file to your directory before start the container?

As you can see here, when you define a volume with "-v" option, docker copies the content of the host directory, inside the container directory using the mount point. Therefore, you must first provide the agent.conf file on your host.

The reason is that when using a "bind mounted" directory from the host, you're telling docker that you want to take a file or directory from your host and use it in your container. Docker should not modify those files/directories, unless you explicitly do so. For example, you don't want -v /home/user/:/var/lib/mysql to result in your home-directory being replaced with a MySQL database.

If you do not have access to the agent.conf file, you can download the template in the source code from the official cygnus github repo here. You can also copy it once the docker container is running, using the docker cp option:

docker cp <containerId>:/file/path/within/container /host/path/target

Keep in mind, that you will have to edit the agent.conf file to configure it according to the database you are using. You can find in the official doc how to configure cygnus to use differents sinks like MongoDB, MySQL, etc.

I hope I have been helpful.

Best regards!

Emiliano Viotti
  • 1,619
  • 2
  • 16
  • 30
  • Thanks for your help, but simply not working. This could be easily not cygnus fault but mine way of implementing it. So if u manage to run cygnus using docker i have few questions. First where did u copy agent.conf, did u use cygnus_instance.conf, and what docker image did u use to run it. I want to see what i missed here. – Igor Sep 19 '18 at 10:46