Linux Installation Guide

 
Author
Message
SysAid Technical Writer
1087
 

Linux Installation Instructions

Installation with a MySQL or MS SQL database

This guide describes how to install SysAid with Docker using an MySQL or MS SQL database. For information on SysAid requirements, see SysAid System Requirements.

 

Before you begin this process, please ensure that you have Python 2.7 installed.

 

Prepare the database

Preparing your SQL database for installing SysAid involves two basic steps:

  1. Creating an empty SysAid database with the necessary priveliges on your running SQL server.
  2. Configure the database to allow remote login.

 

Create an empty database

 

On a MySQL server:

Run:
mysql -u<user> -p<Password>

create database sysaid;
grant all privileges on <DB name>.* to <DB user name>@'%' identified by '<Password>';

 

Instead of granting all IP addresses, you can grant permissions to the docker subnet - usually “172.17.0.%”, but you need to verify it after docker-ce installation (“docker0” interface in “ifconfig”).
For example:
grant all privileges on sysaid.* to root@'172.17.0.%' identified by 'Password1';

Then run:
flush privileges;


On a MS SQL server:

Run:

sqlcmd -S localhost -U sa -P '<YourPassword>'

CREATE DATABASE sysaid

GO

 

Allow remote login

Example texts included here apply to My SQL servers.

 

  1. On your MySQL server edit relevant configuration file:

  • Ubuntu / Debian : /etc/mysql/mysql.conf.d/mysqld.cnf or /etc/mysql/my.cnf

  • CentOs: /etc/my.cnf -
    1. If no “bind-address” line exists, continue to next step.
      If there is a “bind-address” line, update it to: bind-address = 0.0.0.0
    2. Verify below lines are commented out, if they exist at all.
      # skip-networking
      # skip-external-locking
    3. If needed, Open iptables rules.
  1. Run /usr/bin/mysql_secure_installation
    • Update your DB details and answer “n” to the question: Disallow root login remotely?
  2. CentOS-7 - add SQL port access to firewall:
    firewall-cmd --zone=public --add-port=3306/tcp --permanent ; service firewalld restart
  3. Restart SQL server:
    • MySQL: Ubuntu / Debian - /etc/init.d/mysql restart
    • CentOS - service mysql restart
  4. On your Linux server, install MYSQLclient (if not already installed):
    • Ubuntu: apt-get install mysql-client
    • CentOS: yum install mysql
    1. Verify you can access sql db. For example: mysql -h<sql server IP> -u<User> -p<Password>
    2. Verify you are getting the sql prompt.

      Note: Do not continue with this procedure unless you can access the SQL server from the Linux docker unit.

    3. If the connection fails, check that the database exists, privileges have been granted, bind-address has been opened, FW open, etc.

General preparations

  1. On your Linux machine, copy the following files to the /tmp directory:
    • activation.xml (the account’s activation file)
    • SysAid_Prepare_Docker_Env.py
    • Install_SysAid.py
    You can locate the files at http://cdn3.sysaid.com/Install_SysAid.py http://cdn3.sysaid.com/SysAid_Prepare_Docker_Env.py
  2. If the unit has an external network connection, the script automatically fetches the needed packages.
    If you want to install docker without fetching packages from web (i.e. locally), copy the relevant docker pkg to a the /tmp directory:
    • For Ubuntu/Debian installation:
      Find your type by running:
      “lsb_release -a |grep Codename”
      Find your arch by running:
      “dpkg --print-architecture”
      Find relevant docker-ce pkg under:
      https://apt.dockerproject.org/repo/pool/main/d/docker-engine/
      Package name:
      docker-engine_17.05.0~ce-0~<ubuntu/debian>-<TYPE>_<ARCH>.deb (i.e. docker-engine_17.05.0-ce-0-ubuntu-xenial_amd64.deb)
    • For CentOs installation:
      Docker-ce-17.09.0.ce-1.el7.centos.x86_64.rpm
      Can be found here:
      https://download.docker.com/linux/centos/7/x86_64/stable/Packages
  3. For faster and clearer output of the preparation script, run it before the upgrade:
    Ubuntu / Debian: apt-get update -y
    CentOS: yum update -y
  4. Run the preparation script:
    python2.7 ./SysAid_Prepare_Docker_Env.py
    If you want to install docker from a local package, run:
    python2.7 ./SysAid_Prepare_Docker_Env.py -local
    This script verifies prerequisites and installs docker-ce.
  5. Validate that the script finished successfully. If the script fails, fix the problem and rerun the script.

Install SysAid server on Docker

  1. If you want to install SysAid with MSSQL docker container:
    1. Create MSSQL container:
      docker run --detach --name=mssql-sysaid -e 'ACCEPT_EULA=Y' -e
      'SA_PASSWORD=<sa password>' -v /opt/mssql_data:/var/opt/mssql -p
      1433:1433 -d microsoft/mssql-server-linux

    2. Verify that you can connect to the database you created with the datbase parameters you entered. Run the following script:
      docker exec -it <container id> /bin/bash
      (To find container id run: “docker ps”)
    3. Inside the container - connect to the database and create an empty sysaid database:
      /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <password>
      CREATE DATABASE sysaid
      go
    4. Exit the database container by running “exit” twice.
  2. If you want to link the container to a different port on the host verify that the port is available

  3. There are two options for getting the SysAid docker image:
    1. Pull SysAid image from docker hub:
    • On your Linux machine with the docker installed, pull the relevant image (this process can take a while)
      docker pull sysaid/sysaid_server_linux
    • If you have proxy on this server, see Enable Docker pull with proxy, below.
    1. If you wish to create a local docker image (for slow NW or situations where no external NW is available):
    • Locally download the following files from the relevant version path:
      sysaid-server-linux_<version>.tar.gz
      Dockerfile
      SysAid_container_init.sh

      Validate that the files are owned by root and have full permissions. If not, run from the local directory: chown root:root ./*;chmod 777 ./*
  4. Copy Install_SysAid.py to server & run it
    1. For an existing image (pulled from docker hub), run:
      python2.7 Install_SysAid.py
    2. To create an image locally ( option "b" in the previous step, above), run:
      python2.7 Install_SysAid.py -local
    3. Supply all the requested info.

      Note: During the local installation, there will be an error after Stopping the Tomcat server. This is to be expected.
  5. Verify installation was successful:
    1. Follow installation progress by running:
      docker logs -f sysaidserver
    2. When installation finishes successfully, you should see the line:
      ******** WELCOME TO SYSAID ! **********
    3. If the container execution fails:
    • Check the reason in container log or in sysaid.log under sysaid_data_vol (see details in section 7 below).
    • Fix the problem.
    • On your SQL server - drop the Sysaid database and create a new empty database.
    • Re-run the installation script.
    1. Wait few minutes and check that the SysAid web page is up at:
      http://<IP>:<SysAid port> (IP of the Linux machine with the SysAid docker installation).
  6. At the end of this stage you will have a container running.
    “docker ps” output should look something like this:
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    1b3552a85356 sysaidserver:1.0 "/SysAid/SysAid_co..." 23 minutes ago Up 23 minutes 0.0.0.0:8080->8080/tcp sysaidserver
    (If there is a SQL container - you will see both containers).
  7. SysAid content can be found on the Linux machine under the defined volume: sysaid_data_vol
    To find mount location run:
    docker inspect sysaid_data_vol | grep Mountpoint
    For example, "Mountpoint": "/var/lib/docker/volumes/sysaid_data_vol/_data",
    SysAid Conf can be found under <mountpoint>/WEB-INF/conf
    SysAid logs can be found under <mountpoint>/WEB-INF/logs

 

If SQL is on docker - A volume with database data can be found at: /opt/mysql_data for MySQL, and /opt/mssql_data for MSSQL.

 

Enable Docker pull with proxy

If you have proxy on your Linux server, you need to enable the docker pull via proxy.

 

On Ubuntu:

  1. Create a systemd drop-in directory for the docker service:
    mkdir /etc/systemd/system/docker.service.d
  2. Create a file /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
    [Service]
    Environment="HTTP_PROXY=http://<proxy_host>:<proxy_port>/"

    Or, if you are behind an HTTPS proxy server, create a file called
    /etc/systemd/system/docker.service.d/https-proxy.conf that adds the HTTPS_PROXY environment variable:
    [Service]
    Environment="HTTPS_PROXY=https://<proxy_host>:<proxy_port>/"
  3. Flush changes:
    sudo systemctl daemon-reload
  4. Verify that the configuration has been loaded:
    sudo systemctl show --property Environment docker
    You should see the environment you updated.
  5. Restart Docker:
    sudo systemctl restart docker

The above instructions were taken from docker official site, and can be found here:
https://docs.docker.com/engine/admin/systemd/#httphttps-proxy

This message was edited 1 time. Last update was at May. 01, 2018 03:38 AM

SysAider
11
 
How about container upgrade ? There is newer version on dockerhub but no info about how upgrade.