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 on the local machine. If you are not using the ConnectPlaza Reverse Gateway check your main firewall as well. The machine where the ConnectAgent is installed must have a connection with the internet via port 80 and port 443, the normal HTTP ports.

You can perform a test with telnet to check if your machine is can access the internet. Start telnet and try to connect to a 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 the selected 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 or create one.
  • 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 ++++++++++
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
wrapper home : /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw
configuration: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-12.14
OS   : Linux/3.10.0-1160.15.2.el7.x86_64/amd64
JVM  : AdoptOpenJDK/11.0.10//usr/lib/jvm/adoptopenjdk-11-hotspot/64
************* INSTALLING connectAgentUpdater ***********************

Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
WARNING: created daemon script: /etc/rc.d/init.d/connectAgentUpdater
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc3.d/S20connectAgentUpdater
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc4.d/S20connectAgentUpdater
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc2.d/S20connectAgentUpdater
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc5.d/S20connectAgentUpdater
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc1.d/K20connectAgentUpdater
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc6.d/K20connectAgentUpdater
Mar 10, 2021 3:55:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: created link : /etc/rc0.d/K20connectAgentUpdater
Service connectAgentUpdater installed

The service has been created. A script file for starting / stopping the service 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 at 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/version.xml

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

Starting / stopping the connectAgent service

Start the service with the next command:

# service connectAgentUpdater start
Starting connectAgentUpdater ...
YAJSW: yajsw-stable-12.14
OS   : Linux/3.10.0-1160.15.2.el7.x86_64/amd64
JVM  : AdoptOpenJDK/11.0.10//usr/lib/jvm/adoptopenjdk-11-hotspot/64
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/./lib/extended/groovy/groovy-2.5.7.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mar 10, 2021 3:57:28 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
************* STARTING connectAgentUpdater ***********************

Mar 10, 2021 3:57:29 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Mar 10, 2021 3:57:29 PM org.rzo.yajsw.os.posix.PosixService startProcess
INFO: calling /bin/java -Dwrapper.pidfile=/opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid -Dwrapper.service=true -Dwrapper.visible=false -Djna_tmpdir=/opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/../../temp/yajsw-updater -Dwrapper_home=/opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw -Dwrapper.working.dir=/opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/.. -jar /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/wrapper.jar -c /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
Mar 10, 2021 3:57:29 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Mar 10, 2021 3:57:31 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Mar 10, 2021 3:57:31 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.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-stable-12.14
OS   : Linux/3.10.0-1160.15.2.el7.x86_64/amd64
JVM  : AdoptOpenJDK/11.0.10//usr/lib/jvm/adoptopenjdk-11-hotspot/64
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/./lib/extended/groovy/groovy-2.5.7.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mar 10, 2021 3:58:11 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
************* STOPPING connectAgentUpdater ***********************

Mar 10, 2021 3:58:11 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Mar 10, 2021 3:58:11 PM org.rzo.yajsw.os.posix.PosixService stopProcess
INFO: stop daemon with pid 3027
Mar 10, 2021 3:58:18 PM org.rzo.yajsw.os.posix.PosixService getAppPid
INFO: app pid file: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.java.connectAgentUpdater.pid
Mar 10, 2021 3:58:18 PM org.rzo.yajsw.os.posix.PosixService stopProcess
INFO: stop daemon app with pid -1
Mar 10, 2021 3:58:18 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.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-stable-12.14
OS   : Linux/3.10.0-1160.15.2.el7.x86_64/amd64
JVM  : AdoptOpenJDK/11.0.10//usr/lib/jvm/adoptopenjdk-11-hotspot/64
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/./lib/extended/groovy/groovy-2.5.7.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mar 10, 2021 3:58:59 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
Mar 10, 2021 3:58:59 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.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 ++++++++++
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
wrapper home : /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw
configuration: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-12.14
OS   : Linux/3.10.0-1160.15.2.el7.x86_64/amd64
JVM  : AdoptOpenJDK/11.0.10//usr/lib/jvm/adoptopenjdk-11-hotspot/64
Mar 10, 2021 3:59:38 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
Mar 10, 2021 3:59:38 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.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

Follow the next steps to uninstall the ConnectAgent.

  • Go to the directory <ConnectPlaza installation directory>/bin
  • Stop the ConnectAgent with:
    ./stopAgentService.sh​
  • Uninstall the service
# ./uninstallAgentService.sh
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
wrapper home : /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw
configuration: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/yajsw/conf/wrapper.conf
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-12.14
OS   : Linux/3.10.0-1160.15.2.el7.x86_64/amd64
JVM  : AdoptOpenJDK/11.0.10//usr/lib/jvm/adoptopenjdk-11-hotspot/64
Mar 10, 2021 4:00:34 PM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/init.d/connectAgentUpdater already exists
************* REMOVING connectAgentUpdater ***********************

Mar 10, 2021 4:00:37 PM org.rzo.yajsw.os.posix.PosixService stop
INFO: Stopping connectAgentUpdater ...
YAJSW: yajsw-stable-12.14
OS   : Linux/3.10.0-1160.15.2.el7.x86_64/amd64
JVM  : AdoptOpenJDK/11.0.10//usr/lib/jvm/adoptopenjdk-11-hotspot/64
************* STOPPING connectAgentUpdater ***********************

Service connectAgentUpdater stopped

Mar 10, 2021 4:00:37 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.0/myesb-connect-wrapper/wrapper.connectAgentUpdater.pid
Mar 10, 2021 4:00:37 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent-test-4.1.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/.

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

 

Modifying the Connectplaza agent configuration file

We have to make some changes in the ConnectPlaza configuration file. Mainly because some port numbers will overlap and the ConnectAgent will not start. We will modify the following configuration file.

  • conf/connectplaza-agent.properties

connectplaza-agent.properties

 

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

Creating 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