Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-3696 - Initial commit of ConfigMigration and FileManager tools #1889

Closed
wants to merge 4 commits into from

Conversation

YolandaMDavis
Copy link
Contributor

@YolandaMDavis YolandaMDavis commented Jun 5, 2017

Usage information for this tool is below and is also included in the PR here:
https://github.com/YolandaMDavis/nifi/blob/f347869ceefd65d570fa5f9ab6d8daa6db2f4b57/nifi-docs/src/main/asciidoc/administration-guide.adoc

File Manager

The File Manager utility allows system administrators to take a backup of an existing NiFi installation, install a new version of NiFi
in a designated location (while migrating any previous configuration settings) or restore an installation from a previous backup.
File Manager supports NiFi version 1.0.0 and higher and is available in 'file-manager.bat' file for use on Windows machines.

To show help:

file-manager.sh -h

The following are available options:

  • -o,--operation <arg> File operation (install | backup | restore)
  • -b,--backupDir <arg> Backup NiFi Directory (used with backup or restore operation)
  • -c,--nifiCurrentDir <arg> Current NiFi Installation Directory (used optionally with install or restore operation)
  • -d,--nifiInstallDir <arg> NiFi Installation Directory (used with install or restore operation)
  • -i,--installFile <arg> NiFi Install File (used with install operation)
  • -r,--nifiRollbackDir <arg> NiFi Installation Directory (used with install or restore operation)
  • -t,--bootstrapConf <arg> Current NiFi Bootstrap Configuration File (used optionally)
  • -m,--moveRepositories Allow repositories to be moved to new/restored nifi directory from existing installation, if available (used optionally with install or restore operation)
  • -x,--overwriteConfigs Overwrite existing configuration directory with upgrade changes (used optionally with install or restore operation)
  • -v,--verbose Verbose messaging (optional)
  • -h,--help Print help info (optional)

Example usage on Linux:

 ./file-manager.sh
 -o backup
 –b /tmp/nifi_bak
 –c /usr/nifi_old
 -v
  • backup NiFi installation
  • option -t may be provided to ensure backup of external boostrap.conf file
./file-manager.sh
 -o install
 –i nifi-1.3.0.tar.gz
 –d /usr/nifi
 –c /usr/nifi/nifi_old
 -t /usr/nifi/old_conf/bootstrap.conf
 -v
 -m
  • install NiFi using compressed tar file into /usr/nifi directory (should install as /usr/nifi/nifi-1.3.0).
  • migrate existing configurations with location determined by external bootstrap.conf and move over repositories from nifi_old
  • options -t and -c should both be provided if migration of configurations, state and repositories are required
 ./file-manager.sh
 -o restore
 –b /tmp/nifi_bak
 –r /usr/nifi_old
 –c /usr/nifi
 -m
 -v
  • restore NiFi installation from backup directory and move back repositories
  • option -t may be provided to ensure bootstrap.conf is restored to the file path provided, otherwise it is placed in the
  • default directory under the rollback path (e.g. /usr/nifi_old/conf)

Expected Behavior

Backup:

During the backup operation a backup directory is created in a designated location for an existing NiFi installation. Backups will capture all critical files
(including any internal or external configurations, libraries, scripts and documents) however it excludes backing up repositories and logs due to potential size.
If configuration/library files are external from the existing installation folder the backup operation will capture those as well.

Install:

During the install operation File Manager will perform installation using the designated NiFi binary file (either tar.gz or zip file)
to create a new installation or migrate an existing nifi installation to a new one. Installation can optionally move repositories (if located within the configuration
folder of the current installation) to the new installation as well as migrate configuration files to the newer installation.

Restore:

The restore operation allows an existing installation to revert back to a previous installation. Using an existing backup directory (created from the backup operation)
the FileManager utility will restore libraries, scripts and documents as well as revert to previous configurations.

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically master)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

@YolandaMDavis YolandaMDavis changed the title NIFI-3696 - initial commit of ConfigMigration and FileManager tools NIFI-3696 - Initial commit of ConfigMigration and FileManager tools Jun 5, 2017
–c /usr/nifi_old
-v

# install NiFi using compressed tar file into /usr/nifi directory (should install as /usr/nifi/nifi-1.3.0).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should notify the user that if they upgrade with -m to also move repositories, start nifi, then try to downgrade, it's likely that the older implementation will not be able to read the newer repos.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brosander agreed will update the admin guide and will also add verbose information during install execution.

@brosander
Copy link
Contributor

brosander commented Jun 7, 2017

+1 on condition that we document limitations of downgrade with respect to repos

@YolandaMDavis
Copy link
Contributor Author

@brosander I've added updates to documentation as well as additional verbose information as recommended. please let me know if you see any additional issues

@asfgit asfgit closed this in 8ef4fdd Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants