title | summary |
---|---|
tiup mirror init |
The `tiup mirror init` command initializes an empty mirror, generating root.json, 1.index.json, snapshot.json, and timestamp.json files. Use `tiup mirror init <path>` to specify a local directory for mirror files. Use the -k or --key-dir option to specify the directory for private key files. If the specified directory is not empty, an error will be reported. |
The command tiup mirror init
is used to initialize an empty mirror. The initialized mirror does not contain any components or component owners. The command only generates the following files for the initialized mirror:
+ <mirror-dir> # Mirror's root directory
|-- root.json # Mirror's root certificate
|-- 1.index.json # Component/user index
|-- snapshot.json # Mirror's latest snapshot
|-- timestamp.json # Mirror's latest timestamp
|--+ keys # Mirror's private key (can be moved to other locations)
|-- {hash1..hashN}-root.json # Private key of the root certificate
|-- {hash}-index.json # Private key of the indexes
|-- {hash}-snapshot.json # Private key of the snapshots
|-- {hash}-timestamp.json # Private key of the timestamps
For the specific usage and content format of the above files, refer to TiUP Mirror Reference Guide.
tiup mirror init <path> [flags]
<path>
is used to specify a local directory where TiUP generates and stores mirror files. The local directory can be a relative path. If the specified directory already exists, it must be empty; if it does not exist, TiUP creates it automatically.
- Specifies the directory where TiUP generates private key files. If the specified directory does not exist, TiUP automatically creates it.
- Data type:
STRING
- If this option is not specified in the command, TiUP generates private key files in
{path}/keys
by default.
- If the command is executed successfully, there is no output.
- If the specified
<path>
is not empty, TiUP reports the errorError: the target path '%s' is not an empty directory
. - If the specified
<path>
is not a directory, TiUP reports the errorError: fdopendir: not a directory
.