ONYX - MMC - ONYX Mapping Management Console/en

Différence entre versions

De MappingDoc
(Page créée avec « ====With Docker==== »)
 
(51 révisions intermédiaires par 2 utilisateurs non affichées)
Ligne 2 : Ligne 2 :
  
 
==Introduction==
 
==Introduction==
The centralised console of MAPPING (Mapping Management Console : MMC) gives the possibility to monitore multiple MAPPING servers at the same time through a very intuitive Graphical User Interface.
+
The centralised console of MAPPING (Mapping Management Console : MMC) gives the possibility to monitor multiple MAPPING servers at the same time through a very intuitive Graphical User Interface.
 +
To do so, we need :
 +
*To install NodeJS (v14 minimum) on the machines hosting the MAPPING servers to monitor (prerequisite for the spooler APIs)
 +
*To install the spooler APIs on the machine hosting one or multiple MAPPING environments (1 API spooler per machine) and start them on each of the instance to monitor.
 +
*To install the MAPPING Management Console (MMC)
 +
 
 +
The main goal of the interface is to provide a general health dashboard of the different MAPPING servers :
 +
 
 +
[[Fichier:MMC_2.jpg|600px|thumb|center|Screen of an instance creation]]
  
 
==Prerequisites==
 
==Prerequisites==
  
*one (or multiple) ONYX MAPPING servers installed and configured
+
*One (or multiple) ONYX MAPPING servers installed and configured (Spooler APIs available and configuration done)
*Install NodeJS (v14 minimum) (Node.js )
+
*Install NodeJS (v14 minimum) (Node.js ) on the machine(s) hosting the MAPPING instances to monitor.
 +
 
 +
==NodeJS==
 +
NodeJS is a prerequisite for the installation of the MAPPING spooler APIs. We provide a example of the installation on CENTOS.</br></br>
 +
If you run on another distribution, please refer to the installation guide for this distribution.
 +
 
 +
===Example of installataion on centos===
 +
curl -sL https://rpm.nodesource.com/setup_14.x | bash - &&  yum -y install nodejs
  
 +
==APIs Spooler==
 +
The spooler APIs must be installed on each of the MAPPING machine (and not environment) to which the MMC must has access to.</br>
 +
In the event where multiple MAPPING environments are installed on the same machine, then the spooler APIs will have to be installed <u>only once</u> on the machine and then start them on each of the environment executing the mappingenv command before to select the instance on which we want to start the Spooler APIs (see chapter on the start of the APIs)</br>
  
<u>Example of installation of NodeJS oncentos</u> :
+
===Installation on a VM===
  
curl -sL https://rpm.nodesource.com/setup_14.x | bash - && yum -y install nodejs
+
====mapping-spooler-api command====
 +
as mentionned ealier, the spooler APIs must be instanned only once per machine hosting the MAPPING environment(s) to monitor.
  
==Installation==
+
The command get installed with npm (packet manager installed with NodeJS).
====Installation on a VM====
 
=====Command of mapping-spooler-api=====
 
You use npm to installe the command
 
  
The registry npm used is private, and then requires an authentification.
+
The npm registery is private and therefore requires an authentication.
  
=====Authentification=====
+
=====authentication=====
  
 
  npm login --registry http://npm-registry.mappingsuite.com:4873
 
  npm login --registry http://npm-registry.mappingsuite.com:4873
 +
  
 
username : partnermappingsuite</br>
 
username : partnermappingsuite</br>
password : (Ask MAPPING, password on LastPass : [M-S] IT> NPM Registry for Partner )</br>
+
password : (voir sur LastPass : [M-S] IT> NPM Registry for Partner )</br>
 
email : partner_mappingsuite@mappingsuite.com</br>
 
email : partner_mappingsuite@mappingsuite.com</br>
  
=====Installation=====
+
=====Installation=====  
  
 
  npm install -g mapping-spooler-api --registry http://npm-registry.mappingsuite.com:4873
 
  npm install -g mapping-spooler-api --registry http://npm-registry.mappingsuite.com:4873
 +
 +
 +
 +
===Installation with Docker===
 +
 +
The Spooler APIs must absolutely be installed on the same host machine as the MAPPING server.
 +
 +
We must therefore add the spooler API installation to the docker MAPPING ONYX image.
 +
 +
 +
=====Example of Dockerfile=====
 +
 +
# Base Image Mapping Suite Server
 +
FROM mappingsuite.azurecr.io/onyxserver:10.2.0
 +
# NPM Registry Token for Authentication
 +
ARG npm_token
 +
# Update & Supervisor (for running Onyx + Rest API in parrallel)
 +
RUN yum -y install epel-release && \
 +
    yum -y update && \
 +
    yum -y install supervisor
 +
# Install NodeJS
 +
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
 +
    yum -y install nodejs
 +
# NPM Private Registry Authentication
 +
RUN npm set //npm-registry.mappingsuite.com:4873//:_authToken ${npm_token}
 +
# NPM install mapping-spooler-api with private NPM Registry
 +
RUN npm install -g mapping-spooler-api --registry http://npm-registry.mappingsuite.com:4873
 +
# Required env var for API REST
 +
ENV PORT=8080
 +
ENV MAPPING_PATH=/apps/mapping/data/conf/mapping.conf
 +
# Supervisor Configuration
 +
RUN echo "[supervisord]" > /etc/supervisord.conf  && \
 +
  echo "nodaemon=true" >> /etc/supervisord.conf  && \
 +
  echo "[program:spooler-api]" >> /etc/supervisord.conf  && \
 +
  echo "command=bash -c 'sleep 5 && exec mapping-spooler-api'" >> /etc/supervisord.conf  && \
 +
  echo "[program:onyx-server]" >> /etc/supervisord.conf  && \
 +
  echo "command=/home/docker/scripts/init.sh"  >> /etc/supervisord.conf
 +
EXPOSE 8080
 +
# Run Supervisor
 +
ENTRYPOINT ["/usr/bin/supervisord"]
 +
 +
 +
This Dockerfile uses a parameter "npm_token” to authenficate itself on our npm registery.<br>
 +
 +
A token can be obtained using the following command :
 +
 +
curl -s -H "Accept: application/json" -H "Content-Type:application/json" -X PUT --data '{"name": "mappingdev", "password": "PASSWORD"}'  --user mappingdev:PASSWORD http://npm-registry.mappingsuite.com:4873/-/user/org.couchdb.user:mappingdev
 +
 +
Build-up of the image :
 +
 +
  docker build . -t onyxserver-api --build-arg npm_token=$TOKEN
  
  
 
===Configuration===
 
===Configuration===
  
one the command installed, you need to configure each ONYX server to define the HTTP porte used by  the spooler APIs.
+
Once the command installed, you need to configure each ONYX server to define the HTTP porte used by  the spooler APIs.
  
This can be done using the mapping.conf entry SPOOLER_API_PORT on each MAPPING server to monitore.
+
This can be done using the mapping.conf entry SPOOLER_API_PORT on each MAPPING server to monitor.
  
 
This value must be unique on each ONYX server installed on the VM.
 
This value must be unique on each ONYX server installed on the VM.
Ligne 54 : Ligne 122 :
 
<u>Note</u>:These port numbers will be useful when adding the server to the MMC server interface.</br>
 
<u>Note</u>:These port numbers will be useful when adding the server to the MMC server interface.</br>
  
 
+
===Starting the API service===
===starting the API service===
 
  
 
To start the HTTP API, you simply need to run the mapping-spooler-api, while the MAPPING_PATH environmeent variable define on the desired Onyx server.
 
To start the HTTP API, you simply need to run the mapping-spooler-api, while the MAPPING_PATH environmeent variable define on the desired Onyx server.
  
This kind be done using the mappingenv command  to select the desired Onyx environment, then run the mapping-spooler-api.</br></br>
+
This can be done using the mappingenv command  to select the desired Onyx environment, then run the mapping-spooler-api.</br></br>
  
  
Ligne 69 : Ligne 136 :
  
  
 +
==Mapping Management Console==
 +
===Installation===
 +
The installation of the MMC can be done only through Docker.</br>
 +
 +
'''Image : mappingsuite/management-console-full'''
 +
 +
username : partnermappingsuite</br>
 +
password : (see LastPass : [M-S] IT> DockerHub partner )</br>
 +
 +
The execution with no persistant data with the default admin user (mapadmin/mapadmin), with the GUI available on port 8003 :
 +
docker run -p 8003:80 mappingsuite/management-console-full
 +
 +
It is also possible to define a name and password for the default admin account, using the environement variables '''ADMIN_USERNAME''' and '''ADMIN_PASSWORD''', example :
 +
 +
  docker run -p 8003:80 -e ADMIN_USERNAME=MyAdmin -e ADMIN_PASSWOR=MyPassword  mappingsuite/management-console-full
  
====With Docker====
 
  
L’API Spooler doit absolument être installé sur le même hôte que le serveur Mapping Onyx.
+
To save data (users and MAPPING instances created), we must use a volume on a directory '''mapping/data'''
  
Il faut donc ajouter l’installation de l’api spooler à l’image docker Mapping Onyx.
+
  docker run -p 8003:80 -v /my/data/:/mapping/data mappingsuite/management-console-full
  
 +
<u>Note</u> : The docker image uses a Mapping user, using a local path for the volume could cause permission issues, it is then better to use a Docker volume.</br>
  
=====Exemple de Dockerfile=====
+
The logs can also be stored with a volume in the folder '''/mapping/logs'''.
  
# Base Image Mapping Suite Server
+
  docker run -p 8003:80 -v /my/logs/:/mapping/logs mappingsuite/management-console-full
  FROM mappingsuite.azurecr.io/onyxserver:10.2.0
+
 
# NPM Registry Token for Authentication
+
Example of docker-compose .yml :
  ARG npm_token
+
 
# Update & Supervisor (for running Onyx + Rest API in parrallel)
+
  version: '3.2'
RUN yum -y install epel-release && \
+
 
     yum -y update && \
+
  services:
     yum -y install supervisor
+
  mmc:
# Install NodeJS
+
  image: mappingsuite/management-console-full
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
+
     ports:
    yum -y install nodejs
+
      - "8003:80"
# NPM Private Registry Authentication
+
     environment:
RUN npm set //npm-registry.mappingsuite.com:4873//:_authToken ${npm_token}
+
      - ADMIN_USERNAME=admin
  # NPM install mapping-spooler-api with private NPM Registry
+
      - ADMIN_PASSWORD=Mapping1234
RUN npm install -g mapping-spooler-api --registry http://npm-registry.mappingsuite.com:4873
+
    volumes:
# Required env var for API REST
+
      - mapping-data:/mapping/data
ENV PORT=8080
+
      - "/home/mmc/logs:/mapping/logs"
ENV MAPPING_PATH=/apps/mapping/data/conf/mapping.conf
+
  volumes:
# Supervisor Configuration
+
  mapping-data:
RUN echo "[supervisord]" > /etc/supervisord.conf  && \
+
 
  echo "nodaemon=true" >> /etc/supervisord.conf  && \
+
===Utilization===
  echo "[program:spooler-api]" >> /etc/supervisord.conf  && \
+
 
  echo "command=bash -c 'sleep 5 && exec mapping-spooler-api'" >> /etc/supervisord.conf  && \
+
====Creation of an MAPPING instance====
  echo "[program:onyx-server]" >> /etc/supervisord.conf  && \
+
An instance is a group of MAPPING environments (or services).
  echo "command=/home/docker/scripts/init.sh"  >> /etc/supervisord.conf
+
 
EXPOSE 8080
+
Menu '''Instances / +Add'''
# Run Supervisor
+
 
ENTRYPOINT ["/usr/bin/supervisord"]
+
Inside them, we must create services corresponding to the MAPPING servers to monitor.
 +
 
 +
[[Fichier:MMC_1.jpg|600px|thumb|center|Screen of an instance creation]]

Version actuelle datée du 5 novembre 2021 à 16:34

Autres langues :
English • ‎français

Introduction

The centralised console of MAPPING (Mapping Management Console : MMC) gives the possibility to monitor multiple MAPPING servers at the same time through a very intuitive Graphical User Interface. To do so, we need :

  • To install NodeJS (v14 minimum) on the machines hosting the MAPPING servers to monitor (prerequisite for the spooler APIs)
  • To install the spooler APIs on the machine hosting one or multiple MAPPING environments (1 API spooler per machine) and start them on each of the instance to monitor.
  • To install the MAPPING Management Console (MMC)

The main goal of the interface is to provide a general health dashboard of the different MAPPING servers :

Screen of an instance creation

Prerequisites

  • One (or multiple) ONYX MAPPING servers installed and configured (Spooler APIs available and configuration done)
  • Install NodeJS (v14 minimum) (Node.js ) on the machine(s) hosting the MAPPING instances to monitor.

NodeJS

NodeJS is a prerequisite for the installation of the MAPPING spooler APIs. We provide a example of the installation on CENTOS.

If you run on another distribution, please refer to the installation guide for this distribution.

Example of installataion on centos

curl -sL https://rpm.nodesource.com/setup_14.x | bash - &&  yum -y install nodejs

APIs Spooler

The spooler APIs must be installed on each of the MAPPING machine (and not environment) to which the MMC must has access to.
In the event where multiple MAPPING environments are installed on the same machine, then the spooler APIs will have to be installed only once on the machine and then start them on each of the environment executing the mappingenv command before to select the instance on which we want to start the Spooler APIs (see chapter on the start of the APIs)

Installation on a VM

mapping-spooler-api command

as mentionned ealier, the spooler APIs must be instanned only once per machine hosting the MAPPING environment(s) to monitor.

The command get installed with npm (packet manager installed with NodeJS).

The npm registery is private and therefore requires an authentication.

authentication
npm login --registry http://npm-registry.mappingsuite.com:4873


username : partnermappingsuite
password : (voir sur LastPass : [M-S] IT> NPM Registry for Partner )
email : partner_mappingsuite@mappingsuite.com

Installation
npm install -g mapping-spooler-api --registry http://npm-registry.mappingsuite.com:4873


Installation with Docker

The Spooler APIs must absolutely be installed on the same host machine as the MAPPING server.

We must therefore add the spooler API installation to the docker MAPPING ONYX image.


Example of Dockerfile
# Base Image Mapping Suite Server
FROM mappingsuite.azurecr.io/onyxserver:10.2.0
# NPM Registry Token for Authentication
ARG npm_token
# Update & Supervisor (for running Onyx + Rest API in parrallel)
RUN yum -y install epel-release && \ 
   yum -y update && \
   yum -y install supervisor
# Install NodeJS
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \ 
   yum -y install nodejs	
# NPM Private Registry Authentication 
RUN npm set //npm-registry.mappingsuite.com:4873//:_authToken ${npm_token}
# NPM install mapping-spooler-api with private NPM Registry
RUN npm install -g mapping-spooler-api --registry http://npm-registry.mappingsuite.com:4873
# Required env var for API REST 
ENV PORT=8080
ENV MAPPING_PATH=/apps/mapping/data/conf/mapping.conf
# Supervisor Configuration
RUN echo "[supervisord]" > /etc/supervisord.conf  && \
 echo "nodaemon=true" >> /etc/supervisord.conf  && \
 echo "[program:spooler-api]" >> /etc/supervisord.conf  && \
 echo "command=bash -c 'sleep 5 && exec mapping-spooler-api'" >> /etc/supervisord.conf  && \
 echo "[program:onyx-server]" >> /etc/supervisord.conf  && \
 echo "command=/home/docker/scripts/init.sh"  >> /etc/supervisord.conf 
EXPOSE 8080
# Run Supervisor
ENTRYPOINT ["/usr/bin/supervisord"]


This Dockerfile uses a parameter "npm_token” to authenficate itself on our npm registery.

A token can be obtained using the following command :

curl -s -H "Accept: application/json" -H "Content-Type:application/json" -X PUT --data '{"name": "mappingdev", "password": "PASSWORD"}'  --user mappingdev:PASSWORD http://npm-registry.mappingsuite.com:4873/-/user/org.couchdb.user:mappingdev

Build-up of the image :

 docker build . -t onyxserver-api --build-arg npm_token=$TOKEN


Configuration

Once the command installed, you need to configure each ONYX server to define the HTTP porte used by the spooler APIs.

This can be done using the mapping.conf entry SPOOLER_API_PORT on each MAPPING server to monitor.

This value must be unique on each ONYX server installed on the VM.


Example

<block name="WEB CONFIG">
 <group>
  <element>
   <info name="[SPOOLER_API_PORT]">8080</info>
  </element>
 </group>
</block>

Note:These port numbers will be useful when adding the server to the MMC server interface.

Starting the API service

To start the HTTP API, you simply need to run the mapping-spooler-api, while the MAPPING_PATH environmeent variable define on the desired Onyx server.

This can be done using the mappingenv command to select the desired Onyx environment, then run the mapping-spooler-api.


Note: The mapping-spooler-api command never gives the hand back and does not have an option to run in background. To run the command in background, we do as follow :

mapping-spooler-api > /dev/null 2>&1 &

(or using tools as supervisor) The SPOOLER_API_PORT option of the mapping.conf is optionnal. If it is not present, the API will look for a environment variable PORT.


Mapping Management Console

Installation

The installation of the MMC can be done only through Docker.

Image : mappingsuite/management-console-full

username : partnermappingsuite
password : (see LastPass : [M-S] IT> DockerHub partner )

The execution with no persistant data with the default admin user (mapadmin/mapadmin), with the GUI available on port 8003 :

docker run -p 8003:80 mappingsuite/management-console-full

It is also possible to define a name and password for the default admin account, using the environement variables ADMIN_USERNAME and ADMIN_PASSWORD, example :

 docker run -p 8003:80 -e ADMIN_USERNAME=MyAdmin -e ADMIN_PASSWOR=MyPassword  mappingsuite/management-console-full


To save data (users and MAPPING instances created), we must use a volume on a directory mapping/data

 docker run -p 8003:80 -v /my/data/:/mapping/data mappingsuite/management-console-full

Note : The docker image uses a Mapping user, using a local path for the volume could cause permission issues, it is then better to use a Docker volume.

The logs can also be stored with a volume in the folder /mapping/logs.

 docker run -p 8003:80 -v /my/logs/:/mapping/logs mappingsuite/management-console-full

Example of docker-compose .yml :

version: '3.2'
services:
 mmc:
  image: mappingsuite/management-console-full
   ports:
     - "8003:80"
   environment:
     - ADMIN_USERNAME=admin
     - ADMIN_PASSWORD=Mapping1234
   volumes:
     - mapping-data:/mapping/data
     - "/home/mmc/logs:/mapping/logs"
volumes:
 mapping-data:

Utilization

Creation of an MAPPING instance

An instance is a group of MAPPING environments (or services).

Menu Instances / +Add

Inside them, we must create services corresponding to the MAPPING servers to monitor.

Screen of an instance creation