Introduction
This guide will cover the use of the jrctl tool, specifically in clustered environments. You can find our base article for using jrctl here.
Tags
In a clustered environment, every node has a tag. To view all of the nodes in your cluster and their tags, use the following command:
jrctl node list
This will list all the connected nodes in your cluster, along with their tags. Tags include:
- jump - The main node in the cluster which you have SSH access to, and where you can run jrctl.
- www - The node(s) that run Nginx and PHP-FPM which serve your web content.
- varnish - The node(s) that run the Varnish HTTP cache service.
- db - The node that runs your MariaDB/MySQL database.
- redis - The node that runs Redis services. Typically this is also your db node.
- search - The node that runs Elasticsearch/OpenSearch. This may also be your db node.
To list what services are running on nodes with a specific tag, use the following command as an example:
jrctl service list -t www
The above command will list all services running on all nodes that have the www tag.
To restart a service on nodes with a given tag, use a command such as:
jrctl service restart nginx -t www
The above command will restart the nginx service on all nodes with the www tag.
Managing PHP-FPM Version
To manage the version of PHP-FPM in use by a website the website command can be used.
To get a list of websites and the current PHP-FPM version in use.
jrctl website list
List a available PHP-FPM versions available for use.
jrctl website php-available
If the desired version is not currently enabled it be enabled using the service command.
jrctl service enable php-fpm-8.3
Using the website name and available versions determined using the prior commands the version change can be made
jrctl website php-switch example.com php-fpm-8.3 -t www
Restart Nginx to load the changes in the web server
jrctl service restart nginx -t www
Managing PHP-CLI Version
The command line version of PHP can be changed using the alternative command with jrctl. The CLI version of PHP is responsible for executing the Magento cron task so it must be set correctly.
jrctl alternative list
This lists the program, its current version, and available versions. Using this information, the version can be switched.
jrctl alternative switch php-cli -v php-cli-8.3 -t www
Comments
0 comments
Article is closed for comments.