User Tools

Site Tools


raagent_start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

raagent_start [2016/03/29 12:46] (current)
mark.english created
Line 1: Line 1:
 +==== Starting and Stopping the Linux Agent ====
  
 +Since we want the replicator agent to run all the time we'll want to do a few tasks to ensure
 +that it will be automatically started when the computer is started.
 +
 +First, let's ensure that the replicator agent will run after we've made the necessary configuration changes.
 +This can be done by issuing the following from within the root directory (Perspectium_Replicator-linux)
 +
 +<code bash>
 +bin/agent status <cr>
 +</​code>​
 +
 +This command won't actually start the agent but it will let us know that it's not running which is important. The following is a sample output when the agent is not running:
 +
 +<​code>​
 +Perspectium Replicator Agent is not running.
 +</​code>​
 +
 +Now let's start the agent. Again, from the root directory enter the following command:
 +
 +<code bash>
 +bin/agent start <cr>
 +</​code>​
 +
 +You should see a message similar to the following:
 +
 +<code bash>
 +Starting Perspectium Replicator Agent...
 +Waiting for Perspectium Replicator Agent....
 +running: PID:12345
 +</​code>​
 +
 +What we're expecting is the '​running'​ response and the process ID or PID number as reflected here. For the moment, let's assume all went well and the agent is running. Let's have a look at the agents output which will give us additional support of this assumption. One way to see the latest contents of the log file is by using the tail command. From the root directory issue the following command:
 +
 +<code bash>
 +tail logs/​perspectium.log <cr>
 +</​code>​
 +
 +You should see the last few lines of the log and the date and time stamp should reflect the current time. You can
 +also issue the following command to continuously get the latest log file entries:
 +
 +<code bash>
 +tail -f logs/​perspectium.log
 +</​code>​
 +
 +<WRAP round tip>
 +You can issue a control-c <hold down the control key and hit the c key at the same time> to terminate this command.
 +</​WRAP>​
 +
 +If you see streaming log contents then the agent is running. Hold on a second, just because it's running does not
 +necessarily mean it's working properly. The default replicator agent configuration file is called //​agent.xml//​ and it's within the conf directory. By default, a message sharer has been configured to share the following message:
 +
 +<code bash> ​
 +'This is a simple message that is being echoed.'​
 +</​code>​
 +
 +Furthermore,​ a subscriber has been configured to consume and log the message to the log. You should be able to find 
 +a log entry similar to the following in the log:
 +
 +<code vim>
 +2014-09-08 10:​37:​21.265 example.echo - Received echoed message: This is a simple message that is being echoed.
 +</​code>​
 +
 +One way to determine if this message exchange has been successful is to use the grep command to search the log by
 +issuing the following command:
 +
 +<code bash>
 +grep "​Received echoed message"​ logs/​perspectium.log <cr>
 +</​code>​
 +
 +If the message is returned then the agent is functioning as expected. Assuming that's the case we can now proceed ​
 +with establishing the agent as a service to be started upon system start up.  First, let's stop the agent by issuing the following command:
 +
 +<code bash>
 +bin/agent stop <cr>
 +</​code>​
 +
 +You should see a message similar to the following:
 +
 +<code bash>
 +Stopping Perspectium Replicator Agent...
 +Stopped Perspectium Replicator Agent.
 +</​code>​
 +
 +Enter the following command to install the agent as a service:
 +
 +<code bash>
 +bin/agent install <cr>
 +</​code>​
 +
 +That's it! Please refer to the [[replicator_agent_configuration|Replication Agent configuration]] documentation to further leverage the Perspectium Replicator Agent.
raagent_start.txt ยท Last modified: 2016/03/29 12:46 by mark.english