Installation of Apinizer with Openshift 3.11
This document describes how to install Apinizer on Openshift 3.11 platform.
Please be sure to review the topology examples and review installing MongoDB and Elasticsearch applications separately from Openshift servers.
- Replicaset MongoDB will be installed as version 4.2.0.
- Elasticsearch will be installed as version 7.9.2.
#1) Operating System Configurations (All Servers)
POWERSHELL
|
#2) Docker Installation
#2.1) Container Installation (Will be Done on All Openshift Servers)
Before proceeding to Kubernetes installation, the following steps are followed to prepare the system and install Docker.
POWERSHELL
sysctl settings
POWERSHELL
The first three lines here are mandatory, and the others can be changed according to the need.
YML
Docker installation is done with the following codes.
POWERSHELL
Docker service is started along with the final settings.
POWERSHELL
|
#2.2) Kubernetes Installation (On Master)
POWERSHELL
|
#2.2.1) Bash Auto-Completion (Optional, On Any Openshift Master Server)
This process can speed up the writing of Openshift commands.
POWERSHELL
|
#2.2.2) Setting User Configuration of Kubectl Command on Openshift Master Server (On Openshift Master Servers)
Definitions are made for the user who will run the kubectl commands
POWERSHELL
|
#2.2.3) Install Kubernetes Network Plugin (On Openshift Master Servers)
In this guide, we will use the Flannel network add-on. You can choose other supported network add-ons. Flannel is a simple and easy way to configure a layer 3 network architecture for Kubernetes.
POWERSHELL
Important If you did not use the value 10.244.0.0/16 as podCIDR while initializing the Master, you should download the above yaml file and edit the network settings here as well. |
#2.2.4) Installation Check (On Any Openshift Master Server )
If the Node created in addition to the Master can be seen when the following code is run on the Master, the installation has been completed successfully.
If it does not transition from NotReady to Ready status within two minutes, the problem should be investigated with the command 'kubectl describe node NODENAME'.
BASH
|
#2.2.5) Defining Openshift Permissions (On Openshift Master Servers)
By default, Openshift deploys with at least one RBAC configuration to protect your cluster data. Currently, Dashboard only supports login with Bearer Token. Follow the steps below in order.
vi service.yaml
YML
vi adminuser.yaml
YML
POWERSHELL
|
#2.3) DNS Test (Optional, On Any Openshift Master Server)
POWERSHELL
|
#3) MongoDB Installation
#3.1) Operating System Configuration and Installation of MongoDB Application (On All MongoDB Servers)
POWERSHELL
|
#3.2) MongoDB Configurations (On All MongoDB Servers)
Edit the configuration file:
POWERSHELL
Then, the MongoDB application is started.
POWERSHELL
|
#3.3) ReplicaSet Configuration and Authorization User Definition (MongoDB Primary Master Server)
Activating Replicaset
POWERSHELL
Creating an authorized user for Apinizer application.
POWERSHELL
If you want to change the password
POWERSHELL
POWERSHELL
Authorize a user on the previously created MongoDB using the following command lines.
POWERSHELL
|
#3.4) MongoDB ReplicaSet Installation on Multiple Servers (On MongoDB Slave Servers)
After the MongoDB installation, the keys folder created on the main node is moved to all nodes and the same permissions are given.
BASH
Copy the mongo-key file to all secondary nodes (mongoDb02, mongoDb03) in the location /home/apinizer/mongo-key On Node 1 => mongoDb01
YML
After restarting the mongod services, the Secondary servers connect from Primary.
BASH
|
#4) Elasticsearch Installation
#4.1) Operating System Configuration and Installation of Elasticsearch Application (On All Elasticsearch Servers)
BASH
|
#4.2) Elasticsearch Installation (On All Elasticsearch Servers)
BASH
|
#4.3) Setting Elasticsearch Parameters According to the Environment (On All Elasticsearch Servers)
The following parameters must be adjusted and added according to your environment.
- cluster.initial_master_nodes
- network.host
- node.name
BASH
Important Here, the path.data address should be given as the address of the disk in the system where your log file is added.
YML
|
You can set the JVM (Java Virtual Machine) values and other JVM parameters used by Elasticsearch as follows.
BASH
Important Here, it can be up to half of the amount of RAM the operating system has and this value should not exceed 32GB
YML
|
#4.4) Setting Elasticsearch as Linux Service (On All Elasticsearch Servers)
sudo vi /opt/elasticsearch/elasticsearch-7.9.2/bin/elasticsearch-service.sh
#!/bin/sh
SERVICE_NAME=elasticsearch
PATH_TO_APP="/opt/elasticsearch/elasticsearch-7.9.2/bin/$SERVICE_NAME"
PID_PATH_NAME="/opt/elasticsearch/elasticsearch-7.9.2/bin/$SERVICE_NAME.pid"
SCRIPTNAME=elasticsearch-service.sh
ES_USER=$SERVICE_NAME
ES_GROUP=$SERVICE_NAME
case $1 in
start)
echo "Starting $SERVICE_NAME ..."
if [ ! -f $PID_PATH_NAME ]; then
mkdir $(dirname $PID_PATH_NAME) > /dev/null 2>&1 || true
chown $ES_USER $(dirname $PID_PATH_NAME)
$SUDO $PATH_TO_APP -d -p $PID_PATH_NAME
echo "Return code: $?"
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is already running ..."
fi
;;
stop)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stopping ..."
kill -15 $PID;
echo "$SERVICE_NAME stopped ..."
rm $PID_PATH_NAME
else
echo "$SERVICE_NAME is not running ..."
fi
;;
restart)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stopping ...";
kill -15 $PID;
sleep 1;
echo "$SERVICE_NAME stopped ...";
rm -rf $PID_PATH_NAME
echo "$SERVICE_NAME starting ..."
mkdir $(dirname $PID_PATH_NAME) > /dev/null 2>&1 || true
chown $ES_USER $(dirname $PID_PATH_NAME)
$SUDO $PATH_TO_APP -d -p $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is not running ..."
fi
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
exit 3
;;
esac
BASH
BASH
BASH
|
You can use the following link for a compatible Kibana version
POWERSHELL
|
#5) Apinizer Installation
Refer to → Apinizer Installation and Configuration for Apinizer Installation.