-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agents are connecting to localhost instead of my server URL #8
Comments
Hi @ShubhamAgarwal1616! |
what we have to provide in userdata in plugin configuration. I could not figure that out. Also i am new to this thing and using an ubuntu ami image. i have installed agent as mentioned in this link https://docs.gocd.org/current/installation/install/agent/linux.html, but i could not find out how to disable auto start of an gocd agent. can you plz help me out there? i created my ami after other than that i manually created a ec2 instance from my ami and when i am running so i do not think my service is autostarting?? but still when an agent comes up it tries to connect to localhost. |
One suggestion, you say the elastic vm starts just that it tries to connect to localhost, why don’t you check the userdata for the vm in ec2? Either you didn’t follow the instructions correctly or you have some misconfiguration somewhere. I’ve only started with GoCD recently too, so I’m no expert but I would check you have set the siteUrl correctly, I believe that is what the plugin uses to auto configure the agents. |
i checked my user data of instance that are coming up as agent and i found the issue. the problem with this is that in gocd version 20.2.0 they have removed the support for 8154 port and so by default their wrapper-properties.conf file contains 2020-04-24 11:21:38 ERROR [scheduler-1] SslInfrastructureService:173 - Error occurred during agent registration process: Elastic agents must submit both elasticAgentId and elasticPluginId.
my server is running behind a load balancer and there in no 8154 port configured there as GOCD version 20.2.0 do not support it. Is there a way i can configure plugin for the updated version??? |
Hello @ShubhamAgarwal1616, |
Humm... I have your same setup and I did not have to recompile for that.. what I did is during the AMI creation process for the agent, one of my tasks (I use ansible+packer to prepare it) updates the
Hope it helps! |
hey thanks @joelsdc for help. I fixed that url issue by using sed command in plugin userdata but i found out that agent and host name are also not being properly set in my /var/lib/go-agent/config/autoregister.properties. I think that is because plugin is using- commands to set them and my ec2 instance does not have ec2-metadata command instead of it it has a command ec2metadata. I used aws ubuntu ami as the base ami for creation of my ami. Do i have to change my ami? or there is something else i can do? i resolved this error by renaming my ec2metadata file in bin to ec2-metadata and then creating an ami. Please let me know if there is a better way to do it. |
Hi @ShubhamAgarwal1616, yeah, I remember doing that too... the only problem I was not able to solve without a patch was the "auto add to environment" so the Agent could pick up pipelines (#6) (now it does apply haha) Cheers ;) |
Finally it worked after all those changes. Thank you everyone for your help |
I am trying to set up this plugin on GOCD version 20.2.0. I have provided my server URL in the elastic agent configuration under go_server_url key. Still, my ec2 agents are trying to connect to the localhost URL.
The text was updated successfully, but these errors were encountered: