Ubuntu: Measuring Agent Controller manual install
Measuring Agent Controllers are required to connect outbound connected “Measuring Agents” to the Portal Server. Each Measuring Agent Controller can handle many “outbound” connected Measuring Agents.
The advantage of “outbound” connected Measuring Agents is that they do not require an inbound firewall rule. This makes them relatively easy to install without any administrative effort. However, they must be able to open an “outbound” connection to a “Measuring Agent Controller”.
Outbound connected Measuring Agents support all product features and functionalities as inbound connected Measuring Agents, with the only exception that they cannot be a member of a “Cluster Controller”.
Prerequisites
“Measuring Agent Controllers” can be placed at any network location. They can also run on the same machine where the RealLoad Portal Server is running.
“Measuring Agent Controllers” can be installed on any Linux and Windows system.
Install Dependencies
Install haveged
sudo apt-get update
sudo apt-get install haveged
Install SQLite
sudo apt-get update
sudo apt install sqlite
Install OpenJDK 11
Get the Java Installation Kit
wget https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz
Install OpenJDK Java 11
gunzip openjdk-11.0.1_linux-x64_bin.tar.gz
tar -xvf openjdk-11.0.1_linux-x64_bin.tar
rm openjdk-11.0.1_linux-x64_bin.tar
sudo bash
mkdir /opt/OpenJDK
mv jdk-11.0.1 /opt/OpenJDK
cd /opt/OpenJDK
ls -al
chown root -R jdk-11.0.1
chgrp root -R jdk-11.0.1
Execute the following commands (still as sudo bash):
update-alternatives --install "/usr/bin/java" "java" "/opt/OpenJDK/jdk-11.0.1/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/opt/OpenJDK/jdk-11.0.1/bin/javac" 1
update-alternatives --install "/usr/bin/keytool" "keytool" "/opt/OpenJDK/jdk-11.0.1/bin/keytool" 1
update-alternatives --install "/usr/bin/jar" "jar" "/opt/OpenJDK/jdk-11.0.1/bin/jar" 1
update-alternatives --set "java" "/opt/OpenJDK/jdk-11.0.1/bin/java"
update-alternatives --set "javac" "/opt/OpenJDK/jdk-11.0.1/bin/javac"
update-alternatives --set "keytool" "/opt/OpenJDK/jdk-11.0.1/bin/keytool"
update-alternatives --set "jar" "/opt/OpenJDK/jdk-11.0.1/bin/jar"
exit # end sudo bash
Verify the Java 11 installation.
java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
Install the Agent Controller
Create the DKFQS account which is running the Agent Controller
sudo adduser dkfqs # follow the questions, remember or write down the password
Install the Agent Controller
Login with the dkfqs account (SSH) - or - Enter: sudo -u dkfqs bash | OR: Install Samba to get convenient access to /home/dkfqs as Samba dkfqs user
Create the directory /home/dkfqs/agentcontroller (as dkfqs user):
cd /home/dkfqs
mkdir agentcontroller
Create the following sub-directories at /home/dkfqs/agentcontroller (as dkfqs user):
- bin
- config
- db
- internalData
- jks
- log
cd /home/dkfqs/agentcontroller
mkdir bin config db internalData jks log
Copy the following files to the bin directory /home/dkfqs/agentcontroller/bin
- bcpkix-jdk15on-160.jar
- bcprov-jdk15on-160.jar
- bctls-jdk15on-160.jar
- com.dkfqs.agentcontroller.jar
Copy the following file to the db directory /home/dkfqs/agentcontroller/db
- CreateNewReplicationDB.sql
Navigate to /home/dkfqs/agentcontroller/db and create the database (as dkfqs user):
sqlite3 Replication.db < CreateNewReplicationDB.sql
After that delete CreateNewReplicationDB.sql
Copy the following file to the config directory /home/dkfqs/agentcontroller/config
- agentcontroller.properties
Modify the agentcontroller.properties file. Set the following properties:
- ServerName
- ServerDNSName
- HTTPSExternalServerPort
- HTTPSInternalServerPort
- AuthTokenValue
Copy the following file to the jks directory /home/dkfqs/agentcontroller/jks
- dkfqscom.jks
Example: agentcontroller.properties
ServerName=192.168.0.54
ServerDNSName=192.168.0.54
HTTPSExternalServerPort=8095
HTTPSInternalServerPort=8095
HTTPSKeyStoreFile=/home/dkfqs/agentcontroller/jks/dkfqscom.jks
HTTPSKeyStorePassword=topsecret
LogLevel=info
# AuthTokenEnabled: true or false
AuthTokenEnabled=true
# If AuthTokenEnabled is true, but AuthTokenValue is undefined or an empty string, then the (permanent) AuthTokenValue is automatically generated and printed at the log output
AuthTokenValue=aaa
# The internal data directory of the agent controller
InternalDataDirectory=/home/dkfqs/agentcontroller/internalData
# The SQLite DB directory
SQLiteDBDirectory=/home/dkfqs/agentcontroller/db
# Security: IP black list block time in seconds
SecurityIpBlacklistBlockTime=300
# WebSockets security settings | inbound WebSocket connections are initiated by Measuring Agents and by the Portal Server
MaxWebSocketConnectTimeSeconds=43200
MaxInboundWebSocketTrafficPerConnection=10000000000
MaxInboundWebSocketPayloadPerFrame=20000000
MaxInboundWebSocketFramesPerIPTimeFrame=10
MaxInboundWebSocketFramesPerIPLimit=1000
MaxUnwantedWebSocketFramesPerIpTimeFrame=60
MaxUnwantedWebSocketFramesPerIpLimit=10
MaxUnauthorizedWebSocketAccessPerIpTimeFrame=60
MaxUnauthorizedWebSocketAccessPerIpLimit=60
# The max age in seconds for static HTML content
StaticContentMaxAgeTime=7200
Create the Agent Controller Startup Script (as root)
sudo bash # become root
cd /etc/init.d
vi AgentController
Edit - create /etc/init.d/AgentController
#!/bin/sh
# /etc/init.d/AgentController
# install with: update-rc.d AgentController defaults
### BEGIN INIT INFO
# Provides: AgentController
# Required-Start: $local_fs $network $time $syslog
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start AgentController at boot time
# Description: AgentController
### END INIT INFO
case "$1" in
start)
if [ -f /home/dkfqs/agentcontroller/log/AgentController.log ]; then
mv /home/dkfqs/agentcontroller/log/AgentController.log /home/dkfqs/agentcontroller/log/AgentController.log_$(date +"%Y_%m_%d_%H_%M")
fi
sudo -H -u dkfqs bash -c 'CLASSPATH=/home/dkfqs/agentcontroller/bin/bcpkix-jdk15on-160.jar:/home/dkfqs/agentcontroller/bin/bcprov-jdk15on-160.jar:/home/dkfqs/agentcontroller/bin/bctls-jdk15on-160.jar:/home/dkfqs/agentcontroller/bin/com.dkfqs.agentcontroller.jar;export CLASSPATH;nohup java -Xmx2048m -DagentControllerProperties=/home/dkfqs/agentcontroller/config/agentcontroller.properties -Dnashorn.args="--no-deprecation-warning" com.dkfqs.agentcontroller.internal.StartAgentController 1>/home/dkfqs/agentcontroller/log/AgentController.log 2>&1 &'
;;
stop)
PID=`ps -o pid,args -e | grep "StartAgentController" | egrep -v grep | awk '{print $1}'`
if [ ! -z "$PID" ] ; then
echo "AgentController stopped with pid(s) : $PID"
kill -9 ${PID} 1> /dev/null 2>&1
fi
;;
status)
PID=`ps -o pid,args -e | grep "StartAgentController" | egrep -v grep | awk '{print $1}'`
if [ ! -z "$PID" ] ; then
echo "AgentController running with pid(s) : $PID"
else
echo "No AgentController running"
fi
;;
*)
echo "Usage: /etc/init.d/AgentController {start|stop|status}"
exit 1
;;
esac
exit 0
Change owner and file protection of /etc/init.d/AgentController (root at /etc/init.d):
chown root AgentController
chgrp root AgentController
chmod 755 AgentController
Register /etc/init.d/AgentController to be started at system boot (root at /etc/init.d):
update-rc.d AgentController defaults
Reboot the system. Login as dkfqs and check /home/dkfqs/agentcontroller/log/AgentController.log
Registration of Agent Controller(s) in the RealLoad Portal Server
Several agent controllers can be registered in the portal, but only one can be a “Default Agent Controller”. It is also possible to operate the portal without a Default Agent Controller.
Assigning a User Account to an Agent Controller
Each master (main-) user account can only be assigned to one Agent Controller.