Setup two agents for one fabric

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Setup two agents for one fabric

chaoyang ma
Error 500: Executing action [sync] of controller [org.linkedin.glu.console.controllers.AgentsController] caused exception: org.linkedin.glu.agent.rest.client.RecoverableAgentException: Communication Error (1001) - Connection to https://11.191.35.143:12906 refused
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
anyone know why i got the connection issue?
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
In reply to this post by chaoyang ma
I did agentct1.sh stop and start, it is not working.
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
In reply to this post by chaoyang ma
Currently I have two server, one is the host of server and one agent, the other one is the other agent.
On the first one, all process, console, zookeeper, agent are starting up fine.
On the second one, when running agent-server.sh start, it is not working. Do I need to start a zookeeper on second one as well?
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

frenchyan
Administrator
No you do not have to have another zookeeper.

What command do you use to start the agent (what parameters do you provide) and what do you mean by "not working"?

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
In reply to this post by chaoyang ma
I started it in the bin folder where there are files below:
agent-cli.sh*     console-cli.sh*     setup-agent.sh*      tutorial.sh*       zookeeper-server.sh*
agent-server.sh*  console-server.sh*  setup-zookeeper.sh*  zookeeper-cli.sh*

What I did is

./agent-server.sh start
Loading config [***/agent-server/4.6.2/conf/pre_master_conf.sh]...
Loading config [***/agent-server/4.6.2/conf/master_conf.sh]...
Started org.linkedin.glu.agent-server - PID [15514]


./agent-server.sh stop
Loading config [***/agent-server/4.6.2/conf/pre_master_conf.sh]...
Loading config [***/agent-server/4.6.2/conf/master_conf.sh]...
Status: org.linkedin.glu.agent-server not running - PID [15514] not found.

It is not working: because first I can not see it on the console, secondly when i stop it, it said PID not found.

Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

frenchyan
Administrator
Please check the log files (data/logs) or start the agent in the foreground by issuing

./agent-server -r start

this should give more information on what is wrong.

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
In reply to this post by chaoyang ma
Hi, I got this connection refuse error.

2013/05/23 22:46:47.023 INFO [StateKeeperScriptManager] Restoring state: [scriptDefinition:[mountPoint: /id-system/i2, parent: /, scriptFactory: null, scriptFactoryArgs: [class:org.linkedin.glu.agent.impl.script.FromLocationScriptFactory, location:http://lonrs07852:8080/glu/repository/scripts/fxstream/IDDeployScript.groovy], initParameters: [:]], scriptState:[script:[:], stateMachine:[currentState:running]]]
2013/05/23 22:46:47.139 WARN [ScriptManagerImpl] Error while instantiating script: /id-system/i2: Connection refused [[mountPoint: /id-system/i2, parent: /, scriptFactory: null, scriptFactoryArgs: [class:org.linkedin.glu.agent.impl.script.FromLocationScriptFactory, location:http://lonrs07852:8080/glu/repository/scripts/fxstream/IDDeployScript.groovy], initParameters: [:]]]
Exception in thread "main" org.linkedin.glu.agent.api.ScriptException: /id-system/i2
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:202)
        at org.linkedin.glu.agent.impl.script.ScriptManagerImpl.installScript(ScriptManagerImpl.groovy:157)
        at org.linkedin.glu.agent.impl.script.ScriptManager$installScript.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager.restoreScript(StateKeeperScriptManager.groovy:99)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager.this$2$restoreScript(StateKeeperScriptManager.groovy)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager$this$2$restoreScript.callCurrent(Unknown Source)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager.restoreScript(StateKeeperScriptManager.groovy:84)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager.this$2$restoreScript(StateKeeperScriptManager.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:362)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager$_restoreScripts_closure2.doCall(StateKeeperScriptManager.groovy:62)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
        at groovy.lang.Closure.call(Closure.java:276)
        at groovy.lang.Closure.call(Closure.java:289)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1198)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1174)
        at org.codehaus.groovy.runtime.dgm$109.invoke(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:270)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager.restoreScripts(StateKeeperScriptManager.groovy:61)
        at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager$restoreScripts.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at org.linkedin.glu.agent.impl.AgentImpl.boot(AgentImpl.groovy:113)
        at org.linkedin.glu.agent.impl.AgentImpl$boot.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at org.linkedin.glu.agent.server.AgentMain.start(AgentMain.groovy:486)
        at org.linkedin.glu.agent.server.AgentMain$start$0.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
        at org.linkedin.glu.agent.server.AgentMain.start(AgentMain.groovy:444)
        at org.linkedin.glu.agent.server.AgentMain$start.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
        at org.linkedin.glu.agent.server.AgentMain.startAndWait(AgentMain.groovy:438)
        at org.linkedin.glu.agent.server.AgentMain$startAndWait.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at org.linkedin.glu.agent.server.AgentMain.main(AgentMain.groovy:839)
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:227)
        at sun.net.www.http.HttpClient.New(HttpClient.java:300)
        at sun.net.www.http.HttpClient.New(HttpClient.java:317)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
        at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:662)
        at org.apache.tools.ant.taskdefs.Get$GetThread.get(Get.java:581)
        at org.apache.tools.ant.taskdefs.Get$GetThread.run(Get.java:571)
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

frenchyan
Administrator
which version of glu are you using? which os? which version of java?

Are you sure that the machine you are running your agent on can talk to lonrs07852 on port 8080? Try to do it with curl or wget first to eliminate this from the equation. The agent is simply requesting a url so either it works or it does not.

Also it seems to be a warning (not an error) so it should not prevent your agent to boot (should be the case since glu 5)

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
I knew the reason that agent two get connection refuse. The mount point script got issue.

 WARN [ScriptManagerImpl] Error while instantiating script: /id-system/i2: Connection refused [[mountPoint:/id-system/i2, scriptLocation:http://lonrs07852:8080/glu/repository/scripts/fxstream/IDDeployScript.groovy]

Do you know how to solve this?
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

sodul
That url has to be accessible by the agent, can you curl or wget it from the machine where the agent is running?
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
HI, Thanks, I will check that. btw,  in my uninstall stage, I added  shell.rmdirs("/ecomm/.../10.1.6"), but it is not working. Said clearError in the log. How can I remove a dir during uninstall?
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

sodul
I assume /ecomm is your mount point.
If I remember correctly the shell commands are always relative to the mount point, so if you want to delete 10.1.6 that is next to your mount point you probably want to call shell.rmdirs("../10.1.6"), the triple dots '…' is certainly not a valid directory descriptor anyway.

Note that shell.rmdirs follows symlinks (unless it has changed), so you might want to call:
 base_apps_path = shell.env['glu.agent.scriptRootDir']
 shell.exec("rm -rf '${base_apps_path}10.1.6'")

I do something very similar in my own groovy script.
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
Hi, Thanks, but I did shell.exec("rm -rf '/A/B/C/10.1.6'") in uninstall stage, but the command is not working.
When I put it in install stage, the command is working fine. Donot know why.

And the agent config is still bother me, I do not know why the agent 2 is not working, when I startup agent2, I can see it on the GUI and do "ps" and stuff. but when I deploy, it get the error because the url "http://lonrs07852:8080/glu/repository/scripts/fxstream/IDDeployScript.groovy" is not working. I can not do wget and stuff.

[ScriptManagerImpl] Error while instantiating script: /id-system/i2: Connection refused [[mountPoint:/id-system/i2, scriptLocation:http://lonrs07852:8080/glu/repository/scripts/fxstream/IDDeployScript.groovy]]
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

chaoyang ma
I think the problem here is that,
in the url, it should be the server(lonrs07851) and the port
"http://lonrs07851:8080/glu/repository/scripts/fxstream/IDDeployScript.groovy"

But in my case, it is the agent(lonrs07852)
"http://lonrs07852:8080/glu/repository/scripts/fxstream/IDDeployScript.groovy"

Am I right?

The command I used to startup the agent on lonrs07852 is that
./bin/agent-server.sh -f AAA -n lonrs07852 -z lonrs07851:8080 start
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

sodul
The url has to be for the machine where the script is located, yes. Where your scripts are located has not much to do where your console is, though in your case it seems you are re-using the console to host your script.

I never host my groovy scripts on the Glu Console host but use other tools to exchange them such as artifactory (for a Java shop) or even S3 (for our EC2 instances). In practice you want a the files that the agent will download to be hosted on a server that will provide a fast and reliable download to the agents.
Reply | Threaded
Open this post in threaded view
|

Re: Setup two agents for one fabric

frenchyan
Administrator
In reply to this post by chaoyang ma
If you have used this command to start the agent:

./bin/agent-server.sh -f AAA -n lonrs07852 -z lonrs07851:8080 start

it is certainly wrong. The -z is supposed to point to zookeeper so the port is unlikely to be 8080 (unless you started zookeeper on 8080 but then the web server cannot be running on 8080)

Yan