Thursday 13 April 2017

SAP PDMS 1.0 FP02 On-premise edition 1.0 (Installation – Pt.1)

SAP Predictive Maintenance and Service, on-premise edition supports customers with a unified solution for operators looking to identify issues in large fleets of machines as well as to improve after-sales services and optimize service planning for individual machines.

The following image gives you an overview of what business users see when they work with the asset health control center, to get further detailed information about an asset health status, business users can go to the asset health fact sheet:

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

In the first part of my documentation (pt.1), I’ll explain and show in detail how to proceed with the mandatory landscape and component setup of the SAP Predictive Maintenance and Service solution.

In the second part (pt.2) I will explain and show how to install and configure a Raspberry PI with GroovePI to generate sensor data and store them in SQL Server

In the last part (pt.3) I will explain how to configure the applications (Thin Model Service, DSS and Insight Provider)

For my setup I’ll use my own lab on VMware vSphere 6.0 to virtualize all my server and a Raspberry PI 3 with GroovePI for sensor device.

I’ll will create a new environment by using vm template explain in my previous documentation.

In order execution


As mentioned previously, SAP Predictive Maintenance and Service require two mandatory component and one add-on within Hana, to be installed:
  • XSA 1.0 including the standard application for administration (XS Monitoring) and job scheduling (XS Services)
  • Hana Rules Framework 1.0
  • R 3.2.3 and Rserve 1.7.3

Important: SAP PDMS1.0 FP02 is not supported on a SAP Hana database that use MDC.

Once the landscape is installed, the SAP Predictive Maintenance and Service software needs to be deployed. The deployment consist of the below activities:
  • Download the PDMS software
  • Create the PDMS user space in XSA
  • Download or create the extension file for component installation
  • Create PDMS technical user for application
  • Create the schemas required for the installation
  • Install Product Instance 1
  • Create role collection and assign to user
  • Install all remaining Product Instance

When the SAP Predictive Maintenance and Service software is installed the next step is to perform the setup for data science service, which consist of:
  • Install the R package required to work with data science service on RServe

Testing url and services
  • Test PDMS urls.
  • Test the installation of Data Science Service

Guide used
  • Installation of SAP Predictive Maintenance and Service, on-premise edition 1.0 FP02
  • SAP HANA Administration Guide SP12
  • SAP HANA R Integration Guide

Note used
  • 2283623 – SAP Predictive Maintenance and Service, on-premise edition 1.0 FP02
  • 2297816 – SAP HANA Smart Data Integration SPS 02 Rev 02
  • 2185029 – SAP HANA and R compatibility and support


High-Level Architecture overview


SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

From a high level architecture point of view I’ll deploy 3 vms all registered in my internal DNS
vmhana01 – Master Hana single mode
vmscience – R Server
vmsql2012 – SQL Server 2012
Raspberry PI with GroovePI 

Detail Architecture


SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

All the environment will be running on SLES 12 SP1, except for SQL server which will sit on Windows 2012 R2 server, the diagram above provide an overview of the components/software interaction.

SAP HANA 1.0 SP12 (Including: XSA, Hana Rules Framework 1.0 )
In the context of SAP PDMS, XSA needs to be install on top of Hana in order to deploy the PDMS application, on Hana itself the HRF 1.0 add-on needs to be install since it is mandatory to run Insight provider.

R 3.2.5 and Rserve 1.7.3
SAP has tested the SAP HANA integration with R version 2.15 only, this component is mandatory for data science service

Raspberry PI with GroovePI (optional)
As an optional component in my scenario, I’ll use my physical Raspberry PI 3 model B with a GroovePI component in order to data from various sensor such as: temperature and humidity, and light.

Microsoft Server 2012 R2 with SDI agent installed on the server (optional)
For my document I will deploy a MS SQL server in order to store my sensor data, the SDI 2.0 agent will be installed on the same server and connect to Hana to retrieve the data

SAP PDMS Product Instance


In SAP PDMS, product instance consist of different subsequent part of landscape deployment such as:

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

The picture below illustrate the all the product install listed above.

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP PDMS mandatory component


XSA 1.0 including the standard application for administration

As mentioned earlier, SAP PDMS needs specific mandatory components to be able to be deploy and run, the first piece of the puzzle consist to install XSA on my Hana instance with XS monitoring and XS service tool.

I start to download the component and store it, from “support package and patch”

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Download the components from the list

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications
path level 32 or 34

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications
SP02

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications
SP02

Once completed, from the resident hdblcm folder as root, I run the installation of XSA combine with the 2 application

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

During the installation process pay attention to the XS Controller API url

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Once installed, I’ll access the API URL endpoint first and then log into XSA

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

And finally run the “xs apps” command just to see which application is running

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

This done I can go to the next phase with installation of the Hana Rules Framework 1.0

Hana Rules Framework 1.0


I start the download from “Installation & upgrade” path

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Once downloaded I run the installation from the downloaded folder by “hdbalm”

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

The install done, I can move forward with the next component to be installed

R 3.2.5 and Rserve 1.7.3 installation


For my setup my R and Rserve will be install on a SLES 11.3 VM that I have already prepared, the necessary latest package to install the software are installed on the server:
  • xorg-x11-devel
  • gcc
  • gcc-fortran
  • readline-devel
  • Java

From the cran website I download the version 3.2.5 of R because the 3.3.x has not been tested yet

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

And Rserve 1.7.3

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

My download ready I decompress the R package and compile it

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Run the following command to install R

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Once done check in the “/usr/local/bin” directory

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

R now installed I will install and configure Rserve, from the “/usr/local/bin” directory I execute R and run the Rserve package

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Now done I configure Rserve by creating the Rserv.conf file

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

And I finally start Rserve in order to access it from Hana, from the “/usr/local/lib64/R/bin” folder

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Rserve is up now so I’m going to configure Hana so I can connect to it, from the “indexserver.ini -> calcengine” I will add 3 parameter:
  • cer_rserve_addresses –> location where the server is running
  • cer_timeout –> Connection timeout in seconds
  • cer_rserve_maxsendsize –> Maximum size of a result transferred from R to SAP HANA, in kilobyte

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

The baseline for R is done I will then install the dependent R package on RServe, I will download the package “dplyr , magrittr , survival , data.table , emdis” and installed them manually.

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Note: Some dependency may exist for package install which will prevent you to install the necessary if not install, make sure to install them first.

Here the list of package dependency at the time I build the documentation by package
  • Dplyr (‘assertthat’, ‘R6’, ‘Rcpp’, ‘tibble’, ‘magrittr’, ‘lazyeval’, ‘DBI’, ‘BH’)

Once installed run the package install in the order as below
  1. setwd(“/media/R/R_indep_pack”)    –> this line set R for the package location
  2. install.packages(“magrittr_1.5.tar.gz”, repos = NULL, type=”source”)
  3. install.packages(“dplyr_0.5.0.tar.gz”, repos = NULL, type=”source”)
  4. install.packages(“survival_2.40-1.tar.gz”, repos = NULL, type=”source”)
  5. install.packages(“data.table_1.10.4.tar.gz”, repos = NULL, type=”source”)
  6. install.packages(“emdist_0.3-1.tar.gz”, repos = NULL, type=”source”)

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

All mandatory component are installed and ready for SAP PDMS, I can proceed with main component installation.

SAP PDMS installation


To begging I will start to download the necessary software to run the installation.

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Now from XSA I will create the user space pdms-op and switch into it, this can be done from command or the XSA admin page. I will use the command line.
This user space is necessary to run the installation

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Now done I will download all the extension files which contain details of the user-provided service from the note 2283623.

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

You can either create them but I will recommend you to use a YAML validator

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

After all .mtaext are downloaded we I need to edit the necessary input in the “pdms-router.mtaext” which contain all the application setting such as: hana hostname, port, technical user to use, password and URLs.

Note: since I’m not using any CRM or ERP to connect to my PDMS system I will not configure any url in the “ahcc.mtaext” file.

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

From the file “pdms-router.mtaext” technical user are listed in order to works with the applications:

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

I run the following SQL command to create all of them

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

The next phase is now to create the relevant schema required for the installation of each application

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Now done, I can run the PDMS application installation, I’ll install the “Product Instance 1” first by running following xs command from the from the folder where the PDMS zip file reside

“xs install SAPPDMSONPR02P_3-71002247.ZIP -i 1 -e pdms-router.mtaext,ahcc.mtaext,derived-signals.mtaext,work-activity.mtaext”

Note: Make sure you are in the user space “pdms-op” before to run the install

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

In case error happen during the deployment of any apps, you can check the error by executing the following command “ xs logs <app> –last 1000″

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Once the Instance 1 is installed I check the running apps

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

I will now from the role builder create role collection, assign to necessary role template and grant them to the user

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

I create the following role collection associate with the template below

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Finally once all my role are created, from the Hana webide/security I will provide the role create and additional privilege to the necessary user such as below.

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Once done for all the user I install the remain Product Instance by issuing the following command

“xs install SAPPDMSONPR02P_3-71002247.ZIP -e pdms-router.mtaext,ahcc.mtaext,derived-signals.mtaext,work-activity.mtaext -o ALLOW_SC_SAME_VERSION”

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Data Science Service on RServe


The main software component for PDMS are now fully installed, I will install the R Packages for DSS on Rerve.

I start to decompress the PDMS the zip archive in a separate folder

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

From this folder I locate the XSACPDMSDSRLIB02_0.ZIP and decompressed it too

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Once done for the R server, I will load this package into it

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

The last package “com.sap.pdms.datascience.tar.gz” required dependency package to be installed “reshape2”,” plyr”,” stringr”,” stringi”

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

Testing services and URLs


Now the all mandatory component for PDMS are installed and up and running I will test different url to make sure I can access them and also check the DSS (Data Science Service) installation.

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

The first url I will test is the AHCC, which is the url use by the user who access the Asset Health Fact Sheet application

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

The next url I will test now is the Launchpad, basically this url is the configuration url role based on different user

PDMS_APP_USER

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

PDMS_TECH_USER

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

PDMS_DS_ADMIN

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

And finally I will test the rest call for DSS in order to make sure that my service working fine, the url should return all package installed and validated the version

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

I have tested all the necessary url and no error return, the following diagram expose the communication channels and interfaces

SAP HANA Tutorials and Materials, SAP HANA Guide, SAP HANA Certifications

No comments:

Post a Comment