1. Introduction to MFSERV¶
1.1. What is mfserv?¶
This in the Metwork Framework “SERVices” module. This module is a kind of private PAAS which help to develop, run and manage webservices applications.
With this module, you can easily implement robust webservices with:
synchronous Python3 and synchronous Python2 (with a custom virtualenv including the framework you want like Django, Flask…)
asynchronous Python3 (with aiohttp and your custom virtualenv)
nodejs (and your custom
node_modules
)
All these technologies are managed in a “production ready” with:
a dynamically configured
nginx
webserver in frontsome multiple workers in back
memory limits
autorestart features
logs and metrics
1.2. How it works?¶
MSERV relies on the following components:
Circus monitors and controls processes and sockets. Circus acts as a process watcher and runner. You may check the full
circus.ini
configuration file in thetmp/config_auto/
in the root directory of themfadmin
user. Check the Circus architectureTelegraf acts as a server agent for collecting and sending metrics and events from databases, systems, and IoT sensors.
Elasticsearch is a distributed, RESTful search and analytics engine.
Nginx acts as a web server container.
jsonlog2elasticsearch is a daemon to send json logs read from a log file to elasticsearch.
mflog2mfadmin (based jsonlog2elasticsearch) is a daemon to send mflog logs to elasticsearch.
conf_monitor
is a Metwork tool in order to monitor the configuration files.
Circus acts as a process watcher and runner. You may check the full circus.ini
configuration file in the /home/mfserv/tmp/config_auto/
directory. Check the Circus architecture
app-{{PLUGIN.name}}.{{APP.name}}
is the app defines in your plugin. There are as many app-{{PLUGIN.name}}.{{APP.name}}
as plugins. You may have more than one app
in the same plugin.
Thanks to its plugin templates, MFSERV ease you into a web server implementation:
a WSGI server for running Python web applications. Available MFSERV templates are:
the default template
the django template
the flask template
a Node.js server through the Express web application framework. The corresponding MFSERV template is the node template.
a asynchronous HTTP Server for asyncio and Python (aiohttp). The corresponding MFSERV template is the default template.
a static web server. The corresponding MFSERV template is the static template.
a crontab container or a daemon. The corresponding MFSERV template is the empty template.
If the MFSERV plugin is configured for monitoring, the metrics are send via Telegraf to the InfluxDB database on the MFADMIN server.
1.3. MFSERV configuration¶
The configuration of the MFSERV and its components is stored in the config/config.ini
file of the root directory of the mfserv
user. Check this file for further information.