The HPE Nimble Storage Application Snapshot Agent for SAP HANA uses the HPE Nimble Storage Snapshot Framework (requires HPE InfoSight login) to support application consistent and integrated storage level snapshots of SAP HANA.
The workflow for the HPE Nimble Storage Application Snapshot Agent for SAP HANA has 3 phases :
-
Pre-Snapshot Operation
In this phase, Nimble OS communicates with the agent to execute a hdbsql command to create a savepoint in the SAP HANA database. Once the savepoint is created, the agent then queries the SAP HANA database to the savepoint identifier. The agent then waits for 60 seconds to allow SAP HANA to write metadata into the file system
-
Storage snapshot creation on Nimble OS
Once the pre-snapshot phase completes, Nimble OS takes the snapshot of all the volumes that form the application storage (consistency group).
-
Post-Snapshot Operation
Nimble OS communicates with the agent again by passing information related to the snapshot completion If the snapshot was successful, the snapshot ID is sent to the agent. The agent then executes another hdbsql command to confirm the backup was successful. If the snapshot failed, the agent will execute a hdbsql statement to that effect.
This implementation of the Agent is in Java with Jetty 8.1 as the servlet container for the REST server.
AgentService.java
has the main method to start the server.SnapshotTaskResourceImpl.java
andAgentResourceImpl.java
classes implement the REST APIs as defined in the documentation for the Nimble Snapshot Framework. These classes are where you would add the code for thepreSnapshot
andpostSnapshot
tasks.- To build and run the application, you need Java and
gradle
installed on your dev machine. - Gradle will use maven central repository to pull down some dependent libraries, so your dev machine needs to be connected to the internet.
Steps to import the project, build and run:
- Download and install Java 8 and latest version of gradle https://gradle.org/install
- Set
GRADLE_HOME
andJAVA_HOME
environment variables to point to the installation directories of Java and Gradle respectively - If you would like to import the project in eclipse, then from the root directory of the repository, run
gradle eclipse
This generates the files required for the project to be imported into eclipse. - To build, run
gradle build
- To run the application via gradle, execute
gradle run
After compilation, the deliverable will be located in build/distributions as a zip file. Uncompressed the deliverable folder would look like this:
nimble-backup-agent-ri
↳ bin
| ↳ nimble-backup-agent-ri
| ↳ sap-hana-backup-agent-config.xml
↳ lib
↳ .jar files
To install the SAP HANA backup agent, perform the following steps:
-
Unzip the deliverable file to your run location on the host machine. This will be referred to as the AGENT-DIR in subsequent steps.
-
Edit the
sap-hana-backup-agent-config.xml
file inAGENT-DIR/bin
and enter the correct configuration information. -
Locate the
ngdbc.jar
file on the SAP HANA host. Use the following command:find / -name ngdbc.jar 2> /dev/null
-
Verify that you have a
.bashrc
file in your home directory. If not, create one and add the following line:#!/bin/bash
-
Set the
SAP_JDBC_DRIVER
environment variable to point to thengdbc.jar
file. The easiest way to do this is to modify the.bashrc
file by adding the following line:export SAP_JDBC_DRIVER=/PATH]/TO/ngdbc.jar
This will ensure that the environment variable for the backup agent user is set at login.
-
To trigger the
.bashrc
to run do:source .bashrc
-
To launch the backup agent:
cd AGENT-DIR/bin ./nimble-sap-agent
This software is licensed under the Apache License version 2.0. Please see the LICENSE file for full terms and conditions.