Install with Ansible
Introduction
This manual describes the installation procedures for GBDS.
Install Preparations
This section covers the essential steps required for the GBDS installation.
All steps must be performed with root privileges on all nodes unless stated to the contrary.
To fully install GBDS you will need:
Root permission on the server
GBDS Tools package link
Ambari Ansible package link
OpenCV package link
GBDS .rpm and .sql files
Griaule Biometric Suite Softwares .war and .sql files (optional)
Then, you must follow the steps presented below. These steps will be fully described in their sections.
Login to the server as root
Before starting, make sure the machine hostname
is correctly set up. To check it, run:
hostname
If the hostname is not correctly set up, run:
hostnamectl set-hostname <desired-hostname>
^^^^^^^^^^^^^^^^^^
If you change the hostname, remember to restart the machine before proceeding.
GBDS Tools
GBDS Tools is a compilation of bash scripts with specific characteristics and dynamic usability. The tool's primary purpose is to ease, enhance and speed up environment creation, setup, and application management.
All the scripts use a single configuration file called properties.ini
and a single list file called cluster.list
, which should contain all server group information.
Before starting, make sure wget
is installed:
wget --version
If it's not installed, run:
yum install wget -y
Installing GBDS Tools
You have two methods to choose to install GBDS Tools, one if you have the Griaule repository already set up in your server configuration and one if you do not have the repository set up. These are explained below.
Repository already set up
If you already have set up the Griaule repository in your server configuration, you can complete all installations with just one command.
yum install gbds-tools
If the Griaule repository is not set up, running the command above will result in the error:
No package gbds-tools available
Error: Nothing to do
In this case, proceed to Repository not set up.
Repository not set up
If you do not have the repository set up, you must guarantee the tool's proper functioning. To do it, you MUST deploy the tool in the /opt/griaule
directory.
Start by creating the directory:
mkdir -p /opt/griaule
Change into it:
cd /opt/griaule
Then, download the GBDS Tools package:
wget <GBDS Tools package link>
^^^^^^^^^^^^^^^^^^^^^^^^^
In the commands below, make sure to replace <version> with the version of the package that was downloaded.
And install it:
rpm -ivh gbds-tools-<version>.el7.noarch.rpm
^^^^^^^^^
And create a symbolic link:
ln -s /opt/griaule/gbds-tools-<version>/ /opt/griaule/tools
^^^^^^^^^
After a successful installation, proceed to the the configuration section.
Configuring GBDS Tools
The configuration files used by GBDS Tools are located in the directory: /opt/griaule/tools/shared
. In this directory, there are three files that need to be edited:
properties.ini
- main configuration filecluster.list
- main hostname list fileip.list
- secondary hostname file
The files are pre-configured with default values in most parameters. Check if anything needs to change to match your environment's needs.
Changing the hostnames in the files to match the ones of the environment is imperative.
In the properties.ini
file, look for the SPECIFIC TO
configurations and perform the necessary changes to match your environment.
Under the SPECIFIC TO AUTO_ENVSETUP
section, make sure that the username and password are correctly set up in usernm
, userpw
, and rootpw
.
Under the SPECIFIC TO INSTALL_MYSQL
section, note the RDB password, configured in dbuspw
, as it will be used later.
In the cluster.list
file, make sure to change the hostnames and adapt the number os hosts on each component to match your environment.
By default, the file is configured for a three node cluster. If the environment has, for example, only one node, remove the mentions to nodes 2 and 3 and replace all hostname with the hostname of your server.
In the ip.list
file, make sure to change the hostnames and IP addresses to match your environment, following the format <hostname>|<IP address>
on each line.
Running auto environment setup
The auto environment setup, named auto_envsetup.sh
is automation to set up the environment. You need to run this script when building a new server from scratch.
To run the script, execute the following command:
/opt/griaule/tools/auto_envsetup/auto_envsetup.sh --all
Then, it is recommended to update all packages if possible:
yum update -y
Installing RDB
To use GBDS, you will need an installed and configured relational database. You can choose between MySQL Server or NDB Cluster.
You only need to perform one RDB installation.
MySQL Server
It is recommended to install MySQL in the master node.
To install MySQL Server, run:
/opt/griaule/tools/install_mysql/install_mysql.sh --single
Then, proceed to Configuring the RDB password.
NDB Cluster
NDB installation MUST be in the MASTER node.
Or, if you choose to install NDB Cluster, run:
/opt/griaule/tools/install_mysql/install_mysql.sh --cluster
Then, proceed to Configuring the RDB password.
Configuring the RDB password
After the installation, try to log into MySQL running the command:
mysql -u root -p
And entering the password configured in the properties.ini
file in dbuspw
, as mentioned in the previous step.
If you are able to log in, the installation and password setup were successful and you may proceed to Configuring MySQL.
If you are not able to log in and see the following error:
Error: Access denied for user '<username>'@'<host>' (using password: YES)
You need to manually change the password. To do so, use the following command to get the temporary password created during the installation:
grep "temporary password" /var/log/mysqld.log
Copy the temporary password displayed.
Then, change the password using the following command:
mysqladmin -u root -p password "<desired_password>"
^^^^^^^^^^^^^^^^^^
When asked, enter the temporary password.
Then, try to log into MySQL again using the new password.
If you are able to log in, the installation and password setup were successful and you may proceed to Configuring MySQL.
Configuring MySQL
Finally, configure the database to your environment.
The configuration file is located at: /etc/my.cnf
.
The default configuration values set by the RDB installation may not be the desired ones. Check them in the my.cnf
configuration file and adapt them to meet the environment's needs.
After making the necessary changes, apply them by restarting the service:
systemctl restart mysqld
Installing Ambari
To install Ambari via Ansible, access to Griaule repository is required.
If your GBDS RDB is not in the MASTER node, it is advised to start another RDB instance for Ambari.
To start the Ambari installation, change to the Ansible directory:
cd /etc/ansible
Then, download the package:
wget <Ambari Ansible package link>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then, extract the files under the Ansible main directory, /etc/ansible
, with the following command:
In the command below, make sure to replace <version> with the version of the package that was downloaded.
tar -xvf ansible_hdp-<version>.tar
^^^^^^^^^
Change to the extracted directory:
cd /etc/ansible/ansible-hadoop
Since the process takes a while to complete, it is recommended to run the install script, using screen
to avoid interruptions.
To do so, install screen:
yum install screen -y
Start a new screen session:
screen -S ambari-install
Then, proceed to running the installation script as described below.
—
In case the connection to server is lost, the script will not be stopped and you can resume the session by reconnecting to the server and running:
screen -r ambari-install
Then, run the installation script:
./full-hadoop.sh
Answer the installation questions and proceed until finished.
Once started, DO NOT interrupt any of the scripts. If any problem happens, contact the Griaule Support Team.
Installing GBDS
To install GBDS, you will need:
GBDS Cluster .rpm
GBDS Distribution .rpm
GBDS RDB dump script .sql
OpenCV package link
Start by moving the two .rpm
files to the /opt/griaule/tools/deploy_application/files
directory.
The .sql
RDB dump script file should be saved elsewhere.
After running the following script, everything inside the /opt/griaule/tools/deploy_application/files
directory will be deleted.
Then, run the following command to install GBDS:
/opt/griaule/tools/deploy_application/deploy_application.sh --gbds
Then, run the RDB dump script in the SQL server.
mysql -u root -p < /PATH/TO/FILE/clear-rdb-<version>.sql
^^^^^^^^^^^^^^ ^^^^^^^^^
The RDB password was configured here.
After finishing the GBDS installation, configure it by running:
/opt/griaule/tools/auto_appconfig/auto_appconfig.sh --gbds
To manually review or change settings, edit the configuration file located at: /etc/griaule/conf/gbds/application.conf
. For further information on the configuration file, refer to the GBDS Configuration Manual.
Make sure the hostname in the configuration file (application.conf
) matches the hostname of the server.
Then, start the GBDS API:
service gbsapid start
Test if the API is running:
curl http://<host-ip>:8085/gbds/v2/operations/ping
^^^^^^^^^
The expected response is:
{"data": "pong!"}
Finally, start GBDS:
gbdsstart
And follow the execution log:
gbdslogt
Installing GBS Applications
To install the GBS Applications, you will need:
The .war file for each application
The .sql dump script for each application
First, install and configure the Tomcat for the web apps. This should be done only in the server that will host the web apps. Use the following command:
/opt/griaule/tools/install_services/install_services.sh
Then, move the .war
files to the /opt/griaule/tools/deploy_application/files
directory and run the command:
/opt/griaule/tools/deploy_application/deploy_application.sh --services
After that, configure the applications with the following command:
/opt/griaule/tools/auto_appconfig/auto_appconfig.sh --services
Last updated