Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 73 Current »

This page provides instructions for upgrading a FlexDeploy installation. These instructions upgrade Tomcat to the version included in the distribution zip depending on current version of FlexDeploy.

Unless you are running on Windows or have been advised by Flexagon Support, consider using the Automated Install/Upgrade instead.

Requirements

See FlexDeploy System Requirements for details on software and hardware requirements.

Upgrade Instructions

Make sure you have downloaded the latest version of FlexDeploy so it can be accessed during upgrade process.

Step 1. Stop the Tomcat server

Linux

cd <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/bin
./StopFlexDeploy.sh

Windows

cd <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/bin
StopFlexDeploy.bat

Step 2. Download FlexDeploy software

Make sure that you have downloaded the latest version of FlexDeploy and unzip it into a temporary location (for example, /u01/software), so it can be accessed during the upgrade process. You can get download links from http://support.flexagon.com. Do not unzip the FlexDeploy distribution directly into the FLEXDEPLOY_HOME directory so we can prevent unwanted file(s) or folder(s) from being overwritten.

Linux

mkdir /u01/software/downloaded
cd /u01/software/downloaded
unzip <download location path>/Tomcat_Complete-6.x.x.x.zip

Windows

mkdir c:\u01\software\downloaded
cd c:\u01\software\downloaded
unzip <download location path>\Tomcat_Complete-6.x.x.x.zip

Step 3. Backup current implementation

Backup the FlexDeploy schemas, Artifact Repository, plugins folder, and apache-tomcat-flexdeploy folder. In case you need to back out this FlexDeploy upgrade, you can use this backup data.

It is highly recommended that a backup of the database be taken using standard tools like RMAN for Oracle. Another option would be to export the FD, FD_ADMIN, and FF schemas using data pump. Follow standard procedures for PostgreSQL for database backup.

PostgreSQL database backup

pg_dumpall -w -U postgres -f fd_db_bkp.bkp -p 5432

Oracle database backup

# If this database is exclusively used for just FlexDeploy application, you can rely on your Database backup and recovery processes (RMAN) instead of export data procedure.
# You will need to setup environment variables before running expdp. For example,

export ORACLE_HOME=c:\oracle\product\12.1.0\dbhome_1
export ORACLE_SID=fd01

# export statements above are for example only as values will be different for your installation. 

expdp system directory=DATA_PUMP_DIR dumpfile=fd_bkup.dmp schemas=FD,FF,FD_ADMIN

File System backup

It is recommended that a backup of the artifact repository, plugins, and apache-tomcat-flexdeploy be taken in case a back-out is required. The location of the artifact repository can be identified by looking at value of -Dflexagon.fd.repository.root in setenvoverride.sh/setenv.sh file. This file will be in <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/bin. Additionally look for flexagon.fd.application.root to determine server application directory for plugins backup. Standard file backup procedures can be followed.

See the following example. Make sure to backup apache-tomcat-flexdeploy folder as that is going to be replaced during next steps.

Linux

cd <artifact repository location>/
tar -cvzf ../artifacts.tar.gz *

# The plugins folder may not exist yet depending which version of FlexDeploy you are upgrading from
cd <server application directory>
cd plugins
tar -cvzf ../plugins.tar.gz *

# apache-tomcat-flexdeploy (if apache-tomcat-flexdeploy-old exists then use some other folder name)
cd <FLEXDEPLOY_HOME>
mv apache-tomcat-flexdeploy apache-tomcat-flexdeploy-old

Windows

cd <artifact repository location>
tar cvzf ..\artifacts.tar.gz *

# The plugins folder may not exist yet depending which version of FlexDeploy you are upgrading from
cd <server application directory>
cd plugins
tar -cvzf ..\plugins.tar.gz *

# apache-tomcat-flexdeploy (if apache-tomcat-flexdeploy-old exists then use some other folder name)
cd <FLEXDEPLOY_HOME>
move apache-tomcat-flexdeploy apache-tomcat-flexdeploy-old

Step 4. Upgrade the FlexDeploy schemas

See details in Upgrading FlexDeploy Schemas.


Step 5. Apply new version

You must have performed backup of apache-tomcat-flexdeploy folder by now as described in Step 3. If you have not done that, please go back to Step 3 for details.

Note on additional extension jar files : If you had placed additional libraries in apache-tomcat-flexdeploy/lib folder or in the apache-tomcat-flexdeploy/libext folder, then you will need to copy them from backup folder into the new apache-tomcat-flexdeploy/libext folder. Note that all extension jars should be kept in libext folder. Examples might be JDBC driver (for Oracle drivers there is additional detail in the following step), CyberArk libraries etc.

See example below on steps necessary.

Linux

cd <FLEXDEPLOY_HOME>
cp /u01/software/downloaded/*.sh .
chmod +x *.sh

mkdir apache-tomcat-flexdeploy
cd apache-tomcat-flexdeploy

cp -r /u01/software/downloaded/apache-tomcat-flexdeploy/* .
chmod +x bin/*.sh

cd ..
mkdir influxdb
cd influxdb
cp -r /u01/software/downloaded/influxdb/* .

# restore the libext from the tomcat backup done in Step 3
cd libext
cp <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy-old/libext/* .

Windows

cd <FLEXDEPLOY_HOME>
copy c:\u01\software\downloaded\*.bat .

mkdir apache-tomcat-flexdeploy
cd apache-tomcat-flexdeploy

xcopy c:/u01/software/downloaded/apache-tomcat-flexdeploy /e

cd ..
mkdir influxdb
cd influxdb
xcopy c:\u01\software\downloaded\influxdb /e

# restore the libext from the tomcat backup done in Step 3
cd libext
xcopy <FLEXDEPLOY_HOME>\apache-tomcat-flexdeploy-old\libext /e

Step 6. Manage Tomcat context.xml

Copy the context.xml file from the backup folder into <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/conf.

Linux

cd <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy-old/conf
cp context.xml <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/conf

Windows

cd <FLEXDEPLOY_HOME>\apache-tomcat-flexdeploy-old\conf
copy context.xml <FLEXDEPLOY_HOME>\apache-tomcat-flexdeploy\conf

If using Oracle database,

  • Download the Oracle JDBC 8 driver from https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html. Click on the driver link matching your Oracle database version, and download the driver compatible with JDK8. For example, ojdbc8-full.tar.gz.

  • Clean up ojdbc jars from <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/lib. (For example, ojdbc6dms.jar)

  • Save new driver jars from downloaded jdbc driver to <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/libext. You may have done this already as part of Step 4. Make sure that if you copied the jars for libext of your backup to your new libext, you don’t end up with multiple versions of the Oracle JDBC jars. If migrating from an old version of FlexDeploy, you may want to clean your libext folder and start with a new Oracle Database driver download.

  • If using Oracle database and have not switched to using UCP connection pool, then see Implementing UCP connections with Tomcat and Oracle for more information. Look at type in context.xml, if it is oracle.ucp.jdbc.PoolDataSource, then you are already setup to use UCP connection pool.

Linux

cd /u01/software
mkdir drivers
cd drivers

tar -xf <ojdbc8 download location>/ojdbc8-full.tar.gz

cd <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/lib
rm ojdbc*.jar
cd ../libext
cp /u01/software/drivers/ojdbc8-full/*.jar .

Windows

cd c:\u01\software
mkdir drivers
cd drivers

tar xf <ojdbc8 download location>\ojdbc8-full.tar.gz

cd <FLEXDEPLOY_HOME>\apache-tomcat-flexdeploy\lib
del /f ojdbc*.jar
cd ..\libext
copy c:\u01\software\drivers\ojdbc8-full\*.jar .

Step 7. Manage Tomcat server.xml

Edit the <FLEXDEPLOY_HOME>/apache-tomcat-flexdeploy/conf/server.xml and modify the HTTP/HTTPS ports to match that of the original file which was backed up in step 3. If you had setup keystore details, copy that as well from backup file. DO NOT simply copy over the backup file as there may be other changes.


Step 8. Manage setenvoverride file

Changes should not be made in setenv.bat or setenv.sh

If you were already using setenvoverride.bat or setenvoverride.sh, then copy that from backup folder (Step 3), otherwise any changes previously done for setenv.bat or setenv.sh must be added to setenvoverride.bat or setenvoverride.sh. For example, the Artifact directory, application directory, and java_home changes will need to be transferred over from your old setenv.bat or setenv.sh file.

If your backed up setenv.bat or setenv.sh file has a line that contains JAVA_HOME, then the new setenvoverride.bat or setenvoverride.sh should look like this:

Linux

Windows


Step 9. Update Plugins

FlexDeploy download zip contains plugin jar files. You just need to copy plugin jars from download zip to plugins folder in your installation (details explained below), and all plugins will be automatically uploaded and activated on server startup.

  1. Plugin files to copy are in /u01/software/downloaded/application/plugins in the unzipped Tomcat Complete file.

  2. Let's determine where to copy files in your installation now. Locate flexagon.fd.install.root folder for your FlexDeploy installation, which is FlexDeploy application directory. This is specified on the Java command line. For example, -Dflexagon.fd.install.root=/u01/flexdeploy/application.

    • You can look for this information in setenvoverride.bat or setenvoverride.sh file depending whether using Windows or Unix. 

  3. Create plugins folder if it does not exist under flexagon.fd.install.root folder. Copy files from download zip (#1 above) to this plugins folder.


Step 10. Configure Influx Database

This is a required step that must be executed if this is the first time you are upgrading to a FlexDeploy 6.0 or higher version. Once upgraded, this step shouldn’t be executed again.

Download links for the influx database software and client, if not already downloaded.

Influx database software

Influx database client

Untar the influx database software and client to the desired location.

tar xf <tar file directory>/influxdb2-2.2.0-linux-amd64.tar.gz  --strip-components 1 -C <FLEXDEPLOY_HOME>/influxdb
tar xf <tar file directory>/influxdb2-client-2.2.1-linux-amd64.tar.gz  --strip-components 1 -C <FLEXDEPLOY_HOME>/influxdb

Adjust the influx database configuration file. <FLEXDEPLOY_HOME>/influxdb/config/config.yaml

Linux

cd <FLEXDEPLOY_HOME>
mkdir -p application/vsm
cd influxdb/config
vi config.yaml

Windows

cd <FLEXDEPLOY_HOME>
mkdir application\vsm
cd influxdb\config
edit config.yaml

Change the following locations: You must put absolute path as no environment variables are allowed in this file.

  • bolt-path: from <FLEXDEPLOY_HOME>/influxdb/data/influxd.bolt to <FLEXDEPLOY_HOME>/application/vsm/data/influxd.bolt

  • engine-path: from <FLEXDEPLOY_HOME>/influxdb/data/engine to <FLEXDEPLOY_HOME>/application/vsm/data/engine

  • sqlite-path: <FLEXDEPLOY_HOME>/influxdb/data/influxd.sqlite to <FLEXDEPLOY_HOME>/application/vsm/data/influxd.sqlit

If running FlexDeploy 6.0 or higher, do not use startup.sh as this will not start the influx database. User StartFlexDeploy.sh or StartFlexDeploy.bat.

Now Start FlexDeploy to perform additional steps for InfluxDB.

Linux

cd <FLEXDEPLOY_HOME>
# this will be automatically updated within a FlexDeploy credential (FD_INFLUXDB_ADMIN_TOKEN) on startup so FlexDeploy can connect with the influx database.  
# This will be used in the next setup step.
export INFLUX_DB_TOKEN=<arbitrary value>  
echo ${INFLUX_DB_TOKEN} > application/vsm/.token
./StartFlexDeploy.sh

Windows

cd <FLEXDEPLOY_HOME>
# this will be automatically updated within a FlexDeploy credential (FD_INFLUXDB_ADMIN_TOKEN) on startup so FlexDeploy can connect with the influx database.
# This will be used in the next setup step.
set INFLUX_DB_TOKEN=<arbitrary value>  
echo %INFLUX_DB_TOKEN% > application\vsm\.token
StartFlexDeploy.bat

Once influx and tomcat servers are up, we need to run setup on the influx database.

This setup is only executed the first time upgrading to FlexDeploy 6.0 or higher

Linux

cd <FLEXDEPLOY_HOME>/influxdb
INFLUX_DB_PASSWORD=<arbitrary value>
rm -rf ~/.influxdbv2
./influx setup --bucket flexbucket --token ${INFLUX_DB_TOKEN} --org flexdeploy --username=flexuser --password=${INFLUX_DB_PASSWORD} --host=http://localhost:8086 --force

# need to adjust the influx database retention policy
./influx bucket list
ID                      Name            Retention       Shard group duration    Organization ID Schema Type
8eec65b90f79c55e        _monitoring     168h0m0s        24h0m0s                 9050d0dddc192df9implicit
4d6413cbaad04850        _tasks          72h0m0s         24h0m0s                 9050d0dddc192df9implicit
a3521682726cd901        flexbucket      infinite        168h0m0s                9050d0dddc192df9implicit

# take the ID value for the flexbucket (Name) so we can update the retention policy to 104 weeks or 2 years
./influx bucket update --id a3521682726cd901 --retention 104w

Windows

cd <FLEXDEPLOY_HOME>\influxdb
set INFLUX_DB_PASSWORD=<arbitrary value>
rmdir /s <user directory>\.influxdbv2
influx setup --bucket flexbucket --token %INFLUX_DB_TOKEN% --org flexdeploy --username=flexuser --password=%INFLUX_DB_PASSWORD% --host=http://localhost:8086 --rem force

rem need to adjust the influx database retention policy
influx bucket list
ID                      Name            Retention       Shard group duration    Organization ID Schema Type
8eec65b90f79c55e        _monitoring     168h0m0s        24h0m0s                 9050d0dddc192df9implicit
4d6413cbaad04850        _tasks          72h0m0s         24h0m0s                 9050d0dddc192df9implicit
a3521682726cd901        flexbucket      infinite        168h0m0s                9050d0dddc192df9implicit

rem take the ID value for the flexbucket (Name) so we can update the retention policy to 104 weeks or 2 years
influx bucket update --id a3521682726cd901 --retention 104w

Step 11. Verify Ulimit and adjust if needed (Linux only)

Check your open file limits. Influx opens a large number of files to complete its work.

ulimit -Hn

will show the open file limit for the current user. Make sure you run it as the user who will be executing FlexDeploy and Influx.

If it is less that 65536, raise it or your influxdb log will likely grow very quickly and potentially run you out of disk space.

sudo vi /etc/security/limits.conf

where oracle is the user logged into the box to run FlexDeploy:

oracle soft nofile 16384

oracle hard nofile 65536

Step 12. Start tomcat

If running FlexDeploy 6.0 or higher, do not use startup.sh as this will not start the influx database. User StartFlexDeploy.sh or StartFlexDeploy.bat.

If you did not start FlexDeploy yet (as part of Step 10), then start FlexDeploy using StartFlexDeploy.sh or StartFlexDeploy.bat.

Launch FlexDeploy in your browser - http://<hostname>:<port>/flexdeploy

  • No labels