Documentation ¶
Overview ¶
Package snapshot implements utilities around etcd snapshot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // Save fetches snapshot from remote etcd server and saves data // to target path. If the context "ctx" is canceled or timed out, // snapshot save stream will error out (e.g. context.Canceled, // context.DeadlineExceeded). Make sure to specify only one endpoint // in client configuration. Snapshot API must be requested to a // selected node, and saved snapshot is the point-in-time state of // the selected node. Save(ctx context.Context, cfg clientv3.Config, dbPath string) error // Status returns the snapshot file information. Status(dbPath string) (Status, error) // Restore restores a new etcd data directory from given snapshot // file. It returns an error if specified data directory already // exists, to prevent unintended data directory overwrites. Restore(cfg RestoreConfig) error }
Manager defines snapshot methods.
type RestoreConfig ¶
type RestoreConfig struct { // SnapshotPath is the path of snapshot file to restore from. SnapshotPath string // Name is the human-readable name of this member. Name string // OutputDataDir is the target data directory to save restored data. // OutputDataDir should not conflict with existing etcd data directory. // If OutputDataDir already exists, it will return an error to prevent // unintended data directory overwrites. // If empty, defaults to "[Name].etcd" if not given. OutputDataDir string // OutputWALDir is the target WAL data directory. // If empty, defaults to "[OutputDataDir]/member/wal" if not given. OutputWALDir string // PeerURLs is a list of member's peer URLs to advertise to the rest of the cluster. PeerURLs []string // InitialCluster is the initial cluster configuration for restore bootstrap. InitialCluster string // InitialClusterToken is the initial cluster token for etcd cluster during restore bootstrap. InitialClusterToken string // SkipHashCheck is "true" to ignore snapshot integrity hash value // (required if copied from data directory). SkipHashCheck bool }
RestoreConfig configures snapshot restore operation.
Click to show internal directories.
Click to hide internal directories.