Common considerations¶
Lassoはlibpq環境変数を使用してPostgres接続パラメーターを取得します。 PostgreSQL documentationに環境変数のリストがあります。
他のオプションの中でも特に接続パラメーターは、コマンドライン引数として渡すこともできます。
usage: lasso [-h] [-H HOST_NAME] [-p PORT] [--password PASSWORD]
[--lock-timeout LOCK_TIMEOUT]
[--statement-timeout STATEMENT_TIMEOUT] [--bindir BINDIR]
[--depth [{surface,shallow,deep}]]
[--describe [{short,json,full}]] [--version] [--latest-version]
[--system-only | --barman]
[--barman-configuration BARMAN_CONFIGURATION]
[--repmgr-configuration REPMGR_CONFIGURATION]
[--efm-configuration EFM_CONFIGURATION]
[--xdb-pubserver-configuration XDB_PUBSERVER_CONFIGURATION]
[--xdb-subserver-configuration XDB_SUBSERVER_CONFIGURATION]
[--pgbouncer-configuration PGBOUNCER_CONFIGURATION]
[--harp-configuration HARP_CONFIGURATION]
[--etcd-configuration ETCD_CONFIGURATION]
[--upload] [--keep-report] [--is-latest-version]
[dbname] [user]
EDB Lasso
positional arguments:
dbname Database name to connect to (default root)
user Database user name (default root)
optional arguments:
-h, --help show this help message and exit
-H HOST_NAME, --host-name HOST_NAME
Database host name or socket directory (default local
socket)
-p PORT, --port PORT Database server port (default 5432)
--password PASSWORD Database server password
--lock-timeout LOCK_TIMEOUT
Database connection lock timeout (default 3s)
--statement-timeout STATEMENT_TIMEOUT
Database connection statement timeout (default 5min)
--bindir BINDIR Postgres binaries directory (autodetect by default)
--depth [{surface,shallow,deep}]
Depth of the report (default deep)
--describe [{short,json,full}]
Describes every single module, in terms of action and
output
--version Shows Lasso version and modules revision
--latest-version Shows the latest available version of EDB Lasso, taken
from the EDB Web Services
--system-only Gather only system-related information - without
requiring a Postgres connection
--barman Gather Barman status, enabled by default when Lasso is
run as barman user and the executable exists.
Defaults to False. When Barman reporting is enabled,
we do not gather Postgres related information
--barman-configuration BARMAN_CONFIGURATION
Barman configuration file. By default use the native
algorithm in Barman to find the configuration file.
Valid only if Barman reporting is enabled
--repmgr-configuration REPMGR_CONFIGURATION
Path to the repmgr.conf file, if using a non-default
path
--efm-configuration EFM_CONFIGURATION
Path to the EFM properties file, if using a non-
default path
--xdb-pubserver-configuration XDB_PUBSERVER_CONFIGURATION
Path to the xDB publication server configuration file,
if using a non-default path
--xdb-subserver-configuration XDB_SUBSERVER_CONFIGURATION
Path to the xDB subscription server configuration
file, if using a non-default path
--pgbouncer-configuration PGBOUNCER_CONFIGURATION
Path to the pgbouncer.ini file. You can specify multiple
files separated by comma
--harp-configuration HARP_CONFIGURATION
Path to the config.yml file, if using a non-default
path
--etcd-configuration ETCD_CONFIGURATION
Path to the etcd.conf file, if using a non-default
path
--upload Report tarball file is sent to EDB at the end of the
execution. The file will be removed if successfully
uploaded unless --keep-report is specified
--keep-report Keep a local copy of the report even after a
successful upload to EDB
--is-latest-version Only check if this is the latest available version of
Lasso and returns exit code 0 if this is the latest
version and 1 otherwise
Lassoの構成ファイルを使用することもできるため、環境で必要になる可能性のあるコマンドラインオプションのほとんどを省略することができます。 Lassoは、次のパスでこの順序で構成ファイルを探します。
Lassoが実行されているのと同じディレクトリの
./edb-lasso.cfgLassoが実行されているのと同じディレクトリの
./edb-lasso.conf
3.$HOME/.edb-lasso.conf
4./etc/edb-lasso.conf
最初の一致を使用します。
構成ファイルのテンプレートファイルは次のようになります。
; Lasso template configuration file
;
; Copyright (C) EnterpriseDB UK Limited 2015-2022 - All Rights Reserved.
; Licensed only for use with an EnterpriseDB subscription
[customer]
; the "Company code" from the customer page in the EDB Portal
id=
; the "Token" from the customer page in the EDB Portal
token=
; the depth of the Lasso report. Must be one between: surface, shallow and deep
depth=deep
[postgresql]
; Lasso uses the following connection string parameters to connect to your
; PostgreSQL cluster and take diagnostics. By default it will attempt a peer
; connection to socket under directory /var/run/postgresql
; dbname=
; user=
; port=
; hostname can be a host or a socket directory
; hostname=/var/run/postgresql
; password=
; session variable to control timeout on lock waits
; lock_timeout=3s
; session variable to control statement execution time
; statement_timeout=5min
[environment]
; PostgreSQL binaries directory. Lasso will try to detect this automatically if
; not set
; bindir=
; if the host is able to access the internet and reach the EDB servers to upload
; Lasso reports
; external_access=yes
[barman]
; path to barman.conf, if using a non-default one
; configuration=
[repmgr]
; path to repmgr.conf, if using a non-default one
; configuration=
[efm]
; path to efm.properties, if using a non-default one
; configuration=
[xdb]
; path to xdb_pubserver.conf, if using a non-default one
; pubserver_configuration=
; path to xdb_subserver.conf, if using a non-default one
; subserver_configuration=
[pgbouncer]
; path to pgbouncer.ini, if using a non-default one
; configuration=
[harp]
; path to config.yml, if using a non-default one
; configuration=
このテンプレートを使用して、構成ファイルをセットアップできます。目的のパラメーターのコメントを外し、環境に合わせて値を設定します。
DEBまたはRPMパッケージからLassoをインストールした場合、同じテンプレート構成ファイルが/etc/edb-lasso.conf.templ
にあります。
重要
DEBまたはRPMパッケージからLassoをインストールした場合、少なくとも顧客IDとトークンセットを含む構成ファイルが必要です。バイナリに埋め込まれた変数を含むLasso使い捨てバイナリを実行している場合、これは必要ありません。
このスクリプトは、収集されたデータを含む_TARファイル_を生成します。このファイルは、プロセスの一環としてEDBエンジニアに返すか、
--upload オプションを使用して自動的に送信する必要があります。
重要
一部の企業は、Lassoが隔離されたネットワークで動作するように要求しています。その場合、 --upload オプションは許可されません。 (この設定は、ポータルの会社ページから、または`--version` ランタイムオプションを介して簡単に確認できます。)この機能を利用するには、Lassoによって分析されるサーバーが、最前線のいずれかの443ポートにアクセスできることを確認してください。 Servers accepting upload of reports にリストされているWebサイト。
PostgresがインストールされていないサーバーでLassoを使用することもできます。その場合、
--system-only
オプションを使用し、生成される_TARファイル_にはシステム関連の情報のみが含まれます。
セキュリティ上の考慮事項¶
データベースでクエリを実行するとき、Lassoは、メトリックが収集されているツールから必要な情報を収集するのに十分な特権を持つロールを使用しようとします。
以下は、Lassoがそれぞれ使用しようとするツールとロールです。 Lassoは、各ツールロールリストで最初に使用可能なロールを使用しようとします。 初期接続ロール は、ツールの実行時にLasso CLIを介して提供されたロールを意味します。通常、postgresまたはenterprisedb。
PostgreSQL: - pg_monitor - 初期接続ロール
PgLogical: - pglogical_superuser - 初期接続ロール
PGD: - bdr_monitor - 初期接続ロール
PEM: - pem_user - 初期接続ロール
repmgr: - 初期接続ロール
xDB: - 初期接続ロール
PGDの収集のほとんどは、 bdr_monitor ロールを使用しようとします。ただし、競合の収集を担当するそのうちの1人は、その目的のためにロール bdr_read_all_conflicts を使用しようとします。それが唯一の例外です。
いずれの場合も、データベースからメトリックと構成を照会中に読み取り専用トランザクションを使用します。