Webscale CLI Reference Guide

A list of Webscale CLI commands, including example outputs

The webscale-cli command is the Swiss army knife of Webscale commands. Use it to fix permissions, restart servers, check the health of the cluster, and many other things.

Some of the most common uses of this command are to check server health, gather information about clusters, or fix permissions on the filesystem. Note that you must use sudo with this command, or it fails.

Cluster Health

One of the most common uses of the Webscale CLI is to check the overall health of the cluster. This command shows information such as MySQL queries, recent file changes, and other details about the cluster and the database.

This command is sudo webscale-cli health. An example output is:

Webscale CLI health output

To narrow your results, use the following flags:

Flag Explanation
sudo webscale-cli health --changes Search the local filesystem under /var/www without following symbolic links.
sudo webscale-cli health --changes --deep Search /var/www and /var/www/shared following symbolic links. Generally takes much longer to return data.
sudo webscale-cli health --changes </some/path> Specify the directory that you would like to see the most recently changed files in. Change </some/path/> to the actual path you want to check.
sudo webscale-cli health --db Show the top db queries, sorted from longest to shortest living. It’s normal for this command to return no data when the database is not heavily loaded.
sudo webscale-cli health --users Show any users currently logged in, and what commands they are running.
sudo webscale-cli health --load-avg Show the load average for the last 2 minutes.
sudo webscale-cli health --acs Show the results from acs-status: e.g., is lsyncd currently syncing to the cluster?

Information Gathering

The following subcommands of sudo webcscale-cli can be used to gather more information:

  • sudo webcscale-cli apps servers Return the internal IP address of servers for the applications as defined in the config file, /etc/lagrange-credentials.yml
  • sudo webcscale-cli clusters: Your Webscale application clusters. To see the output of the clusters command, you need to expand your terminal window to 173 columns.
    Webscale CLI clusters output
    This command accepts the following flags:
Flag Explanation
--cluster-name Return the cluster name for each application.
--cluster-id Return the cluster id for each application.
--private-ips Return only the private IP addresses.
--public-ips Return only the public IPs.
--ips Return only the private IP addresses.

Restarting

You can use the webscale-cli command to restart your application servers.

The command is: sudo webscale-cli restart <service>

Some options for <service>:

  • apache2
  • php5-fpm
  • php5.6-fpm
  • php7.0-fpm
  • lsyncd
  • sessions
  • magento
  • fpc
  • apache
  • php
  • sync

Security

This is the security subset of tools, which only includes log capture at this time.

The command is: sudo webscale-cli security

  • sudo webscale-cli security --log-capture: SSH to every app server and run tar /var/log/apache2/
    Example output:
    Webscale CLI log capture output

Deploying

There are two deploy subcommands. One fixes permissions on the local dataserver, and one fixes issues on application servers that may prevent automatic syncing.

This subcommand of the webscale-cli command recurses through the /var/www/web_root and the /var/www/shared/ directories to make sure that all the files underneath these two directories have the proper ownership and permissions. It is usually run after any deployment to make sure things are as they should be.

The deploy subcommand accepts a path if you want to set permissions on a specific subset of files. If you have files or directories that you need to exclude from this subcommand, list them in the file /home/www-upload/skip_files with one file or directory per line. You may also use Unix filesystem regular expressions.

  • sudo webscale-cli deploy permissions
    Example output:
    Webscale CLI deploy permissions output
  • sudo webscale-cli deploy app_permissions
    Example output:
    Webscale CLI deploy app permissions output

Further Reading

Have questions not answered here? Please Contact Support to get more help.


Last modified April 10, 2020