Managing Services
#
Service OverviewManifold is composed of a handful of services, with two services, the client and the API, doing most of the work. The client application is a Javascript application that is delivered to the user’s browser, and that also runs on the server as a Node application. All data in Manifold is delivered to the client through Manifold’s API service. The API service is a Ruby on Rails application that runs on the server. API request paths typically begin with /api/v1. Just about all other requests are handled by the client application.
The API relies on number of services. It stores data in a PostgreSQL database. It uses Redis for queuing and caching. Content stored in Manifold is added to an ElasticSearch index for full-text search. There are four services running as part of the API. The first is the API itself, which runs on Puma, a HTTP server for Ruby/Rack applications. The main API application service is referred to inconsistently in the package install as "api" or"puma". The second is called "cable," and it listens to the client application for websocket connections, which are mainly used during ingestion. The third API service is Sidekiq, which is the background job processor. The fourth API service is called "clockwork" and it provides cron-like scheduled task functionality for Manifold.
Services are managed differently depending on how Manifold was installed. Be sure to consult the appropriate section for your installation.
#
For Package InstallsIn the context of a package install, services are managed using the manifold-ctl
command line tool. This tool must be executed as root or usng sudo
.
Use the manifold-ctl status
command to see the state of each service:
#
Restarting ServicesTo restart a service, enter a command in the format of manifold-ctl restart service_name
.
To stop a service, enter a command in the format of manifold-ctl stop service_name
.
To start a service, enter a command in the format of manifold-ctl start service_name
.
#
Troubleshooting ServicesIf a service fails to start successfully, troubleshoot by consulting the service logs. The logs for each service are located in /var/log/manifold
. There are variations around how each service logs. For example, the API log will be at /var/log/manifold/production.log
, while the client application log will be at /var/log/manifold/client/current
.
We also provide the ability to tail service logs using the manifold-ctl tail
command.
#
CommandsRunning manifold-ctl help
will return the full list of available server management commands:
#
For Docker InstallsWhen Manifold is run as Docker containers, each container represents a single service. Our docker-compose file includes the following containers:
- postgres
- elasticsearch
- redis
- api_cable
- api_clockwork
- api_rails
- api_sidekiq
- client
- proxy
We used environment variables to tell each service how to locate other services on the network. These variables are described in more detail on the Environmenet Variables page in our documentation. Instructions on managing Docker containers is outside of our documentation's scope.
To troubleshoot services, start by monitoring the services's output using docker-compose's log
command:
#
For Source Installsnote
This section is still a work in progress. Check back soon for instructions on configuring Manifold services with installation from source.