Using stanctl commands
Use the command-line interface (CLI)
stanctl for installing and configuring Instana.
stanctl --help to see all
available commands.Frequently used commands
The following stanctl commands are frequently
used.
- stanctl agent
- stanctl backend
- stanctl up
For more information about a command, use the
--help flag.
stanctl [command] --help
Flags for custom configuration values
The stanctl command uses default values for some
configurations.
To use custom values instead of the default values, you can use
flags to pass configuration values to the stanctl
commands. Use stanctl [command] --help to see the list
of available configuration options.
For example, stanctl uses the default
/mnt/instana/stanctl/analytics mount point for
Analytics. If you want to use a custom mount point, you can use the
--volume-analytics flag. See the following
example:
stanctl up --volume-analytics <custom-path>
Environment variables
You can store custom configuration values as environment
variables either by exporting the values or by storing them in an
environment file (.env).
The environment variable name of a configuration flag must start
with STANCTL_. Use --help to see the
environment variable name of a flag.
For example, if you run stanctl up --help, you see
that the environment variable name for the
--volume-analytics flag is
STANCTL_VOLUME_ANALYTICS.
When you define environment variables for flags, the
stanctl command automatically uses the environment
variable values for configuration.
Consider the --volume-analytics example used in the
previous section. If you defined an environment variable for the
flag, you can run the stanctl up command without
specifying the --volume-analytics flag. The command
uses the environment variable value.
However, if you define the environment variable and also specify
the flag with the command, stanctl uses the value from
the flag and not from the environment variable.
Export environment variables
You can set environment variables by using the
export command. However, this setting is not
persistent.
See the following examples:
-
export STANCTL_VOLUME_ANALYTICS=/data/analytics -
export STANCTL_CORE_BASE_DOMAIN=instana.example.com -
export STANCTL_INSTALL_TYPE=production
Use environment file
Add the environment variables in a .env file.
STANCTL_VOLUME_ANALYTICS=/data/analytics
STANCTL_CORE_BASE_DOMAIN=instana.example.com
STANCTL_INSTALL_TYPE=production
You can run the stanctl commands from the directory
of the .env file.
stanctl up
Or, use the --env-file flag to specify the path to
the environment file.
stanctl up --env-file <path-to-the-.env-file>
Instana backend and image versions
Before you install or upgrade Standard Edition, you can see the list of installable Instana backend versions and images.
-
To view the list of Instana backend versions, run the following command. The command excludes your current and older backend versions from the list.
stanctl versions identifySee the following example:
$ stanctl versions identify ⠏ Identifying supported Instana versions [0s] ✓ Identified the following Instana versions: - 3.283.450-0 - 3.281.446-0 - 3.279.395-0 -
To view the images that are available with an Instana backend version, run the following commands:
-
To select an Instana backend version and then see the available images in that version, run the following command:
stanctl versions list-imagesSee the following example:
$ stanctl versions list-images ? Select Instana version: [Use arrows to move, type to filter] > 3.283.450-0 3.281.446-0 3.279.395-0 Cancel stanctl versions list-images ? Select Instana version: 3.283.450-0 artifact-public.instana.io/backend/acceptor:3.283.450-0 artifact-public.instana.io/backend/accountant:3.283.450-0 artifact-public.instana.io/backend/action-orchestration:3.283.450-0 artifact-public.instana.io/backend/action-reader:3.283.450-0 . . . -
To see the available images in a specified Instana backend version, run the following command. The prompt to select a backend version is not displayed.
stanctl versions list-images --instana-version <backend-version>See the following example:
$ stanctl versions list-images --instana-version 3.283.450-0 artifact-public.instana.io/backend/acceptor:3.283.450-0 artifact-public.instana.io/backend/accountant:3.283.450-0 artifact-public.instana.io/backend/action-orchestration:3.283.450-0 artifact-public.instana.io/backend/action-reader:3.283.450-0 . . .
-