Shared filesystem

When your cluster has a shared filesystem accessible from all the nodes of the cluster, you have to ensure that the shared filesystem is accessible on a common path. You should mount that shared folder on all nodes and add the path of the mounted directory. The shared, mounted filesystem's path should be added to each node's elasticsearch.yml as follows:

path.repo: ["/mount/es_backups"]
If you are running a single node cluster and haven't set up a real distributed cluster, there is no need for a mounted shared drive. The path.repo parameter can be set to a local directory of your node. It is not recommended to run a production server on a single node cluster.

Once this setting is added to config/elasticsearch.yml on all nodes, please restart all the nodes of your cluster.

The next step is to register a named repository under this registered folder. This is done using the following curl command, where we are registering a named repository with the name backups:

curl -XPUT 'http://localhost:9200/_snapshot/backups' -H 'Content-Type: application/json' -d '{
"type": "fs",
"settings": {
"location": "/mount/es_backups/backups",
"compress": true
}
}'

You will need to replace localhost with the hostname or IP address of one of the nodes on your cluster. The type parameter set to fs is for the shared filesystem. The settings parameter's body depends on the type parameter's value.

Since we are currently looking at a shared filesystem snapshot repository, the body of the settings parameter has specific parameters to set up the shared filesystem-based repository. If the location parameter is specified as an absolute path, it must be under one of the folders registered with the path.repo parameter in elasticsearch.yml. If the location parameter is not an absolute path, Elasticsearch will assume it is a relative path from the path.repo parameter. The compress parameter saves the snapshots in compressed format.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.126.122