You can configure Chef Automate to use Opensearch clusters that are not deployed via Chef Automate itself.
Configure External Opensearch
These configuration directions are intended for in the initial deployment of Chef Automate.
Add the following to your config.toml:
[global.v1.external.opensearch] enable = true nodes = ["http://opensearch1.example:9200", "http://opensearch2.example:9200", "..." ] # Uncomment and fill out if using external opensearch with SSL and/or basic auth # [global.v1.external.opensearch.auth] # scheme = "basic_auth" # [global.v1.external.opensearch.auth.basic_auth] ## Create this opensearch user before starting the Automate deployment; ## Automate assumes it exists. # username = "<admin username>" # password = "<admin password>" # [global.v1.external.opensearch.ssl] # Specify either a root_cert or a root_cert_file # root_cert = """$(cat </path/to/cert_file.crt>)""" # server_name = "<opensearch server name>" # Uncomment and fill out if using external opensearch that uses hostname-based routing/load balancing # [esgateway.v1.sys.ngx.http] # proxy_set_header_host = "<your external es hostname>:1234" # Uncomment and add to change the ssl_verify_depth for the root cert bundle # ssl_verify_depth = "2"
Because externally-deployed Opensearch nodes will not have access to Chef Automate’s built-in backup storage services, you must configure Opensearch backup settings separately from Chef Automate’s primary backup settings. You can configure backups to use either the local filesystem or S3.
Add Resolvers for Opensearch
In case you want to resolve the Opensearch node IPs dynamically using DNS servers, you can add resolvers/nameservers to the configuration.
Name Servers can be added in two ways:
Add nameserver IPs: Add the nameservers to your
config.tomlfile to resolve the Opensearch nodes.
[esgateway.v1.sys.ngx.main.resolvers] # Multiple resolvers can be specified by adding the resolvers in the list. nameservers = ["192.0.2.0:24", "198.51.100.0:24"]
Set system DNS entries: To use existing system nameserver entries from
/etc/resolv.conf, add the following setting to
[esgateway.v1.sys.ngx.main.resolvers] enable_system_nameservers = true
If both options are set, nameserver IPs takes precedence over the system nameserver entries.
Apply the changes:
sudo chef-automate config patch config.toml
If you wish to reset to the default configuration or to modify the configuration:
chef-automate config show config.toml.
config.tomland remove the
esgateway.v1.sys.ngx.main.resolversconfiguration or change the values.
chef-automate config set config.tomlto apply your changes.
Backup External Opensearch
Backup External Opensearch to a Local Filesystem
To configure local filesystem backups of Chef Automate data stored in an externally-deployed Opensearch cluster:
- Ensure that the filesystems you intend to use for backups are mounted to the same path on all Opensearch master and data nodes.
- Configure the Opensearch
path.reposetting on each node as described in the Opensearch documentation.
- Add the following to your
[global.v1.external.opensearch.backup] enable = true location = "fs" [global.v1.external.opensearch.backup.fs] # The `path.repo` setting you've configured on your Opensearch nodes must be # a parent directory of the setting you configure here: path = "/var/opt/chef-automate/backups"
Backup External Opensearch to AWS S3
To configure AWS S3 backups of Chef Automate data stored in an externally-deployed Opensearch cluster:
repository-s3on all nodes in your Opensearch cluster.
If you wish to use IAM authentication to provide your Opensearch nodes access to the S3 bucket, you must apply the appropriate IAM policy to each host system in the cluster.
Configure each Opensearch node with a S3 client configuration containing the proper S3 endpoint, credentials, and other settings as described in the Opensearch documentation.
Enable S3 backups by adding the following settings to your
[global.v1.external.opensearch.backup] enable = true location = "s3" [global.v1.external.opensearch.backup.s3] # bucket (required): The name of the bucket bucket = "<bucket name>" # base_path (optional): The path within the bucket where backups should be stored # If base_path is not set, backups will be stored at the root of the bucket. base_path = "<base path>" # name of an s3 client configuration you create in your opensearch.yml # for full documentation on how to configure client settings on your # Opensearch nodes client = "<client name>" [global.v1.external.opensearch.backup.s3.settings] ## The meaning of these settings is documented in the S3 Repository Plugin ## documentation. ## Backup repo settings # compress = false # server_side_encryption = false # buffer_size = "100mb" # canned_acl = "private" # storage_class = "standard" ## Snapshot settings # max_snapshot_bytes_per_sec = "40mb" # max_restore_bytes_per_sec = "40mb" # chunk_size = "null" ## S3 client settings # read_timeout = "50s" # max_retries = 3 # use_throttle_retries = true # protocol = "https"
Backup External Opensearch to GCS
To configure Google Cloud Storage Bucket (GCS) backups of Chef Automate data stored in an externally-deployed Opensearch cluster:
repository-gcsplugin on all nodes in your Opensearch cluster.
Create a storage bucket and configure a service account to access it per the steps described in the Opensearch documentation.
Configure each Opensearch node with a GCS client configuration that contains the proper GCS settings as described in the Opensearch documentation.
Enable GCS backups by adding the following settings to your
[global.v1.external.opensearch] enable = true nodes = ["https://my-es.cluster"] ## If multiple # nodes = ["https://my-es.node-1", "https://my-es.node-2", "etc..."] ## The following settings are required if you have Opensearch setup with basic auth #[global.v1.external.opensearch.auth] # scheme = "basic_auth" # #[global.v1.external.opensearch.auth.basic_auth] # username = "everyuser" # password = "pass123" [global.v1.external.opensearch.backup] enable = true location = "gcs" [global.v1.external.opensearch.backup.gcs] bucket = "<bucket name>" # Client name is normally default, but can be set here if you have generated service # account credentials with a different client name client = "default" ## GCS Bucket Settings: # type = nearline # access control = uniform
Was this page helpful?