Setup connectivity to Run (optional)
For Run to work with your SAP HANA database, there are additional steps required to get the latest backup jobs and results.
This section is only required for Run. If you don't want to use Run, you can skip this section.
Create a database user for the agent
Follow these steps to create a database user for the Agent to use to launch backups and restores on your SAP HANA database and grant access to the agent:
-
Create the CXBAGENT database user to be used by the Agent to launch backups and restores on your SAP HANA database.
UserUser must be called CXBAGENT due to the way Agent is configured.
-
If you use HANA Studio, add the user to the SYSTEMDB database with the following privileges:
- BACKUP ADMIN
- BACKUP OPERATOR
- CATALOG READ
- DATABASE BACKUP OPERATOR
- DATABASE RECOVERY OPERATOR
-
If you prefer to use the command line, you can use the following command to create the user:
-
-
Configure HANA Database user for CxBAgent process on each Tenant.
- Create a new user CXBAGENT_TENANT with the following privileges for each tenant database:
- BACKUP ADMIN
- BACKUP OPERATOR
Where:
- TENANT in CXBAGENT_TENANT is the tenant id.
- Create a new user CXBAGENT_TENANT with the following privileges for each tenant database:
-
Create SSO User for SYSTEMDB and each tenant.
Where:
- Hostname: is the hostname of HANA database
- PortNumber: is the port number of nameserver (Ex: 30013 for a nr=00 system)
- password: is the password of CXBAGENT previously created at database level
-
Check if the user has been created properly:
List create entry:
If the user is not listed, check the password of the user and try again.
SAP NoteMore information in SAP Note 2938937 - How to create and access a user key in the hdbuserstore (OSS required)
Test backup launch with this user. You can check the right configuration of your settings using this OS commands:
Configure SUDO actions for user cxbagent
As CxRun Backup Agent is installed on your system to be used by cxbagent os user, we have to grant permissions on sudoers files so this OS user will be able to launch command as Database administrator. We do this with root user
_10visudo -f /etc/sudoers.d/cxbagent
Determine with SHELL is default for your HANA database user at operating system:
_10$ getent passwd hscadm | cut -d\: -f7_10/bin/csh
Add the following entries to editor if your user is using /bin/csh:
_11Runas_Alias CXBAGENT_HANA_ADMIN_USR_1 = <hana_os_username>_11Host_Alias CXBAGENT_HANA_LOCALHOST_1 = <hostname>_11_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c id_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c echo $SAPSYSTEMNAME_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c echo $DIR_INSTANCE_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c /opt/emory/emory*_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c HDBSettings.sh recoverSys.py *_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c hdbsql -U CXBAGENT*_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c hdbsql -U CXBAGENT_<TENANT_1> *_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/csh -c hdbsql -U CXBAGENT_<TENANT_n> *
Add the following entries to editor if your user is using /bin/sh
_11Runas_Alias CXBAGENT_HANA_ADMIN_USR_1 = <hana_os_username>_11Host_Alias CXBAGENT_HANA_LOCALHOST_1 = <hostname>_11_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c id_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c echo $SAPSYSTEMNAME_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c echo $DIR_INSTANCE_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c /opt/emory/emory*_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c HDBSettings.sh recoverSys.py *_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c hdbsql -U CXBAGENT*_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c hdbsql -U CXBAGENT_<TENANT_1> *_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/sh -c hdbsql -U CXBAGENT_<TENANT_n> *
Add the following entries to editor if your user is using /bin/bash
_11Runas_Alias CXBAGENT_HANA_ADMIN_USR_1 = <hana_os_username>_11Host_Alias CXBAGENT_HANA_LOCALHOST_1 = <hostname>_11_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c id_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c echo $SAPSYSTEMNAME_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c echo $DIR_INSTANCE_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c /opt/emory/emory*_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c HDBSettings.sh recoverSys.py *_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c hdbsql -U CXBAGENT *_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c hdbsql -U CXBAGENT_<TENANT_1> *_11cxbagent CXBAGENT_HANA_LOCALHOST_1=(CXBAGENT_HANA_ADMIN_USR_1) NOPASSWD: /bin/bash -c hdbsql -U CXBAGENT_<TENANT_n> *
Where:
- hana_os_username is the OS username for HANA database
- hostname is the hostname of the current HANA server
Check the sudo configuration
If you have followed the previous steps correctly, the following output should be displayed:
Change to cxbagent os username and execute the following:
_10> visudo -l
_10cxbagent@emoryhana1:~> sudo -l_10User cxbagent may run the following commands on emoryhana1:_10 (ALL) ALL_10 (hscadm) NOPASSWD: /bin/sh -c id_10 (hscadm) NOPASSWD: /bin/sh -c echo $SAPSYSTEMNAME_10 (hscadm) NOPASSWD: /bin/sh -c /opt/emory/emory*_10 (hscadm) NOPASSWD: /bin/sh -c hdbsql -U CXBAGENT *
Test
User cxbagent OS username you should be able to execute the following commands:
_10sudo -i -u <hana_os_user> -g <hana_os_group> id_10sudo -i -u <hana_os_user> -g <hana_os_group> echo $SAPSYSTEMNAME
Add an agent to manage the database
-
Using the cxbagent, add a new database to be managed by the agent by using the add command as user cxbagent:
Our recommendation is to name the agent after the database name for easy reference.
Example/opt/cxbagent/cxbagent add HANA_HSC hscadm sapsys org_uuid_1 api_key Stage=Production,Team=Marketing
-
You can display configured agents for your system by using the list command:
And expected output must be:
tipList of database administrators on cxbagent catalog: 1 - HANA_HDB User: hdbadm Group: sapsys OrgUUID: XXXXXXXXXXXX-YYYY-YYYY-YYYY-XXXXXXXXXXXX Apikey: 012345678901234567890123456789 2 - HANA_HSC User: hscadm Group: sapsys OrgUUID: XXXXXXXXXXXX-YYYY-YYYY-YYYY-XXXXXXXXXXXX Apikey: 012345678901234567890123456789
OrgUUID and Apikey can be obtained from CxLink Portal, in the Organizations section under Account settings:
Enable notifications from backint to agent
As Backint can run independently, notifications are disabled by default. But you can enable notifications from backint to agent by using the following command:
-
Enable using SAP HANA Administrator user:
-
Enable using cxbagent user:
Start Agent daemon
If this is the first time you are running the Agent on your system, you will need to configure the daemon. From root user account, reload daemon configuration, enable service and start it:
-
Reload configuration
_10systemctl daemon-reload -
Enable daemon to start after system reboot
_10systemctl enable cxbagent.service -
Start Agent daemon
_10systemctl start cxbagent.service -
Check daemon status
_10systemctl status cxbagent.serviceinfoAgent listens on 127.0.0.1:42586 so database backint tool (backint) can talk to this agent. If you choose to change its address or port, this change has to be reflected on backint configuration.