Thursday, July 15, 2021

LOMD - User guide for LMOD

 https://lmod.readthedocs.io/en/latest/010_user.html

 

 

User Guide for Lmod

The guide here explains how to use modules. The User’s tour of the module command covers the basic uses of modules. The other sections can be read at a later date as issues come up. The Advance user’s guide is for users needing to create their own modulefiles.

User’s Tour of the Module Command

The module command sets the appropriate environment variable independent of the user’s shell. Typically the system will load a default set of modules. A user can list the modules loaded by:

$ module list

To find out what modules are available to be loaded a user can do:

$ module avail

To load packages a user simply does:

$ module load package1 package2 ...

To unload packages a user does:

$ module unload package1 package2 ...

A user might wish to change from one compiler to another:

$ module swap gcc intel

The above command is short for:

$ module unload gcc
$ module load intel

A user may wish to go back to an initial set of modules:

$ module reset

This will unload all currently loaded modules, including the sticky ones, then load the list of modules specified by LMOD_SYSTEM_DEFAULT_MODULES. There is a related command:

$ module restore

This command will also unload all currently loaded modules, including the sticky ones, and then load the system default unless the user has a default collection. See User Collections for more details.

If a module is not available then an error message is produced:

$ module load packageXYZ
Warning: Failed to load: packageXYZ

It is possible to try to load a module with no error message if it does not exist. Any other failures to load will be reported.:

$ module try-load packageXYZ

Modulefiles can contain help messages. To access a modulefile’s help do:

$ module help packageName

To get a list of all the commands that module knows about do:

$ module help

The module avail command has search capabilities:

$ module avail cc

will list for any modulefile where the name contains the string “cc”.

Users may wish to test whether certain modules are already loaded:

$ module is-loaded packageName1 packageName2 ...

Lmod will return a true status if all modules are loaded and a false status if one is not. Note that Lmod is setting the status bit, there is nothing printed out. This means that one can do the following:

$ if module is-loaded pkg ; then "echo pkg is loaded"; fi

Users also may wish to test whether certain modules can be loaded with the current $MODULEPATH:

$ module is-avail packageName1 packageName2 ...

Lmod will a true status if all modules are available and false if one can not be loaded. Again this command sets the status bit.

Modulefiles can have a description section known as “whatis”. It is accessed by:

$ module whatis pmetis
pmetis/3.1  : Name: ParMETIS
pmetis/3.1  : Version: 3.1
pmetis/3.1  : Category: library, mathematics
pmetis/3.1  : Description: Parallel graph partitioning..

Finally, there is a keyword search tool:

$ module keyword word1 word2 ...

This will search any help message or whatis description for the word(s) given on the command line.

Another way to search for modules is with the “module spider” command. This command searches the entire list of possible modules. The difference between “module avail” and “module spider” is explained in the “Module Hierarchy” and “Searching for Modules” section.:

$ module spider

Specifying modules to load

Modules are a way to ask for a certain version of a package. For example a site might have two or more versions of the gcc compiler collection (say versions 7.1 and 8.2). So a user may load:

$ module load gcc

or:

$ module load gcc/7.1

In the second case, Lmod will load gcc version 7.1 where as in the first case Lmod will load the default version of gcc which normally be 8.2 unless the site marks 7.1 as the default.

In this user guide, we call gcc/7.1 the fullName of the module and gcc as the shortName. We also call what the user asked for as the userName which could either be the fullName or the shortName depending on what the user typed on the command line.

Showing the contents of a module

There are several ways to use the show sub-command to show the contents of a modulefile. The first is to show the module functions instead of executing them:

$ module show gcc

This shows the functions such as setenv () or prepend_path () but nothing else. If you want to know the contents of the modulefile you can use:

$ module --raw show gcc

This will show the raw text of the modulefile. This is same as printing the modulefile, but here Lmod will find the modulefile for you. If you want to know just the location of a modulefile do:

$ module --redirect --location show gcc

You will probably use the –redirect option so that the output goes to stdout and not stderr.

If you want to know how Lmod will parse a TCL modulefile you can do:

$ tclsh $LMOD_DIR/tcl2lua.tcl  <path_to_TCL_modulefile>

This useful when there is some question on how Lmod will treat a TCL modulefile.

ml: A convenient tool

For those of you who can’t type the mdoule, moduel, err module command correctly, Lmod has a tool for you. With ml you won’t have to type the module command again. The two most common commands are module list and module load <something> and ml does both:

$ ml

means module list. And:

$ ml foo

means module load foo while:

$ ml -bar

means module unload bar. It won’t come as a surprise that you can combine them:

$ ml foo -bar

means module unload bar; module load foo. You can do all the module commands:

$ ml spider
$ ml avail
$ ml show foo

If you ever have to load a module name spider you can do:

$ ml load spider

If you are ever forced to type the module command instead of ml then that is a bug and should be reported.

clearLmod: Complete remove Lmod setup

It is rare, but sometimes a user might need to remove the Lmod setup from their current shell. This command can be used with bash/zsh/csh/tcsh to remove the Lmod setup:

$ clearLmod

This command prints a message telling the user what it has done. This message can be silented with:

$ clearLmod --quiet

SAFETY FEATURES

(1): Users can only have one version active: The One Name Rule

If a user does:

$ module avail xyz

--------------- /opt/apps/modulefiles ----------------
xyz/8.1   xyz/11.1 (D)   xyz/12.1

$ module load xyz
$ module load xyz/12.0

The first load command will load the 11.1 version of xyz. In the second load, the module command knows that the user already has xyz/11.1 loaded so it unloads that and then loads xyz/12.0. This protection is only available with Lmod.

This is known as the One Name rule. This feature is core to how Lmod works and there is no way to override this.

(2) : Users can only load one compiler or MPI stack at a time.

Lmod provides an additional level of protection. If each of the compiler modulefiles add a line:

family("compiler")

Then Lmod will not load another compiler modulefile. Another benefit of the modulefile family directive is that an environment variable “LMOD_FAMILY_COMPILER” is assigned the name (and not the version). This can be useful specifying different options for different compilers. In the High Performance Computing (HPC) world, the message passing interface (MPI) libraries are important. The mpi modulefiles can contain a family(“MPI”) directive which will prevent users from loading more than one MPI implementation at a time. Also the environment variable “LMOD_FAMILY_MPI” is defined to the name of the mpi library.

Module Hierarchy

Libraries built with one compiler need to be linked with applications with the same compiler version. If sites are going to provide libraries, then there will be more than one version of the library, one for each compiler version. Therefore, whether it is the Boost library or an mpi library, there are multiple versions.

There are two main choices for system administrators. For the XYZ library compiled with either the UCC compiler or the GCC compiler, there could be the xyz-ucc modulefile and the xyz-gcc module file. This gets much more complicated when there are multiple versions of the XYZ library and different compilers. How does one label the various versions of the library and the compiler? Even if one makes sense of the version labeling, when a user changes compilers, the user will have to remember to unload the ucc and the xyz-ucc modulefiles when changing to gcc and xyz-gcc. If users have mismatched modules, their programs are going to fail in very mysterious ways.

A much saner strategy is to use a module hierarchy. Each compiler module adds to the MODULEPATH a compiler version modulefile directory. Only modulefiles that exist in that directory are packages that have been built with that compiler. When a user loads a particular compiler, that user only sees modulefile(s) that are valid for that compiler.

Similarly, applications that use libraries depending on MPI implementations must be built with the same compiler - MPI pairing. This leads to modulefile hierarchy. Therefore, as users start with the minimum set of loaded modules, all they will see are compilers, not any of the packages that depend on a compiler. Once they load a compiler they will see the modules that depend on that compiler. After choosing an MPI implementation, the modules that depend on that compiler-MPI pairing will be available. One of the nice features of Lmod is that it handles the hierarchy easily. If a user swaps compilers, then Lmod automatically unloads any modules that depends on the old compiler and reloads those modules that are dependent on the new compiler.

$ module list

1) gcc/4.4.5 2) boost/1.45.0

$ module swap gcc ucc

Due to MODULEPATH changes the follow modules have been reloaded: 1) boost

If a modulefile is not available with the new compiler, then the module is marked as inactive. Every time MODULEPATH changes, Lmod attempts to reload any inactive modules.

Searching For Modules

When a user enters:

$ module avail

Lmod reports only the modules that are in the current MODULEPATH. Those are the only modules that the user can load. If there is a modulefile hierarchy, then a package the user wants may be available but not with the current compiler version. Lmod offers a new command:

$ module spider

which lists all possible modules and not just the modules that can be seen in the current MODULEPATH. This command has three modes. The first mode is:

$ module spider

lmod: lmod/lmod
Lmod: An Environment Module System

ucc: ucc/11.1, ucc/12.0, ...
Ucc: the ultimate compiler collection

xyz: xyz/0.19, xyz/0.20, xyz/0.31
xyz: Solves any x or y or z problem.

This is a compact listing of all the possible modules on the system. The second mode describes a particular module:

$ module spider ucc
----------------------------------------------------------------------------
ucc:
----------------------------------------------------------------------------

Description:
Ucc: the ultimate compiler collection

Versions:
ucc/11.1
ucc/12.0

The third mode reports on a particular module version and where it can be found:

$ module spider parmetis/3.1.1
----------------------------------------------------------------------------
parmetis: parmetis/3.1.1
----------------------------------------------------------------------------
Description:
Parallel graph partitioning and fill-reduction matrix ordering routines

This module can be loaded through the following modules:
ucc/12.0, openmpi/1.4.3
ucc/11.1, openmpi/1.4.3
gcc/4.4.5, openmpi/1.4.3

Help:
The parmetis module defines the following environment variables: ...
The module parmetis/3.1.1 has been compiled by three different versions of the ucc compiler and one MPI implementation.

Controlling Modules During Login

Normally when a user logs in, there are a standard set of modules that are automatically loaded. Users can override and add to this standard set in two ways. The first is adding module commands to their personal startup files. The second way is through the “module save” command.

To add module commands to users’ startup scripts requires a few steps. Bash users can put the module commands in either their ~/.profile file or their ~/.bashrc file. It is simplest to place the following in their ~/.profile file:

if [ -f ~/.bashrc ]; then
   .   ~/.bashrc
fi

and place the following in their ~/.bashrc file:

if [ -z "$BASHRC_READ" ]; then
   export BASHRC_READ=1
   # Place any module commands here
   # module load git
fi

By wrapping the module command in an if test, the module commands need only be read in once. Any sub-shell will inherit the PATH and other environment variables automatically. On login shells the ~/.profile file is read which, in the above setup, causes the ~/.bashrc file to be read. On interactive non-login shells, the ~/.bashrc file is read instead. Obviously, having this setup means that module commands need only be added in one file and not two.

Csh users need only specify the module commands in their ~/.cshrc file as that file is always sourced:

if ( ! $?CSHRC_READ ) then
   setenv CSHRC_READ 1
   # Place any module command here
   # module load git
endif

User Collections

User defined initial list of login modules:

Assuming that the system administrators have installed Lmod correctly, there is a second way which is much easier to setup. A user logs in with the standard modules loaded. Then the user modifies the default setup through the standard module commands:

$ module unload XYZ
$ module swap gcc ucc
$ module load git

Once users have the desired modules load then they issue:

$ module save

This creates a file called ~/.lmod.d/default which has the list of desired modules. Once this is set-up a user can issue:

$ module restore

and only the desired modules will be loaded. If Lmod is setup correctly (see Providing A Standard Set Of Modules for all Users) then the default collection will be the user’s initial set of modules.

If a user doesn’t have a default collection, the Lmod purges ALL currently loaded modules, including the sticky ones, and loads the list of module specified by LMOD_SYSTEM_DEFAULT_MODULES just like the module reset command.

Users can have as many collections as they like. They can save to a named collection with:

$ module save <collection_name>

and restore that named collection with:

$ module restore <collection_name>

A user can print the contents of a collection with:

$ module describe <collection_name>

A user can list the collections they have with:

$ module savelist

Finally a user can disable a collection with:

$ module disable <collection_name>

If no collection_name is given then the default is disabled. Note that the collection is not remove just renamed. If a user disables the foo collection, the file foo is renamed to foo~. To restore the foo collection, a user will have to do the following:

$ cd ~/.lmod.d; mv foo~ foo

Rules for loading modules from a collection

Lmod has rules on what modules to load when restoring a collection. Remember that userName is what the user asked for, the fullName is the exact module name and shortName is name of the package (e.g. gcc, fftw3).

  1. Lmod records the fullName and the userName in the collection.
  2. If the userName is the same as the fullName then it loads fullName independent of the default.
  3. if the userName is not the same as the fullName then it loads the default.
  4. Unless LMOD_PIN_VERSIONS=yes then the fullName is always loaded.

In other words if a user does:

$ module --force purge; module load A B C
$ module save

then “module restore” will load the default A, B, and C. So if the default for module A changed between when the collection was saved and then restored, a new version of A will be loaded. This assumes that LMOD_PIN_VERSIONS is not set. If it is set or Lmod is configured that way then if A/1.1, B/2.4 and C/3.3 are the default then those modules will be loaded in the future independent of what the defaults are in the future.

On the other hand:

$ module --force purge; module load A/1.0 B/2.3 C/3.4
$ module save

then “module restore” will load the A/1.0, B/2.3, and C/3.4 independent of what the defaults are now or in the future.

User Collections on shared home file systems

If your site has a shared home file system, then things become a little more complicated. A shared home file system means that your site has a single home file system shared between two or more clusters. See Lmod on Shared Home File Systems for a system administrators point of view.

If you have a collection on one cluster it needs to be independent of another cluster. Your site should set $LMOD_SYSTEM_NAME uniquely for each cluster. Suppose you have cluster A and B. Then $LMOD_SYSTEM_NAME will be either A or B. A default collection will be named “default.A” for the A cluster and “default.B” for the B cluster. The names a user sees will have the extension removed. In other words on the A cluster a user would see:

$ module savelist

  1) default

where the default file is named “default.A”.

Wednesday, July 14, 2021

git - an introduction

 Revert the change
- Rollback file changes
- Commit Amend
- Commit Revert
- Delete untracked files

1. Roll back changes



===================

checkout
- you want to download a file from server to your client system (workspace).
you get a file from repo.
- modify the file and upload to remote server (repo) is checkin.

all the record who,what,when modified is recorded (metadata).



Server (repo)
Client (Workspace)
  - Workspace1
  - workspace2

why they use git compare to other tool?

Git
- cameout if linux development community
- Linux Torvalds - 2005
- Initial goals
  - speed
  - supported for non -linear development (thousands of paraller parallel branches)
  - Fully distributed
  - Able to handle large projects like linux efficiently

Distributed vs Centralized

Centralized model (CVS,Subversion,perforce)
Distributed model (Git, mercurial)


Central VCS Server
- Computer A
- Computer B

* network issue/latency

- Git takes snapshots
- Git uses checksums
  commit ID(SHA-1 Hash)
  Tree object: ID -> snapshot of the filesystem
  Author: Bill Johnson
  Commit Message: Initial Commit

Workspace is a folder where you will be working. This is going to be your local repository.
Inside your workarea, you are going to have three areas.

  Working area
  Staging area
  repo

When you do checkout, all the files are stored in working directory.
This is where you create and save the files.
But the process work little differently.
In git, you don't directly checkin. You checkout, modify the code/files in your working directory and then you are going to take the code into a new area called staging area. This is where git will take a snapshot.

From the staging area, you will be actually doing checkin. Now, content will be saved into repo (local).

Now, repository as well as staging area is hidden area for you. It is infact, not a folder but a virtual space that is available logically. This how it is created internally.


All the commits are stored in repository. The place you will be working is working directory.

First you create a file in working directory -> to modify you move the file to staging area and finally save on repo.

When file is first created, it is untracked file. There is no information about the file in repository thats why it is untacked file.

When file is put into repository, file is tracked file. what that mean? - that mean file is traceable by git.

When there is no difference between a file in Workspace and repo then the file is unmodified file. Once you modified the file, the difference between repository file and what you have been changed. This file is called modified file.

when you try to put this file in staging area, the file is called staged file.
When you try to store, you try to store in repository. Now, content on repo and the workspace is same or unmodified file.

Life cycle of a file is that a very new file, that is not available at repository is untracked file.
When you do checkout all the files are unmodified. When you make changes they are modified. When you put into staging area, they are staged.
From stage, you are going to commit.


what is github?
- it is a site for online storage of git repositories.
- Many opensource project use it including linux kernel
- You get a free repo for personal use or project. You can have private repo with some fee.

==========================================

Git workflow

go to github.com and create an accoutn
-> create a new repository
name: myrepo2020 (name of the project product)
public
create repository

now you will get code

copy the path.

central repo: https://github.com/<myrepo>/myrepo2020.git


download client for your PC

search for git-scm

downlod for windows (git-bash)

install and open it.
you will see it like a linux command prompt.

$ ls
$ which git
$ git --version

Basic configuration
- need username, email
$ mkdir classroom/git; cd classroom/git

$ git config --global user.name "Jay K."
$ git config --global user.email "jay@jayk.com"
$ git config --global push.default "Simple"

With this we will create local copy of workspace. For this you need central repository.

make a copy of
$ git clone <source-central-repo> <dest-local-repo>
$ git clone https://github.com/<myrepo>/myrepo2020.git
it will create myrepo2020 on the current directory.
$ ls
you will see the repo.

or,

$ git clone https://github.com/<myrepo>/myrepo2020.git workspace2030

it will create new folder workspace2030 @current directory.

execute the following command
$ echo "First line"> 1.java
$ git status

you see untracked files

put the file in repo, then you will have tracked file.

now, store the file in repo. You can not put file directory in repo. You have to first put the file in staging area and then store in repo permanently.

you have two commands
add- adding file to staging area, creates a copy of file

$ git add <filename> -> adds single file
$ git add * -> adds all files that are modified.

$ git status

no commit yet, changes are ready to be commited.

that mean files are in staging area and ready to save.

$ git commit -m "First change for testing purpose"
-m - message -> what changes you made.


when you do commit,
it will take user name from global config file.
time stamp from machine and detail what it got from snapshot.



$ git status
now file is unmodified.


Now, lets go ahead and modify the file again,

$ echo "Line 2">> 1.java
$ git status

modified
file is modified.

$ cat 1.java

now first you stage the file

$ git add 1.java
$ git status
file is added to staging area

what if you have to modify multiple files
say

$ echo "first line" > 2.java

we have 2.java file.
$ git status
it shows now, there is 1.java file which is modified and 2.java which is untracked.

untracked file is not available in repository.

$ git add . -> all modified file will be added to staging area,

$ git status

Now, lets commit
$ git commit -m "Second commit with set of changes"

$ git status

as a user you keep modify and add to repo.

$ ls

when you run ls, you will not see repository. As we discussed earlier, its a hidden foler.

How to see the repo?
====================

in the current directory, there is a hidden directory .git.
this is where commits are available. You are not supposed to modify manually.
$ ls -la

$ cd .git' ls -la


$ git log
gives you detail about commit

40 digit commit id.
author
date

every commit, you will get unique commit id.

when you run git log you will see latest commit id on the top

to find latest commit id, you can give the number

$ git log -3 -> displays 3 commits

$ git log --online -> gives small output without id and author

$ git log --online -l

$ git show <commit_ID>

git show c54333> -> give 6 letters from commit id.


we learned we have repo, we downloaded and committed.

$ mkdir test
$ git status
$ touch test/file1
$ git status
$ git add .
$ git commit -m "Testing .."


whatever we made changes locally, it is not available on central repository.
to update or share the changes you made locally, you can push.

$ git push

how to changes are tracked? with commit id.

what git will do when you run git push?
git will try to take the commit ids which are not available on central repo but available on local repo. only those commits are going to be pushed.


transaction details are commit ids.

coming back to our workspace, we can see the commit id by running
$ git log --online

you see three changes, three commit id

What happend when you run git push

- it will take all 3 commit ids and going to push to central repository.

first it will try to connect to central repository, if you have not set up already, will prompt for user name and password.

once you supply username/pw, info is pushed to central repo.

go to your online repo repo, you will see the files

now, come back and push again
$ git push

it will say everything up-to-date.

as of now, your local and repote repo are on sync.


How does it know where to push the change?
inside your .git, you have config file

$ cat .git/config

when you run git push, it will read the config file and push to the repo.


There might be multiple user working. They might also clone...
and modify on local repo.

$ mkdir classroom/lab1; cd classroom/lab1
$ git clone https:/github.com/<user-name>/repo-name.git workspace01

all the modification on local repo is only available locally.

$ echo "First line" > 4.java
$ git stauts
untracked
$ git add .
$ git commit -m "added"

$ git log --oneline

displays commit ids.

now to uplod to central repo
$ git push

now, it will only push the one that are changes.

look at the message

go to repote repo and review the changes.


go back to old workspace
but now central repo is updated but this is not updated.
you need to update first that mean pull from central repo

this mean commit id available from central repo, you will be downloading.
$ git log --oneline
$ git pull
update mean -> update with whatever you have on central repo.

$ git log --oneline


review
Configuration
$ git config --global user.name "Jay K"
$ git config --global user.email "jay@jay.com"
$ git config --global push.default "Simple"

User/developer workflow
----------------------
$ git clone <source-central-repo> <dest-local-repo>
$ git clone https:/github.com/<user-name>/repo-name.git myworkspace
$ git status
$ touch myfile; echo "Hello">myfile
$ git status
$ git add <file> or git add .
$ git status
$ git commit -m "mesage"
$ git log -num -ineline
$ git show <commitid>
$ git push
$ git pull

======================
Branch












 






















CommCell - Installing certificate on CommVault Server

 https://documentation.commvault.com/commvault/v11/article?p=50497.htm

 

Creating a CA-Signed Certificate for the Tomcat Server

 

Before You Begin

  • Install the Java Key and the Certificate Management tool. For more information, see keytool - Key and Certificate Management Tool.
  • For the Web Console, perform this task on the Web Console computer.
  • For Compliance Search, perform this task on the Compliance Search computer.
  • If you need to replace an expired CA-signed certificate, back up the existing keystore and server.xml files, and then delete the existing keystore file before creating the new CA-signed certificate.

Procedure

  1. From the command prompt, go to the folder that contains the keytool.exe file:
    • For Windows systems, go to C:\Program Files\Commvault\ContentStore\jre\bin.
    • For Linux systems, go to /usr/lib/jvm/jdkx/bin.
  2. To create the keystore file containing the key-pair/certificate to be signed, run the following command:

    For Windows:

    keytool -genkey -alias tomcat -keyalg RSA -keystore "C:\mykeystore.jks" -ext SAN=dns:<domainname>

    For Linux:

    keytool -genkey -alias tomcat -keyalg RSA -keystore "/mykeystore.jks" -ext
    SAN=dns:<domainname>

    Optionally, you can use an IP address in the SAN using SAN=dns:(domainname),ip:(Tomcat server IP address) instead of SAN=dns:(domainname). However, this is not recommended because if the address changes, you must obtain a new certificate and include the new IP address again.

    Note:

    • This keystore file must be used throughout this procedure.
    • Depending on your browser, you might need to perform additional configurations to complete the creation of a CA-Signed Certificate. For example, for Google Chrome version 58 and later, you must specify the Subject Alternative Name (SAN), while running the keytool command.

    During the command execution, you are prompted to provide information about your organization:

    Parameter

    Description

    Alias

    The alias that is used by Tomcat for reference purposes while importing or installing the certificate. The alias can be any simple name used for cross reference.

    After certificate signing is done by the certificate authority and returned back to the customer, then you must use the same alias to import the certificate.

    Password

    The keystore password. Use a strong password.

    Note: Do not use special characters.

    First and Last name

    The fully qualified domain site name, such as www.someserver.someportal.com, which has to run using HTTPS. If you want to protect several hostnames on the same domain, you must obtain a wildcard certificate and enter the site name, such as *.someportal.com.

    If you enter a value that does not include the starting part of the website URL for which you are requesting the certificate, then the browser might treat the website as an untrusted website. In these cases, an error message such as the following is shown:

    The security certificate presented by this website was issued for a different website's address.

    Note:

    • Always use a fully qualified hostname, for example, www.someserver.someportal.com.
    • If you want to protect more than one host, list all the hostnames. This is useful when you have a single server that is accessed using two different names, depending on where the connection is coming from. The resulting certificate is valid for any of the hostnames.

    Organizational Unit

    Optional: If applicable, you can specify the DBA (Doing Business As) name.

    Organization Name

    The full legal name of your organization.

    The organization name must be the legal registrant of the domain name in the certificate request. If you are enrolling as an individual, enter the certificate requester’s name.

    City / Locality

    The city (without abbreviation) where your organization is located.

    State / Province

    The state or province (without abbreviation) where your organization is located.

    Country Code

    The two letter country code (ISO, International Organization for Standardization, format) where your organization is legally registered.

  3. To generate a CSR, run the following command:

    keytool -certreq -keyalg RSA -alias tomcat -file C:\somename.csr -keystore C:\mykeystore.jks -validity <daysValid> -ext SAN=dns:<domainname>

    Parameter

    Description

    certreq

    Do not remove or change this parameter.

    keyalg

    Do not remove or change this parameter.

    Valid value is RSA.

    Alias

    The same alias name used for generating the keystore.

    File

    The path to the file for CSR creation.

    Keystore

    The path to the keystore that was recently created. You must use the same keystore file throughout this procedure.

    validity

    The number of days the keystore file is valid starting from the day the keystore file is created. Enter a value less than or equal to 397 days.

    Optionally, you can include an IP address in the SAN using SAN=dns:(domainname),ip:(Tomcat server IP address) instead of SAN=dns:(domainname). However, this is not recommended because if the address changes, you must obtain a new certificate and include the new IP address again.

  4. Upload the CSR to the CA website, indicate the type of Tomcat server, and submit for signing.
  5. Download the root, intermediate, and issued server/domain certificates.

    Important: This step might be different based on the CA. Follow the guidelines provided by your CA.

  6. Import each signed certificate that is issued by the CA using the following commands:
    • Root certificate:

      keytool -import -alias root -keystore C:\mykeystore.jks -trustcacerts -file C:\valicert_class2_root.crt

    • Intermediate certificate:

      keytool -import -alias intermed -keystore C:\mykeystore.jks -trustcacerts -file C:\gd_intermediate.crt

    • Issued server/domain certificate:

      keytool -import -alias tomcat -keystore C:\mykeystore.jks -trustcacerts -file C:\server_certificate_whatevername.crt

      Important: The keystore parameter must be the path to the keystore file that was used to generate the CSR. You must use the same keystore file throughout this procedure.

  7. Close the command line.

 

Configuring the SSL Certificate for Tomcat Server

 

Procedure

  1. Stop the Tomcat Server.
  2. Go to software_installation_path/Apache/Conf, and then back up the server.xml file that is part of the Apache configuration.
  3. Copy the generated keystore file to software_installation_path/Apache.
  4. For new installations of Version 11 SP9 or higher, in the server.xml file, modify the path to the generated keystore file and the keystore password values:

    <Certificate certificateKeystoreFile="software_installation_path/Apache/your_file" certificateKeystorePassword="password" certificateKeystoreType="JKS"/> 

    where:

    • software_installation_path/Apache/your_file is the path to your keystore file. You can use the .jks keystore file and set certificateKeystoreType to JKS. You can also use the .pfx, .p12 or .p7b keystore files and set certificateKeystoreType to PKCS12.
    • password is the password that you used to create the keystore or certificate.

    For configuration on SP8 or earlier installations, refer to the corresponding service pack version documentation.

  5. In the server.xml file Connector element associated with port 443, keep the following up to date:
    • SSL protocols: Update the SSLHostConfig element protocols attribute (enable TLSv1.2+TLSv1.3 or a more recent version).
    • Ciphers: Update the SSLHostConfig element ciphers attribute according to your corporate security policy. For a list of ciphers that are considered reasonably secure at this time, see Ciphers for the SSL Connector for Tomcat Server.

      <SSLHostConfig certificateVerification="none" honorCipherOrder="true" protocols="TLSv1.2+TLSv1.3" ciphers="TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256">

  6. Start the Tomcat Server and access the resource on your server using HTTPS.

    For instructions about restarting the Tomcat service, see Restarting a Service.

     

    Restarting a Service on Windows Clients

    When services are running, you can manually restart a service.

    Important: When you restart a service, the dependent services are also restarted. For more information on dependent services, see Service Dependencies.

    Procedure

  7. Click Start and point to All Programs.
  8. Click Commvault > Process Manager.
  9. Under the Services tab, right-click a running service and then click Restart.

 

Configuring Services to Start Automatically After a Client Restarts

You can configure services to start automatically after a client restarts.

Procedure

  1. On the client, go to Start > All Programs > Commvault > Process Manager.

    The Process Manager dialog box appears.

  2. Click the Services tab, and then select the Auto-start when OS starts check box.

 

 

 

 

 

 

 

Automatic startup of Oracle Database RHEL7 using systemd

 #!/usr/bin/bash

# This script configures systemd startup service for Oracle Databases and Listener
# Ivan Kartik http://ivan.kartik.sk


DATE=`/bin/date`
SVCNAME=dbora.service

if [ `whoami` != "root" ]; then
   echo "root login required!"
   exit
fi

if [ `uname -s` != "Linux" ]; then
   echo "This is not Linux!"
   exit
fi

if [ `ps -e|grep " 1 ?"|cut -d " " -f15` != "systemd" ]; then
   echo "Systemd is not present, use Init scripts instead!"
   exit
fi

echo "List of existing Oracle Homes:"
echo "------------------------------"
cat `cat /etc/oraInst.loc|grep inventory_loc|cut -d '=' -f2`/ContentsXML/inventory.xml|grep "HOME NAME"|cut -d '"' -f 4
echo

echo "Enter ORACLE_HOME of Oracle Listener [$ORACLE_HOME]:"
read NEWHOME

case "$NEWHOME" in
     "")         ORAHOME="$ORACLE_HOME" ;;
     *)          ORAHOME="$NEWHOME" ;;
esac

if [ -z $ORAHOME ]; then
   echo "Error: Missing value!"
   exit
fi

if [ -f $ORAHOME/bin/lsnrctl ]; then
   echo '# /etc/systemd/system/oracle-rdbms.service
# Ivan Kartik http://ivan.kartik.sk
#   Invoking Oracle scripts to start/shutdown Instances defined in /etc/oratab
#   and starts Listener

[Unit]
Description=Oracle Database(s) and Listener
Requires=network.target

[Service]
Type=forking
Restart=no
ExecStart='$ORAHOME'/bin/dbstart '$ORAHOME'
ExecStop='$ORAHOME'/bin/dbshut '$ORAHOME'
User=oracle

[Install]
WantedBy=multi-user.target' > /etc/systemd/system/oracle-rdbms.service

    systemctl daemon-reload
    systemctl enable oracle-rdbms
    echo "Done! Service oracle-ordbms has been configured and will be started during next boot."
    echo "If you want to start service now, execute: systemctl start oracle-rdbms"
else
   echo "Error: No Listener script under specified ORACLE_HOME: $ORAHOME"
   exit
fi
 

 

https://ivan.kartik.sk/index.php?controller=post&action=view&id_post=65

 

 

Tuesday, July 13, 2021

SAN topology

 

Multi-PATH SAN topology

 

 

 

$ cat hbainfo
#!/bin/bash
for hosts in $(ls -ld /sys/class/fc_host/host* 2>/dev/null); do
  printf "%-26s %-8s %-20s %-ls\n" "$HOST" "$(cat $HOST/speed)" "$(cat $HOST/port_name)" "$(cat $HOST/port_state)"
done

 

SAN administration
1. Setting up a new server on SAN
a. Connect the server HBA ports to all SAN switches (make a note of ports used)
b. Run hbainfo script on the server to verify connectivity and get the WWN addresses
c. Login to each SAN switch and perform the following:
 i. Locate the connection on the switch:
   $ switchshow | grep "aa:bb" # aa:bb = last four characters of the WWN
 ii. Create an alias for the server connection
   $ alicreate SERVER_X_Y, "1,27" # X_Y = HBA port designation (may be?); 1 = Domain Switch number (from fabricshow); 27 = port number from above step
  iii. Zone the server connection to the storage:
   $ zomecreate SERVER00, "SERVER_X_Y; DISK_ALIAS1; DISK_ALIAS2"
   # You can get disk alias by running "zoneshow *" and finding a similar server's zone.
  iv. Repeat the above 3 steps for each connection on that switch
  v. Get the active switch config name
    $ cfgactiveshow | grep cfg # should be opsPlusTest
  vi. Add the zones to the active config
    $ cfgadd OpsPlusTest, "SERVER00; SERVER02" # List all zones created above
  vii. Apply the new config
  $ cfgenable OpsPlysTest # Answer "Y" to the prompt to make it active
d. Now, the server and storage can talk to each other.

2. Removing a server from SAN

a. Make sure all storage is unmounted, the multipath devices are removed, and the LUN's unallocated from the server.

b. Login to each SAN switch and perform the following:
 i. Get the zone names for the server:
    $ zoneshow *SERVER*
  ii. Delete each zone
    $ zonedelete <ZONENAME>
  iii. Get the alias name for the server
    $ alishow *SERVER*
  iv. Delete each alias:
    $ alidelete ALIAS_NAME
  v. Get the active switch config name:
    $ cfgactvshow | grep cfs
  Note: Output should be OpsPlusTest
  vi. Remove all zones (deleted above) from the config.
   $ cfgremove OpsPlysTest, "ZONENAME1; ZONENAME2"
  vii. Apply the new config.
   $ cfgenable OpsPlusTest
    # Answer 'Yes' to the prompt to make it active.

c. Now, you can disconnect the server from the SAN

verdaccio - what is it?

Git branch show detached HEAD

  Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03)   00 2. Run re-set hard $ git reset --hard 3. ...