7 Replies Latest reply on Feb 8, 2013 9:10 AM by Lukas Krejci

    Can I run RHQ Server and Agent in Same Computer

    Arun Raj Expert

      Hi Developers,

       

         Please Answer my following three questions :

       

         1 )     Can I run RHQ Server and Agent in my PC???

       

         2 )     If I can run it means, How many Clients can be installed ? ? ?

       

         3 )     If I am running Clients and Server in the same machine, Is that possible to for agent to pulling or updating plugins from server ?

       

      please share your knowledge with me

        • 1. Re: Can I run RHQ Server and Agent in Same Computer
          Lukas Krejci Apprentice

          An RHQ server is usually on a standalone machine. An agent is meant to monitor and manage a single machine. Our model is centered around the inventory of resources that represent the software running on individual machines. Each such machine is represented in the inventory by a "platform" resource that is the parent of all other resources that represent the software running on that machine. A single agent is installed on a machine and manages the whole platform.

           

          So to answer your questions:

           

          1) Can I run RHQ Server and Agent in my PC???

          You certainly can. It is actually what all the developers do when coding on RHQ

           

          2) If I can run it means, How many Clients can be installed ? ? ?

          If by "Client" you mean Agent, you usually only run one per machine. There's nothing that would prevent you from running multiple though, as long as you set the agents up to be called a different name and use a different port (you may have to make them use a different preferences name using the -p option. This will make sure that they won't overwrite the configurations of each other). Just be aware of the fact that all the agents running on a single machine manage and monitor the same underlying software so a change made through one such agent will be reflected in resources managed by the rest of the agents running on that box, too.

           

          3) If I am running Clients and Server in the same machine, Is that possible to for agent to pulling or updating plugins from server ?

          Again if by "Client" you mean "Agent" then the answer is yes. This is the standard functionality of agents and is independent of their "location".

          • 2. Re: Can I run RHQ Server and Agent in Same Computer
            udayatom Newbie

            Hello lukas, your answer is very helping me too...

             

             

              my problem is, i installed two agents in my system.. , so when i start, the agent displays error

             

             

            > The server has rejected the agent registration request. Cause: [org.rhq.core.clientapi.server.core.AgentRegistrationException:The agent asking for registration under the name [udayatom] is attempting to take another agent's address/port [192.168.60.55:16163] with an unknown security token. This request will fail.]

            The agent cannot register with the server. Admin intervention needed!

             

             

            How can i reslolve

            • 3. Re: Can I run RHQ Server and Agent in Same Computer
              Arun Raj Expert

              Hi Lukas Krejci,

               

                  Thank you so much for your clarification. It is really helps me to develop and customize my own plugin.

               

                  I am extremely sorry, I meant AGENT only. You understood perfectly. 

               

                  Can you share me any tutorial to study about this environment for developing my own plugin?

              • 4. Re: Can I run RHQ Server and Agent in Same Computer
                Lukas Krejci Apprentice

                You need to configure each of you agents to use different preferences location (we use the standard java preferences for storing our runtime configuration). So for example, you'd set up your first agent like:

                $<install-dir-of-the-first-agent>/bin/rhq-agent.sh -p agent1 -s

                 

                And these would be the values, you'd enter:

                Agent Name [localhost.localdomain] : agent1

                Agent Hostname or IP Address [!*] :

                Agent Port [16163] : 16163

                RHQ Server Hostname or IP Address [127.0.0.1] : <hostname of RHQ server>

                RHQ Server Port [7080] :

                The setup has been completed for the preferences at node [/rhq-agent/agent1].

                The agent will now wait until it has registered with the server...

                 

                For the second agent, you'd do:

                $<install-dir-of-the-second-agent>/bin/rhq-agent.sh -p agent2 -s

                 

                And these would be the values, you'd enter:

                Agent Name [localhost.localdomain] : agent2

                Agent Hostname or IP Address [!*] :

                Agent Port [16163] : 16164

                RHQ Server Hostname or IP Address [127.0.0.1] : <hostname of RHQ server>

                RHQ Server Port [7080] :

                The setup has been completed for the preferences at node [/rhq-agent/agent2].

                The agent will now wait until it has registered with the server...

                 

                 

                The agents should then be independent and communicate with the RHQ server correctly. You need to remember to specify the same "-p" option for the agents when you restart them though.

                 

                To explain the error you are getting, this means that you configured the 2 agents to use the same IP address and port but called a different name. This is of course illegal because the two agents could impersonate each other. If that IP and port would actually be a public address for agents behind some kind of firewall or NAT, each such agent could actually be on a different machine, yet server wouldn't have a way of addressing them separately. So to recover from your situation, you need to reconfigure the second agent to use a different and and at least a port than the first agent.

                • 7. Re: Can I run RHQ Server and Agent in Same Computer
                  Lukas Krejci Apprentice

                  I think the easiset way for you would be to try and use the standalone container - which is kind of a testing environment to which you can deploy your plugin and give it commands directly without having to set up the RHQ agent or server. There's a video Heiko did: http://vimeo.com/18624567