[Inspector] Installation
Introduction
The inspector service manages the license handling in ApiOmat. Each service can require a separate license key, which is specified using the license.key property or license_key environmental variable. The license key alone does not contain license information and must be activated first; therefore, the license server responds with an encrypted file to the activation request. The file can be read by the service and license data, like cpu count or active users, can be checked in the service itself.
The central license server is available at https://license.apiomat.com. If the network configuration prevents services from connecting to this URL, a local license service instance can be installed with the other services, which will sync all license data for that company with the central server instance and activate the licenses by its own. The local license service will be available at http://HOSTNAME:2500/license
Prerequisites
-
When using the central license service instance:
-
Make the following URL accessible from ALL services: https://license.apiomat.com
-
In this case, the service should not be installed locally!
-
-
When using a local license service:
-
Open port 2500 in the firewall to other ApiOmat nodes
-
Make the following URL accessible from the local license services: https://license.apiomat.com
-
Installation of Consul is required!
-
System requirements
The following instance configurations are recommended.
|
Size |
CPU |
Memory |
Disk |
Typical Cloud Instance Types |
|
All |
2 core |
1 GB RAM |
500 MB |
AWS: t2.medium |
|
|
|
|
|
Azure: Standard_ B1MS |
Installation
Installation is only necessary if a connection to the central service instance is not possible!
USERNAME, PASSWORD, and TOKEN values are provided per customer from ApiOmat.
# ApiOmat microservices require a Java8 runtime to be installed. If Java8 was not installed before (YAMBAS includes an installation) it has to be installed manually:apt-get install -y software-properties-commonadd-apt-repository -y ppa:webupd8team/javaapt-get updateecho 'oracle-java8-installer shared/accepted-oracle-license-v1-1 select true' | debconf-set-selectionsapt-get install --force-yes -y oracle-java8-installerapt-get install --force-yes -y oracle-java8-set-default# Install the repo keywget -O - https://repo.apiomat.com/yambas/rest/web/Key/LIVE/apiomat.key | sudo apt-key add -# Add the repositoryecho "deb https://<USERNAME>:<PASSWORD>@repo.apiomat.com/yambas/rest/web/Repo/LIVE/deb ./" | sudo tee /etc/apt/sources.list.d/apiomat.list# Update APT and installapt-get updateapt-get install -y aom-instructorservice explorer start# ApiOmat microservices require a Java8 runtime to be installed. If Java8 was not installed before (YAMBAS includes an installation) it has to be installed manually:BASE_URL_8="https://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171"JDK_VERSION=`echo $BASE_URL_8 | rev | cut -d "/" -f1 | rev`PLATFORM="-linux-x64.rpm"wget -c -O \"$JDK_VERSION$PLATFORM\" --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "${BASE_URL_8}${PLATFORM}"yum -y localinstall $JDK_VERSION$PLATFORM# Add the repositoryecho "[apiomat]name=ApiOmatbaseurl=https://<USERNAME>:<PASSWORD>@repo.apiomat.com/yambas/rest/web/Repo/LIVE/rpmgpgcheck=0enabled=1" > /etc/yum.repos.d/apiomat.repo# Installyum -y --nogpgcheck install aom-instructorservice explorer start# ApiOmat microservices require a Java8 runtime to be installed. If Java8 was not installed before (YAMBAS includes an installation) it has to be installed manually:BASE_URL_8="https://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171"JDK_VERSION=`echo $BASE_URL_8 | rev | cut -d "/" -f1 | rev`PLATFORM="-linux-x64.rpm"wget -c -O \"$JDK_VERSION$PLATFORM\" --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "${BASE_URL_8}${PLATFORM}"zypper --non-interactive in $JDK_VERSION$PLATFORM# Add the repositoryzypper addrepo --no-gpgcheck https://repo.apiomat.com/yambas/rest/web/Repo/LIVE/suse?token=<TOKEN> "ApiOmat"# Refresh zypper and installzypper refreshzypper --no-gpg-checks --non-interactive install aom-instructorservice explorer start# Docker logindocker login -u <USERNAME> -p <PASSWORD># Store the following file and execute:docker-compose -f instructor.yml upinspector.yml
version: '3'services: instructor: image: apiomat/instructor:<VERSION> command: --spring.cloud.consul.enabled=false ports: - "8093:8093"# Docker loginkubectl create secret docker-registry regcred \ --docker-server=https://index.docker.io/v1/ \ --docker-username="<USERNAME>" \ --docker-password="<PASSWORD>" \ --docker-email="<MAIL>"# Store the following file and executekubectl apply -f instructor.ymlinspector.yml
# ------------------- Instructor Deployment ------------------- #kind: DeploymentapiVersion: apps/v1beta2metadata: name: instructor labels: app: instructorspec: replicas: 2 selector: matchLabels: app: instructor template: metadata: labels: app: instructor spec: imagePullSecrets: - name: regcred containers: - name: instructor image: apiomat/instructor:<VERSION> command: ["--spring.cloud.consul.enabled=false"] ports: - containerPort: 8093 resources: limits: memory: 4Gi imagePullPolicy: Always securityContext: capabilities: { } privileged: false---# ------------------- Instructor Service ------------------- #kind: ServiceapiVersion: v1metadata: name: instructor labels: app: instructorspec: ports: - name: instructor port: 8093 protocol: TCP targetPort: 8093-
Download and install JAVA JDK 8 (if not done before) https://www.oracle.com/technetwork/java/javase/downloads/index.html
-
Download file: https://repo.apiomat.com/yambas/rest/web/Repo/LIVE/aom-instructor-<VERSION>.zip?token=<TOKEN> and unzip to installation folder
-
Ensure that the path to your installed jdk\bin is set to the system-environment variable 'Path' (java.exe needs to be accessible for windows' system user!)
-
Open administrative console and execute
Instructor-<VERSION>.exe install
Instructor-<VERSION>.exe start
to install as service and start afterwards.
For a removal of the service, execute
Instructor-<VERSION>.exe uninstall
Configuration
Service configuration
The following configuration keys can be used in the main configuration file (%CONFIG_PATH/application.yml ) or as Docker arguments ( e.g. --storage.useMongo=false).
General service configuration possibilities are described at the configurations main page.
|
Key |
Default |
Explanation |
|
license.key |
|
The license key issued for this service; needed for licensed services |
|
license.pubkeyFile |
the resources folder of the service |
Place where the public key file is stored; needed for licensed services |
|
license.serviceURL |
https://license.apiomat.com |
URL to the license service; can be left out when using a license client service and service discovery |
|
license.activationRenewalDays |
10 |
Valid days of each activaton; after this count of days (the latest), a new activation must be created for the license |
|
license.adminOrganizationName |
apiomat |
YAMBAS Organization name which declares members of the ADMIN group |
|
license.pubkeyREST |
true |
Activate REST interface for retrieving public key (GET /license/pubkey) |
|
keychain.dir |
keychain |
Directory where the public and private keys are stored. Keys must not be change after installation and must be the same for all instances! |
|
keychain.id |
aomKeychain |
ID of the used keychain |
|
keychain.password |
secret |
Password to access the keychain |
Logging
Logging is done to a separate logfile:
tail -f /var/log/apiomat/instructor.logdocker logs -f instructorAll logs are written to Event manager.
Next steps
Install futher microservices.