Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The FlexDeploy™ Linux Installer Guide provides system requirements, required downloads and instructions for installing or upgrading FlexDeploy and its components.

Table of Contents
maxLevel2
Excerpt
nameAbout

About the automated Install/Migration tool

The flexdeployerinstaller.sh script is a new automated process that reduces customer efforts in installing or upgrading FlexDeploy, which will make staying up to date on FlexDeploy versions easier.  The installer will take care of installation or upgrade of FlexDeploy with no manual intervention required.  There is a configuration file which will need to be modified for your installation and then the installer can take over.  There are three basic modes to the installer: 1) prerequisite checking with no installation or upgrade, 2) first time installation of FlexDeploy and 3) upgrading a current installation of FlexDeploy.

The apache-tomcat-flexdeploy folder will be cleaned up with each upgrade, so it is important not to place any supporting files in the apache-tomcat-flexdeploy folder. Place them in the flexdeploy home folder or another subfolder instead.

Versions / Release Notes

Installer Version 1.0.1 was released on 12/6/2022. This version has fixes for a number of issues that customers faced and is recommended for all upgrades and installs moving forward.

This automated installer will handle

  • executing prerequisite checks to ensure the installation/upgrade will be successful

  • downloads of FlexDeploy software and influx database software if the VM has access to the Internet

  • installation of FlexDeploy for the first time

  • upgrading of FlexDeploy to a new version from version 5.2.0.5 or newer

  • backing up the current FlexDeploy installation, plugins, and optionally artifacts before upgrading

  • backing up the database before upgrading (optional)

  • creating or migrating the FlexDeploy database schemas

  • installation or configuration of the influx database which is used for reporting and dashboard data

This automated installer will not handle

  • downloads of software if the VM has no access to the Internet. In this case, the files need to be placed on the FlexDeploy server in locations specified by the installer

  • download of security wallets

  • upgrading from FlexDeploy versions older than 5.2.0.5

  • upgrading a Kubernetes installation

See FlexDeploy Architecture for architecture details.

Installer arguments

The Argument c must be the last argument specified.

The following arguments are available to be used:

  • -p run the installer in the prerequisite checking mode with no installation/upgrade occurring.  The execution of this checking will not do anything with the current installation, so it can be run anytime.  If the installer detects any issue(s), the issue will be reported to the logs and displayed on the screen.  The prerequisites will also be run during the installation or upgrade process and may stop the process, which is why it is recommended to run this mode until there are no issues being reported.  Each issue that is reported will have a possible resolution to the issue to assist you in resolving it.  Some of the checks are: verify file system sizes to make sure all required directories have at least the minimum amount, flexdeployinstaller_config.txt file properties are set, java is at the right level, etc. Removing this argument will execute the install/upgrade.

  • -c/<path to>/flexdeployinstaller_config.txt points the installer to the flexdeployinstaller_config.txt file that contains the user configurations.  The file should not be saved under the flexdeployinstaller folder.  It is always required.

  • -s there are several passwords in the flexdeployinstaller_config.txt file and if a password field is left blank, in this scenario, a prompt for the password will happen (nothing will be stored) and the password is not shown on the screen, similar to other Linux password prompts.  The -s option will show the password on the screen as you type.

  • -n don’t allow any Internet connections to download the necessary zip files. Use this if you downloaded them to the server already and wish for those to be used instead of downloading new ones.

  • -i skip the database backup. This can be done if you have an existing database backup.

  • -a skip the artifacts backup. This can be done if you have an existing backup of the artifacts folder or a snapshot of the VM.

  • -d Install as a docker container.

  • -w Specify that you are upgrading from a Weblogic install to a Tomcat install. Not compatible with the -d option.

Step by Step Guide to Using the installer

Step 0: System Requirements

Info

See FlexDeploy System Requirements for details on software and hardware requirements

Step 1: Database Preparation (Installation Only)

Postgres

Install the Postgres binaries, and create a flexdeploy database. The automated installer will do the rest.

Either from the commandline with psql

Code Block
languagebash
createdb flexdeploy

or if you have sql access to the postgres database, and don’t have access to run createdb, you can connect to the postgres database and using sql

Code Block
languagesql
create database flexdeploy

Oracle

Install the Oracle Database binaries and find your jdbc connection string. The automated installer will create FD, FF, and FD_ADMIN schemas in the USERS tablespace.

...

namestep2

Step 2: Get the Installer

Download flexdeployinstaller.zip and get it to the FlexDeploy server. You can wget it there directly if you have Internet access, or transfer the file from another machine.

Code Block
wget -O flexdeployinstaller.zip https://flexagon.com/downloads/flexdeployinstaller

If you don’t have wget, and must use curl, use the -L argument like:

Code Block
curl -L --max-redirs 5 https://flexagon.com/downloads/flexdeployinstaller --output flexdeployinstaller.zip

Once downloaded, select a directory (ex. /u01 or /u02) to unzip the flexdeployinstaller.zip.

Change directory to your selected directory and unzip the flexdeployinstaller.zip download.  If this isn't the first time unzipping the installer, select [A]ll on the replacement question.

Code Block
languagebash
cd <FLEXDEPLOY_INSTALLER_HOME>
unzip <path to flexdeployinstaller download>/flexdeployinstaller.zip

From the FLEXDEPLOY_INSTALLER_HOME directory, change directory to flexdeployinstaller_X.X.X to provide execution permission to the script.

Make sure the user that will run FlexDeploy has access to run the script. That user should execute the script.

Code Block
languagebash
cd flexdeployinstaller_X.X.X
chmod +x flexdeployinstaller.sh

Step 3: Setup the Configuration File

Step 3.1: Save flexdeployinstaller_config.txt

Panel
panelIconId270b-1f3fc
panelIcon:raised_hand::skin-tone-3:
panelIconText✋🏼
bgColor#E6FCFF

This step is extremely important to preserve your configuration file from any potential installer upgrades. This step should only be done once: on a new installation or on a first time upgrade with this new process.

There is a configuration file (flexdeployinstaller_config.txt) that controls the actions of the installer.  It is the most important file for the installer and needs to be saved to avoid being overlaid with any new flexdeployinstaller downloads as this would remove all of your entered configurations.  There is a template file located in FLEXDEPLOY_INSTALLER_HOME/flexdeployinstaller.  This template file must be copied to any other location, it could be placed in the FLEXDEPLOY_HOME and it would be safe from overlay and easier to find for the next upgrade.

Code Block
languagebash
cd <FLEXDEPLOY_INSTALLER_HOME>/flexdeployinstaller_X.X.X
cp flexdeployinstaller_config.txt <FLEXDEPLOY_HOME>/  # this is one option to save but this can be saved to any other location.  Just must be out of FLEXDEPLOY_INSTALLER_HOME/fledeployinstaller directory due to installer upgrades.

Step 3.2: Updating flexdeployinstaller_config.txt

Note

Spaces are not supported in any directory and/or password values.

Info

This step should only need to be done once, on a new installation or on a first time upgrade with this new process. Unless there is a change to any of the configuration properties.

Once copied, the file needs to be adjusted for your installation requirements (there are many default values in the file and they can stay defaulted).  There are comments in the template file for each property but this guide will cover the properties that need to be updated.

Info

FLEXDEPLOY_HOME is a key property as the flexdeployinstaller will determine based on this property if a current installation is running, make sure the directory location is correct (e.g. the FLEXDEPLOY_HOME would be the path up to, but not including, the apache-tomcat-flexdeploy directory. /u01/flexdeploy/apache-tomcat-flexdeploy would have a FLEXDEPLOY_HOME of /u01/flexdeploy.

...

Configuration Property

...

Required

...

Description

...

FLEXDEPLOY_HOME

...

Yes

...

This is the directory location where FlexDeploy will be installed or is already installed, the default is /u01/flexdeploy.

...

FLEXDEPLOY_JAVA_HOME

...

Yes

...

This is the path to Java JDK 8, it would be the path up to bin (not including bin)

...

WORKING_DIRECTORY

...

No

Defaults to ${FLEXDEPLOY_HOME}/application

...

This will be the directory location that FlexDeploy uses for temporary files to be transferred between the server and its endpoints.  The default location is under FLEXDEPLOY_HOME and is named application.

...

ARTIFACT_REPOSITORY_DIRECTORY

...

No

Defaults to ${FLEXDEPLOY_HOME}/artifacts

...

this will be the directory location that FlexDeploy uses to store all build artifacts and retrieve deployment artifacts. The default location is under FLEXDEPLOY_HOME and is named artifacts.

...

BACKUP_DATABASE_DIRECTORY

...

No

...

The directory where the database will be backed up to.

This value is optional.

If Oracle, this directory must already exist within the DBA_DIRECTORIES table and the DIRECTORY_PATH for the entry must exist on the file system on the Database Server.

If Oracle, and BACKUP_DATABASE_DIRECTORY is blank, the DEFAULT data_pump directory is used if needed.

If PostgreSQL, and BACKUP_DATABASE_DIRECTORY is provided, the database will be backed up to this local folder using the psql command, which must be available on this local host.

If PostgreSQL, and BACKUP_DATABASE_DIRECTORY is blank, the database schemas will be backed up by cloning to another schema in the same database.

...

SCM_TYPE

...

No

...

specify the primary SCM type that will be utilized. This isn’t part of the installation but there is a prerequisite check to make sure any necessary SCM clients are present. This check won’t stop the install, it is just informational. Not all SCM Types require clients.

...

FLEXDEPLOY_DB_USER

...

Yes

...

The limited database user that will be used to run FlexDeploy

...

FLEXDEPLOY_DB_PASSWORD

...

No

...

The password will be prompted if not specified.

...

SYSTEM_DB_USER

...

Yes

...

Usually set to system for Oracle and postgres for Postgres.

This user will create and update the schema definitions

...

SYSTEM_DB_PASSWORD

...

No

...

This password is required to create and update schema definitions

The password will be prompted if not specified.

...

FLEXDEPLOY_PORT

...

No

...

Defaults to 8000 for standard installs, 8004 for Docker installs.

...

MAINTAIN_EXISTING_CONTEXT_FILE

...

No

Defaults to 0

If 0, then the installation process will use the newly downloaded context.xml file and adjust the properties accordingly.

If 1, then the installation process will save the existing context.xml and replace it after the upgrade so there are no changes to it.

Set to 1 if you have changes to the context.xml file that you wish to maintain such as using a password manager for your database password in context.xml.

...

MAINTAIN_EXISTING_SERVER_FILE

...

No

Defaults to 0

...

If 0, then the installation process will use the newly downloaded server.xml file and adjust the properties accordingly.

If 1, then the installation process will save the existing server.xml and replace it after the upgrade so there are no changes to it.

...

INFLUX_DB_DIRECTORY

...

No

Defaults to ${FLEXDEPLOY_HOME}/influxdb

...

If you wish to have influx installed in a different location, specify it.

...

INFLUX_DB_URL

...

No

Defaults to http://localhost:8086

...

If your influx server is listening on a different port, specify the connection information here.

...

INFLUX_DB_BUCKET

...

No

Defaults to flexbucket

...

Do not change this value after the initial installation is complete.

...

INFLUX_DB_ORG

...

No

Defaults to flexdeploy

...

Do not change this value after the initial installation is complete.

...

INFLUX_DB_USER

...

No

Defaults to flexuser

...

Do not change this value after the initial installation is complete.

...

INFLUX_DB_PASSWORD

...

Yes

...

Do not change this value after the initial installation is complete.

...

INFLUX_DB_TOKEN

...

Yes

...

This token is required for FlexDeploy to communicate with the influx database.

Enter any arbitrary string that will be saved in FlexDeploy and used for the influxdb installation.

Do not change this value after the initial installation/upgrade to FlexDeploy 6.0+ is complete.

...

ALTERNATE_FLEXDEPLOY_SOFTWARE_VERSION

...

No

...

Filling in this property will tell the installation process that you don't want the latest version of the software, if the process can get through to the internet to auto download the software. Must be a valid FlexDeploy version

e.g. 6.0.0.0

e.g. 5.7.0.8

...

DATABASE_URL

...

Yes

...

Adjust the appropriate connection string for the FlexDeploy database, Oracle or Postgres.

Verify that your DATABASE_URL line isn’t commented out (# at the beginning of the line) and that all other DATABASE_URL lines are commented out.

Several examples are listed in the config file.

...

CONTAINER_NAME

...

No

Only used for Docker

Defaults to flexdeploy

...

If installing FlexDeploy through Docker you can set the name of the container that will be created by editing the variable below. Defaults to 'flexdeploy'

At the completion of updating and saving the flexdeployinstaller_config.txt file, run the following command at any time, to source in the properties from the flexdeployinstaller_config.txt file and make them available to be used for navigation.

Code Block
cd <FLEXDEPLOY_INSTALLER_HOME>/flexdeployinstaller_X.X.X
source ./setEnv.sh <path to saved flexdeployinstaller_config.txt>

Step 4: Download any Additional Software

If you don’t have Internet access, all software downloads noted below must reside on the FlexDeploy VM before you can install or migrate. The prerequisite checks will validate if Internet access to the needed locations is available.

If you have Internet access, but choose to place the files manually, make sure to run with the -n argument (simulates no internet access) on the installer.

Step 4.1: FlexDeploy software (conditional)

If your FlexDeploy VM has access to the Internet, the flexdeployinstaller.sh will pull the latest FlexDeploy software from the Flexagon Support Site and no manual download will be needed.

If your FlexDeploy VM doesn't have access to the Internet, the FlexDeploy software can be downloaded from the Flexagon Support Site and the downloaded zip file must be saved to FLEXDEPLOY_INSTALLER_HOME/downloads/software (don't unzip).

Code Block
languagebash
cp /path to FlexDeploy software download/Tomcat_Complete-*.zip ${FLEXDEPLOY_INSTALLER_HOME}/downloads/software

Step 4.2: Influx database (conditional)

If you are installing/upgrading FlexDeploy with version 6.0+ and your FlexDeploy VM has access to the Internet, the flexdeployinstaller.sh will pull the required version of the software and client from the influx data website.

If you are installing/upgrading FlexDeploy with version 6.0+ and your FlexDeploy VM doesn't have access to the Internet, the software and the client must be downloaded from the influx data website using the embedded links.  The 2 downloaded gzip files must be saved to FLEXDEPLOY_INSTALLER_HOME/downloads/influxdb (don't extract them). This only needs to be downloaded once.

Code Block
languagebash
cp /path to influx database download/influxdb2*tar.gz ${FLEXDEPLOY_INSTALLER_HOME}/downloads/influxdb

Step 5: Check the Prerequisites

Step 5.1: Execution

Now that the downloads that are needed are completed and the flexdeployinstaller_config.txt file is updated, the prerequisite checks should be executed outside of the install/upgrade process. The prerequisite checking process is designed to be run multiple times until all reported issues are resolved. Any issue that is found will be displayed on the screen in the form of the issue and the potential resolution.

Run the installer as the user that you want to own and execute the FlexDeploy Tomcat process.

Code Block
languagebash
cd ${FLEXDEPLOY_INSTALLER_HOME}/flexdeployinstaller_X.X.X
./flexdeployinstaller.sh -p -c <path to saved config file>/flexdeployinstaller_config.txt
Warning

08/26/2022 12:01:20 PM Error occurred

############################### ISSUE 105 ##########################################################
ISSUE: The FLEXDEPLOY_JAVA_HOME configuration property is not set. This must be set and
must meet the FlexDeploy requirements of at least 1.8 but not greater than 1.8.

RESOLUTION: Please update the flexdeployinstaller_config.txt file for the installation.

####################################################################################################

Info

If you are running the prerequisites more than once and have internet access from your VM, the installer will download the software each time. After the initial run, add -n to the command, this will turn Internet access off for this execution and not download the software.

Step 5.2: Resolution

With the list of issues on the screen, and in the logs (FLEXDEPLOY_HOME/upgrade/logs), each issue must be resolved before continuing. Each issue will provide some level of resolution that can assist in clearing up the given issue.

Note

If there are any issues that are not resolved, the next step will fail as it will call the prerequisites also. The prerequisites need to be run on every execution but could stop the process, thus running the prerequisites independently will ensure a clean install/upgrade.

Step 6: Complete the Installation/Upgrade

Now that we have everything validated from a prerequisite check, we can start the installer process. As stated earlier, the same process will handle the installation and any upgrade. The installer will use the flexdeployinstaller_config.txt properties to detect if there is a current installation. Start the installer process by running the below command.

Code Block
languagebash
cd ${FLEXDEPLOY_INSTALLER_HOME}/flexdeployinstaller_X.X.X
./flexdeployinstaller.sh -n -c <path to saved config file>/flexdeployinstaller_config.txt (no automated downloads with -n option)

The process will take a few minutes, longer if the downloads haven’t been performed ahead of time.

Additional Information

Continuing an Upgrade after Database Migration Failure

When executing an upgrade with the installer you may run into a failure during the Database Migration scripts. In that case you will need to manually resolve the issue that was encountered and continue the specific migration script to completion. The execution logs for the upgrade will contain information on the last successfully run SQL statement as well as the error that occurred during execution. Once the issue is resolved we will find the location of the last successful SQL statement in the migration script and execute the remaining SQL statements one by one.

Below is an example of a log file where an exception occurred while upgrading from v5.7.0.2 to v6.0.0.0. As you can see we ran into an error when creating the FD.USER_FAVORITE table and the last successful statement was delete FROM FD.REL_SNAPSHOT_VERSION where REQUEST_ALL_FILES='Y' AND PACKAGE_NAME IS NOT NULL.

Code Block
10/18/2022 14:47:19 Exception occured while executing /u01/flexdeployinstaller_1.0.1/../temp/software/database/oracle/upgrade/v5.7.0.2-to-v6.0.0.0/migration.sql
10/18/2022 14:47:19 Last successful statement executed: delete FROM FD.REL_SNAPSHOT_VERSION where REQUEST_ALL_FILES='Y' AND PACKAGE_NAME IS NOT NULL
10/18/2022 14:47:19 Script execution failed on statement: CREATE TABLE FD.USER_FAVORITE

After fixing the issue we encountered while creating the FD.USER_FAVORITE table we will find the location of the last successfully executed statement in the migration script. For this specific example we can see that the last successful statement is on line 4. We will then execute the remaining SQL statements (Line 7 and beyond) one by one until all SQL statements have been executed for this migration script.

Code Block
-- 6.0.0.0
insert into FD.FD_FLEXDEPLOY_VERSION values('6.0.0.0',null,current_date,'SYSTEM',current_date,'SYSTEM',1);

delete FROM FD.REL_SNAPSHOT_VERSION where REQUEST_ALL_FILES='Y' AND PACKAGE_NAME IS NOT NULL;

-- user fav - start
CREATE TABLE FD.USER_FAVORITE 
(
...

...

Include Page
SHAR:Automated Linux Install / Upgrade
SHAR:Automated Linux Install / Upgrade