Quantcast

'Easy Production Setup' only install agents on localhost, not on other machines

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

'Easy Production Setup' only install agents on localhost, not on other machines

xinyi.zhou
I'm trying the 'Easy Production Setup' steps to install the 5.5.1 package.

in my glu-meta-model.json.groovy, defined 3 agentHosts here:
/**
 * Defines the host(s) on which the agent should be installed
 */
def agentHosts = ["localhost", "10.208.10.53", "10.208.10.87", ]


$GLU_HOME/bin/setup.sh -D -o dists models/glu-meta-model.json.groovy

2014/06/05 18:09:34.345 INFO [SetupMain] Generating distributions
2014/06/05 18:09:36.593 INFO [GluPackager] Generated agent package file:/home/pplive/glu/dists/agents/org.linkedin.glu.agent-server-zkc1-5.5.1/ => localhost:12906
2014/06/05 18:09:36.597 INFO [GluPackager] Skipped agent package file:/home/pplive/glu/dists/agents/org.linkedin.glu.agent-server-zkc1-5.5.1/ => 10.208.10.53:12906
2014/06/05 18:09:36.599 INFO [GluPackager] Skipped agent package file:/home/pplive/glu/dists/agents/org.linkedin.glu.agent-server-zkc1-5.5.1/ => 10.208.10.87:12906

not sure why the remote servers got 'Skipped agent package'

only 'cp' commands in 'dists/bin/install-all.sh':
################## Agent ##################
$MKDIR_CMD $MKDIR_OPTIONS "/home/pplive/glu/"
$CP_CMD $CP_OPTIONS "/home/pplive/glu/dists/agents/org.linkedin.glu.agent-server-zkc1-5.5.1" "/home/pplive/glu/"

What should I do, to install glu agents to other remote servers?

Thanks a lot in advance.

Xinyi

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

frenchyan
Administrator
The 'Skipped agent package' message simply says that there is no need to generate a new agent package for the other hosts since the content is the same (and this is what you want).

I am not entirely sure what is happening. Can you please post your glu-meta-model.json.groovy as well as the generated install script?

Thanks
Yan
PS: make sure you obfuscate your keys in the model you post...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

xinyi.zhou
diff glu-meta-model.json.groovy  $GLU_HOME/models/quick-production/glu-meta-model.json.groovy
32c32
< def installPath = '/home/pplive/glu/'
---
> def installPath = '/opt/glu/'
39,62c39
< def keys = [
<   agentKeyStore: [
.......
my key..
......
< ]
---
> def keys = [:]
73c50
< def zooKeeperHost1 = "10.208.10.66"
---
> def zooKeeperHost1 = "localhost"
82c59
< def consoleHost = "10.208.10.66"
---
> def consoleHost = "localhost"
88,90c65,68
< def mysqlHost = "10.208.10.53"
< def mysqlUsername = "zabbix"
< def mysqlPassword = "zabbix"
---
> def mysqlHost = "localhost"
> def mysqlUsername = "glua"
> def mysqlPassword = "password"
> //def mysqlHost = null
95c73
< def agentHosts = ["localhost", "10.208.10.53", "10.208.10.87", ]
---
> def agentHosts = ["localhost", ]


==== the diff of my glu-meta-model.json.groovy and the default one

cat dists/bin/install-all.sh
#!/bin/bash

#
# Copyright (c) 2013 Yan Pujante
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#

if [ -z "$SSH_CMD" ]; then
  SSH_CMD="ssh"
fi

if [ -z "$SCP_CMD" ]; then
  SCP_CMD="scp"
fi

if [ -z "$SCP_OPTIONS" ]; then
  SCP_OPTIONS="-r"
fi

if [ -z "$SCP_USER" ]; then
  SCP_USER=$USER
fi

if [ -z "$CP_CMD" ]; then
  CP_CMD="cp"
fi

if [ -z "$CP_OPTIONS" ]; then
  CP_OPTIONS="-R"
fi

if [ -z "$MKDIR_CMD" ]; then
  MKDIR_CMD="mkdir"
fi

if [ -z "$MKDIR_OPTIONS" ]; then
  MKDIR_OPTIONS="-p"
fi

echo "You may be prompted for the password for user $SCP_USER if you don't use ssh keys."



################## Agent ##################
$MKDIR_CMD $MKDIR_OPTIONS "/home/pplive/glu/"
$CP_CMD $CP_OPTIONS "/home/pplive/glu/dists/agents/org.linkedin.glu.agent-server-zkc1-5.5.1" "/home/pplive/glu/"

########################################

################## Console ##################
$SSH_CMD $SCP_USER@10.208.10.66 "[ -d '/home/pplive/glu/' ] || $MKDIR_CMD $MKDIR_OPTIONS '/home/pplive/glu/' ]"
$SCP_CMD $SCP_OPTIONS "/home/pplive/glu/dists/consoles/org.linkedin.glu.console-server-5.5.1" "$SCP_USER@10.208.10.66:/home/pplive/glu/"

########################################

################## ZooKeeper ##################
$SSH_CMD $SCP_USER@10.208.10.66 "[ -d '/home/pplive/glu/' ] || $MKDIR_CMD $MKDIR_OPTIONS '/home/pplive/glu/' ]"
$SCP_CMD $SCP_OPTIONS "/home/pplive/glu/dists/zookeeper-clusters/zookeeper-cluster-zkc1/org.linkedin.zookeeper-server-2.0.3" "$SCP_USER@10.208.10.66:/home/pplive/glu/"

########################################

################## AgentCli ##################
# manually install /home/pplive/glu/dists/agent-cli/org.linkedin.glu.agent-cli-5.5.1

########################################

################## ConsoleCli ##################
# manually install /home/pplive/glu/dists/console-cli/org.linkedin.glu.console-cli-5.5.1

########################################


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

xinyi.zhou
In reply to this post by frenchyan
i manually scp 'org.linkedin.glu.agent-server-zkc1-5.5.1' directory to remote servers and start the remote agents successfully now.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

xinyi.zhou
In reply to this post by frenchyan
Dear FrenchYan,

I found another problem, when I was trying to run 'Commands' on remote agents, I suppose those commands should be running remotely, but it turns out running on 'console server' locally.

i thought it will return the hostname of 10.208.10.53 'SHBNJ-tools-mongodb-10-53.idc.pplive.cn', but it turn out to be 'SHBNJ-tools-mongodb-10-66.idc.pplive.cn' which is the machine serves console-server.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

frenchyan
Administrator
Your screenshot is too small I cannot read what is on it. That being said, the commands are always running on the agent, not on the console. One of your agent was localhost... are you sure this is not the one you pick? You can verify by looking at the agent details (this is explained in the tutorial: http://pongasoft.github.io/glu/docs/latest/html/tutorial.html#view-the-agent ) that you are talking to the agent that is installed where you think it is installed.

Also as mentioned in this previous post: http://glu.977617.n3.nabble.com/newbie-question-about-agent-and-console-tp4026541p4026542.html once you start having multiple hosts, do not use localhost (or 127.0.0.1). The problem is that for every machine, localhost has a meaning which is different for every other machine.

When you install everything on localhost (like the tutorial does) then localhost means the same thing for everybody so it is not an issue (and localhost was chosen because it makes it easy for having a generic tutorial). But once you split, you should not have localhost anymore in your model. 

Yan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

frenchyan
Administrator
In reply to this post by xinyi.zhou
In regards to the issue with the install script, this seems to be a bug as I can easily reproduce it. I created a ticket for it: https://github.com/pongasoft/glu/issues/264

Yan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

xinyi.zhou
In reply to this post by frenchyan
Thanks for the reply, I will remove 'localhost' and have another try.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'Easy Production Setup' only install agents on localhost, not on other machines

xinyi.zhou
In reply to this post by frenchyan
remove localhost from model fixed my problem, thanks a lot!
Loading...