Insights installation
Reading time: 20 minutes
0. Please make sure your system matches the prerequisites.
Please go through Installation Prerequisites before performing the installation.
1. Install Management Software
Update operating system
sudo yum -y update
Install vim to be able to change configuration files.
sudo yum -y install vim
2. Disable SELINUX
Change configuration of SELinux to disabled by following command.
sudo sed -i -e 's/^SELINUX\s*=.*$/SELINUX=disabled/g' /etc/selinux/config
Reboot server
sudo reboot now
Check the status of SELINUX with following command to verify it is disabled
sestatus
3. Install Docker
Please follow the official Docker documentation (based on your host systems these may differ):
Below you can find steps for the Officialy supported CentOS system (https://docs.docker.com/install/linux/docker-ce/centos/).
The centos-extras
repository must be enabled. This repository is enabled by default, but if you have disabled it, you need to re-enable it. Check that it is enabled by running:
sudo yum repolist enabled
Make sure the Centos Extras is in the result:
Add following packages: yum-utils, device-mapper-persistent-data, lvm2
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Add the official Docker repository.
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Install Docker-CE verison
sudo yum install -y docker-ce
Enable Docker at server start-up
sudo systemctl enable docker
Reboot
sudo reboot
4. Configure Docker logging
To limit amount of storage that Docker log file can occupy, we need to modify Docker settings.
Open Docker logging setting file by following command. Don't worry if file is empty or does not exist.
sudo vim /etc/docker/daemon.json
Modify the content to fit your requirements. We recommend following content:
To edit file in VIM press "a", to stop edditing press "esc". To save file finish edditing by pressing "ESC", write ":wq" and hit "ENTER".
{ "log-driver": "json-file", "log-opts": { "max-size": "200m", "max-file": "3" } }
Restart Docker to apply log settings
sudo systemctl restart docker
5. Install Docker Compose
sudo curl -L \ https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) \ -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Add your current user to docker group so your user can work with docker containers:
sudo usermod -aG docker ${USER}
If you are not performing installation under root, log out and log back in so that group membership is re-evaluated. Otherwise you would not be able to control docker containers without sudo.
6. Make Necessary Configurations
Datastorage and graphstorage modules recommends setting vm.max_map_count
to value 8*8192*number of CPU cores, so for 2 cores, it would be 262144
.
sudo sysctl -w vm.max_map_count=262144 sudo sed -i -r -e 's/^.*vm.max_map_count.*$//g' /etc/sysctl.conf sudo bash -c 'echo "vm.max_map_count=262144">> /etc/sysctl.conf'
Change configuration for Linux Huge Pages feature from always enabled to only enabled for processes that actively requests it (recommended configuration for graphstorage container)
sudo bash -c 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' sudo bash -c 'echo madvise > /sys/kernel/mm/transparent_hugepage/defrag' sudo yum -y install sysfsutils sudo bash -c 'echo >> /etc/sysfs.conf' sudo bash -c 'echo "kernel/mm/transparent_hugepage/defrag = madvise">> /etc/sysfs.conf' sudo bash -c 'echo "kernel/mm/transparent_hugepage/enabled = madvise">> /etc/sysfs.conf'
7. Download Cogniware Insights Images and docker-compose
We suggest creating a separate directory for the images and for the docker-compose.yml file.
mkdir ~/CWInsights && mkdir ~/CWInsights/Images
Download the docker-compose file.
curl -L -o ~/CWInsights URL_DELIVERED_FROM_COGNIWARE
Download the images.tar files.
curl -L -o ~/CWInsights/Images/CWInsights.tar.gz URL_DELIVERED_FROM_COGNIWARE
Optionally you can download them to your client and upload them with WINSCP or SSH SCP.
8. Load Docker Images
sudo docker load -i ~/CWInsights/Images/CWInsights.tar.gz
You will see the individual images being loaded.
After the command finishes, check that all images have been loaded.
sudo docker images
9. Customize Docker Compose .yml file
Please be sure to follow information in the comments inside the file when doing customizations.
10. Open HTTP and HTTPS ports
To be able to connect to Cogniware Insights from clients computes it is necessary to allow HTTP and HTTPS ports on firewall. That can be done by following commands:
sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --add-service=https --permanent sudo firewall-cmd --reload
11. Start Cogniware Inights for the first time
You need to be at the directory where docker-compose.yml is located.
cd ~/CWInsights/
Execute:
sudo docker-compose up -d
Check that all services are UP.
sudo docker-compose ps
Wait for all containers to finish their starting procedure (wait for CPU load to drop below 1%)
sudo docker stats
12. (Optional) Configure Cogniware Insights to start automatically
Starting docker.service after start-up doesn't always start docker-compose. To ensure, that all containers will start after a server has been rebooted, create a new file /etc/systemd/system/docker-compose.service
and insert the following content:
[Unit] Description=Docker Compose Application Service Requires=docker.service After=docker.service [Service] WorkingDirectory=/home/<USER>/CWInsights ExecStart=/usr/local/bin/docker-compose up ExecStop=/usr/local/bin/docker-compose down TimeoutStartSec=0 Restart=on-failure StartLimitInterval=60 StartLimitBurst=3 [Install] WantedBy=multi-user.target
After the file is created and saved, reload config of systemd
sudo systemctl daemon-reload
And enable Docker Compose at server start-up
sudo systemctl enable docker-compose