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.
UI Steps |
---|
UI Step |
---|
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 Block |
---|
bin/agent status <cr> |
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 Block |
---|
Perspectium Replicator Agent is not running. |
|
UI Step |
---|
Now let's start the agent. Again, from the root directory enter the following command:
Code Block |
---|
bin/agent start <cr> |
You should see a message similar to the following: Code Block |
---|
Starting Perspectium Replicator Agent...
Waiting for Perspectium Replicator Agent....
running: PID:12345 |
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 Block |
---|
tail logs/perspectium.log <cr> |
|
|
...
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 Block |
---|
tail -f logs/perspectium.log |
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 Block |
---|
'This is a simple message that is being echoed.' |
|
UI Step |
---|
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 Block |
---|
2014-09-08 10:37:21.265 example.echo - Received echoed message: This is a simple message that is being echoed. |
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 Block |
---|
grep "Received echoed message" logs/perspectium.log <cr> |
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 Block |
---|
bin/agent stop <cr> |
You should see a message similar to the following:
Code Block |
---|
Stopping Perspectium Replicator Agent...
Stopped Perspectium Replicator Agent. |
|
UI Step |
---|
Enter the following command to install the agent as a service:
Code Block |
---|
bin/agent install <cr> |
The agent should now be installed. |
|