Skip to content

Commit

Permalink
enhance Readme, add license and contrib files
Browse files Browse the repository at this point in the history
add some checks for shell, perl and python scripts to the Makefile
fix some python warnings
  • Loading branch information
angelabriel committed Dec 18, 2019
1 parent 4dc0a3c commit 5665449
Show file tree
Hide file tree
Showing 9 changed files with 790 additions and 101 deletions.
4 changes: 4 additions & 0 deletions .perlcriticrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# this policy is considered harmful by the wider perl community
[-Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef]

[-Subroutines::ProhibitSubroutinePrototypes]
9 changes: 9 additions & 0 deletions .perltidyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-l=120 # 120 characters per line
-fbl # don't change blank lines
-nsfs # no spaces before semicolons
-baao # space after operators
-bbao # space before operators
-pt=2 # no spaces around ()
-bt=2 # no spaces around []
-sbt=2 # no spaces around {}
-sct # stack closing tokens )}
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist: xenial
before_install:
- sudo apt-get -qq update
- sudo apt-get -qq install shellcheck
- sudo apt-get -qq install libperl-critic-perl
- sudo apt-get -qq install python-flake8
- sudo apt-get -qq install flake8
script:
- make test
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## How to contribute to SAPHanaSR

#### **Did you find a bug?**

* **Do not open up a GitHub issue if the bug is a security vulnerability
in the application**, and instead contact the [security team](mailto:[email protected]).

* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/SUSE/SAPHanaSR/issues).

* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/SUSE/SAPHanaSR/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, including screenshots of what you see when pertinent. You can attach screenshots to the text by drag and dropping them.

#### **Did you write a patch that fixes a bug?**

* Open a new GitHub pull request with the patch.

* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
* Screenshots are appreciated for visual changes, even on CLI outputs.


#### **Do you intend to add a new feature or change an existing one?**

* Please open an [issue](https://github.com/SUSE/SAPHanaSR/issues/new) to discuss your change before writing any code.
* If the changes are visual, consider attaching screenshots showing the before/after change in the GitHub pull request description.
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,14 @@ commit: copy
@echo -e "\e[32mDone\e[0m"

.phony: tarball

.PHONY: checkstyle
checkstyle:
ifneq ($(CHECKSTYLE),0)
find . -type f -exec awk ' /^#!.*bash/{print FILENAME} {nextfile}' {} + | xargs shellcheck -s bash || :
find . -type f -exec awk ' /^#!.*perl/{print FILENAME} {nextfile}' {} + | grep -v .git | xargs perlcritic --gentle || :
find . -name '*.py' | xargs flake8 --ignore=E501 || :
endif

PHONY: test
test: checkstyle
54 changes: 48 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# SAP HANA System Replication (Scale-Up)

The SUSE ScaleUp resource agents to control the SAP HANA database in system replication setups


<!-- [![Build Status](https://travis-ci.org/SUSE/SAPHanaSR.svg?branch=master)](https://travis-ci.org/SUSE/SAPHanaSR) -->


## Introduction

SAPHanaSR provides an automatic failover between SAP HANA nodes with configured System Replication in HANA Scale-Up setups.

This technology is included in the SUSE Linux Enterprise Server for SAP Applications 12 SP2 or later, via the RPM package with the same name.

System replication will help to replicate the database data from one node to another node in order to compensate for database failures. With this mode of operation, internal SAP HANA high-availability (HA) mechanisms and the Linux cluster have to work together.

The SAPHana resource agent performs the actual check of the SAP HANA database instances and is configured as a master/slave resource.
Managing the two SAP HANA instances means that the resource agent controls the start/stop of the instances. In addition the resource agent is able to monitor the SAP HANA databases on landscape host configuration level.

For this monitoring the resource agent relies on interfaces provided by SAP.

As long as the HANA landscape status is not "ERROR" the Linux cluster will not act. The main purpose of the Linux cluster is to handle the take-over to the other site.

Only if the HANA landscape status indicates that HANA can not recover from the failure and the replication is in sync, then Linux will act.

An important task of the resource agent is to check the synchronisation status of the two SAP HANA databases. If the synchronisation is not "SOK", then the
cluster avoids to takeover to the secondary side, if the primary fails. This is to improve the data consistency.

For more information, refer to the ["SAP HANA System Replication Scale-Up - Performance Optimized Scenario" Best Practices guide](https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-12/)

**Note:** To automate SAP HANA SR in scale-out setups, please use the package SAPHanaSR-ScaleOut instead.


## File structure

- `doc` contains readme, license and the PDF with a link to the latest best practice guides;
Expand All @@ -8,12 +39,23 @@
- `test` contains the Perl auxiliary library and scripts that are installed to `/usr/sbin` and `/usr/share/SAPHanaSR/tests`;
- `wizard` contains **two** sets of wizards, one for HAWK and another for HAWK2 and CRM scripts (SLES 12 SP1 and above).

## Building

Running `make` will create a tarball with the sources.
## License

See the [LICENSE](LICENSE) file for license rights and limitations.


## Contributing

If you are interested in contributing to this project, read the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.


## Feedback
Do you have suggestions for improvement? Let us know!

Go to Issues, create a [new issue](https://github.com/SUSE/SAPHanaSR/issues) and describe what you think could be improved.

Feedback is always welcome!


Additionally, it can commit the changes to the OBS, given that the `OBSPROJ` parameter is set and points to a valid local OBS package copy:
``make commit OBSPROJ=~/dev/saphanasr_obs``

Building the package locally is also possible via:
``make build OBSPROJ=~/dev/saphanasr_obs OBSTARG=SLE_12_SP2``
Loading

0 comments on commit 5665449

Please sign in to comment.