Installing the ConnectAgent on CentOS / RedHat

Installing the ConnectAgent on CentOS / RedHat

Installing on Linux CentOS / Red Hat

This installation has to be performed with root rights.

Before you can begin your installation check if your SELINUX is disabled. Check if the configuration  of SELINUX is disabled.

  • Open the file /etc/selinux/config
  • Check if the option SELINUX is disabled
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
  • Restart the machine if SELINUX was not disabled

Check your firewall setting at the local machine, and if you are not using the ConnectPlaza Reverse Gateway check your main firewall as well, click this link for more information about firewalls.

You can perform a test with telnet to check if your machine is accessible from the outside. Start telnet on a separate outside network and try to connect to the machine and port number. See example below.

# telnet www.nu.nl 80
Trying 62.69.166.254...
Connected to nu.nl.
Escape character is '^]'.

If you get above result, you can connect to your server at the selected port.

  • Copy the agent.zip to the installation directory. We use /opt/ to install our agent. If you have more than one agent running on the machine, select a free directory.
  • Unzip the agent.zip file. You will end up with a connectplaza-agent directory
# cd /opt
# unzip agent.zip
# ll

-rw-r--r--   1 root root 121149649 Nov  2 16:19 agent.zip
drwxr-xr-x  11 root root      4096 Nov  1 17:08 connectplaza-agent
drwxr-xr-x.  4 root root      4096 Nov  3 09:32 install
drwxr-xr-x.  2 root root      4096 Mar 26  2015 rh
  • Set the execute rights to .sh files
# cd /opt/connectplaza-agent
# find . -name *.sh -type f -exec chmod +x {} \;

Installing the connectAgent as a Linux service

If you have installed the connectAgent and set all the execution rights to the scripts, you are able to install the connectAgent as a Linux service. To install the connectAgent service run the script below.

# cd bin
# ./installAgentAsAService.sh
++++++++++ YAJSW SET ENV ++++++++++
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
wrapper home : /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw
configuration: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-beta-12.04
OS   : Linux/3.10.0-957.21.3.el7.x86_64/amd64
JVM  : Oracle Corporation/1.8.0_192//usr/java/jdk1.8.0_192-amd64/jre/64
Jun 26, 2019 11:43:06 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
************* INSTALLING connectAgentUpdater ***********************

Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
WARNING: created daemon script: /etc/rc.d/init.d/connectAgentUpdater
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc3.d/S20connectAgentUpdater
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc4.d/S20connectAgentUpdater
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc2.d/S20connectAgentUpdater
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc5.d/S20connectAgentUpdater
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc1.d/K20connectAgentUpdater
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc6.d/K20connectAgentUpdater
Jun 26, 2019 11:43:07 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc0.d/K20connectAgentUpdater
Service connectAgentUpdater installed

The service has been created. The file has been placed in the /etc/init.d directory as service connectAgentUpdater.

service connectAgentUpdater start|stop|restart|status

Starting / Stopping the ConnectAgent

You can start the ConnectAgent via a terminal session or via the Linux service

Starting / stopping with the startup script

Starting the ConnectAgent via the startup script is ideal for testing purposes. Start the ConnectAgent with the following command.

# cd /opt/connectplaza-agent
# ./bin/runAgent.sh

When the service is started you will see the following lines a the end of the log.

 .11:38:25.111 [waitForStartUp] INFO  c.o.myesb.agent.MyESBAdapterExtender - Agent startup complete.
 Absolute path version.xml : /opt/connectplaza-agent-3.5.0/version.xml

Stopping the agent can be archieved by pressing <CTRL-C>.

Starting / stopping the connectAgent service

Start the service with the next command:

# service connectAgentUpdater start
Starting connectAgentUpdater ...
YAJSW: yajsw-beta-12.04
OS   : Linux/3.10.0-957.21.3.el7.x86_64/amd64
JVM  : Oracle Corporation/1.8.0_192//usr/java/jdk1.8.0_192-amd64/jre/64
Jun 26, 2019 11:44:17 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
Jun 26, 2019 11:44:17 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
************* STARTING connectAgentUpdater ***********************

Jun 26, 2019 11:44:17 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Jun 26, 2019 11:44:17 PM org.rzo.yajsw.os.posix.PosixService startProcess
INFO: calling /bin/java -Dwrapper.pidfile=/opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid -Dwrapper.service=true -Dwrapper.visible=false -Djna_tmpdir=/opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw/../../temp/yajsw-updater -Dwrapper_home=/opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw -Dwrapper.working.dir=/opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw/.. -jar /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw/wrapper.jar -c /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
Jun 26, 2019 11:44:17 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Jun 26, 2019 11:44:19 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Jun 26, 2019 11:44:19 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Service connectAgentUpdater started

It can take a while for the agent to start up. Check in the log files at <ConnectPlaza Install Directory>/logs/connectplaza-agent.log, to check if the agent is fully started.

Stop the service with the following command.

# service connectAgentUpdater stop
Stopping connectAgentUpdater ...
YAJSW: yajsw-beta-12.04
OS   : Linux/3.10.0-957.21.3.el7.x86_64/amd64
JVM  : Oracle Corporation/1.8.0_192//usr/java/jdk1.8.0_192-amd64/jre/64
Jun 26, 2019 11:47:14 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
Jun 26, 2019 11:47:14 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
************* STOPPING connectAgentUpdater ***********************

Jun 26, 2019 11:47:14 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Jun 26, 2019 11:47:14 PM org.rzo.yajsw.os.posix.PosixService stopProcess
INFO: stop daemon with pid 14462
Jun 26, 2019 11:47:23 PM org.rzo.yajsw.os.posix.PosixService getAppPid
INFO: app pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.java.connectAgentUpdater.pid
Jun 26, 2019 11:47:23 PM org.rzo.yajsw.os.posix.PosixService stopProcess
INFO: stop daemon app with pid -1
Jun 26, 2019 11:47:23 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Service connectAgentUpdater stopped

Getting the status of the connectAgent service

There are two ways to get the status of the connectAgent service.

You can check the service using the status option of the service command. The service will provide you with extra information about the connectAgentUpdater service.

# service connectAgentUpdater status
YAJSW: yajsw-beta-12.04
OS   : Linux/3.10.0-957.21.3.el7.x86_64/amd64
JVM  : Oracle Corporation/1.8.0_192//usr/java/jdk1.8.0_192-amd64/jre/64
Jun 26, 2019 11:45:36 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
Jun 26, 2019 11:45:37 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
Jun 26, 2019 11:45:37 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid

If you want some more information about the connectAgent, you can run the queryDaemon.shcommand in the <ConnectPlaza Install Directory>/bin/ directory

# ./queryDaemon.sh
++++++++++ YAJSW SET ENV ++++++++++
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
wrapper home : /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw
configuration: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-beta-12.04
OS   : Linux/3.10.0-957.21.3.el7.x86_64/amd64
JVM  : Oracle Corporation/1.8.0_192//usr/java/jdk1.8.0_192-amd64/jre/64
Jun 26, 2019 11:46:27 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
Jun 26, 2019 11:46:28 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
Jun 26, 2019 11:46:28 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Name        : connectAgentUpdater
Installed   : true
Running     : true
Interactive : false
Automatic   : false
Manual      : false
Disabled    : false
Paused      : false
Unknown      : false

Above information will be presented to you.

Uninstalling the connectAgent service

Uninstalling the agent is very simple. Follow the next steps to uninstall the ConnectAgent.

  • Stop the ConnectAgent
  • Go to the directory bin
  • Run the uninstaller
# cd /opt/connectplaza-agent/bin
# ./uninstallAgentService.sh
++++++++++ YAJSW SET ENV ++++++++++
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
wrapper home : /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw
configuration: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-beta-12.04
OS   : Linux/3.10.0-957.21.3.el7.x86_64/amd64
JVM  : Oracle Corporation/1.8.0_192//usr/java/jdk1.8.0_192-amd64/jre/64
Jun 26, 2019 11:47:50 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
Jun 26, 2019 11:47:51 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
************* REMOVING connectAgentUpdater ***********************

Jun 26, 2019 11:47:53 PM org.rzo.yajsw.os.posix.PosixService stop
INFO: Stopping connectAgentUpdater ...
YAJSW: yajsw-beta-12.04
OS   : Linux/3.10.0-957.21.3.el7.x86_64/amd64
JVM  : Oracle Corporation/1.8.0_192//usr/java/jdk1.8.0_192-amd64/jre/64
************* STOPPING connectAgentUpdater ***********************

Service connectAgentUpdater stopped

Jun 26, 2019 11:47:53 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Jun 26, 2019 11:47:53 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-3.5.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Service connectAgentUpdater removed

Installing multiple connectAgents on a single server

Installing multiple ConnectAgents on a single server is possible, but requires some post configuration by the installer before starting the ConnectAgent. Mainly because port number will overlap. After all port numbers have been modified, we have to add a new service for Linux.

Installing the second ConnectAgent

Register a new end-user and download the agent.zip file. Place the agent.zip file in a predefined directory where you can unzip the agent.zip file.

For instance, we place the file in the predefined directory /opt/secondagent/. Check the next example.

# cd /opt/secondagent
# unzip agent.zip
# cd connectplaza-agent
# find . -name *.sh -type f -exec chmod +x {} \;

 

Modifying the configuration files

Now it is time to edit the configuration files. There are a few configurations we have to edit. Mainly because port numbers will overlap and the ConnectAgent will nog start. We will modify the following configuration files.

  • conf/connectplaza-agent.properties

  • myesb-connect-wrapper/yajsw/conf/wrapper.conf

connectplaza-agent.properties

 

String Change
connect.mbean.server.connector.url=service:jmx.jmxmp://localhost:9876 Uncomment this line and change the port number

 

 

wrapper.conf (myesb-connect-wrapper)

 

String

Change

wrapper.app.parameter.4 = 15004

Change port number

wrapper.jmx.rmi.port = 1099 Change portnumber

Configuring a second service script

Because you cannot install the second ConnectAgent as a service with the install script we have to create one manually. You can do this with the next procedure.

  • Go to the directory /etc/init.d
  • Copy the file connectAgentUpdater to another file i.e. secondConnectAgentUpdater
  • Modify the script to reflect the second ConnectAgent
  • Add the script to the start-up sequence of Linux
# cd /etc/init.d
# cp connectAgentUpdater secondConnectAgentUpdater
# vim secondConnectAgentUpdater
  • Within VIM, use the following commands to modify the script.
:%s/\/opt\/connectplaza-agent\//\/opt\/secondagent\/connectplaza-agent\//g
:%s/wrapper.connectAgentUpdater.pid/wrapper.secondConnectAgentUpdater.pid/g
  • Run the next commands to add the service to the start-up sequence of your Linux machine.
# chkconfig --add secondConnectAgentUpdater
# chkconfig secondConnectAgentUpdater on

Starting the second agent

Start the second ConnectAgent by starting the service.

# service secondConnectAgentUpdater start