Between 0.4.x and 2.0, the on-disk data formats have changed. In order to allow users to convert to 2.0, a migration tool is provided.
etcd will detect 0.4.x data dir and update the data automatically (while leaving a backup, in case of emergency).
--name
/ETCD_NAME
.The tool can be run via:
./go build
./etcd-migrate --data-dir=<PATH TO YOUR DATA>
It should autodetect everything and convert the data-dir to be 2.0 compatible. It does not remove the 0.4.x data, and is safe to convert multiple times; the 2.0 data will be overwritten. Recovering the disk space once everything is settled is covered later in the document.
If, however, it complains about autodetecting the name (which can happen, depending on how the cluster was configured), you need to supply the name of this particular node. This is equivalent to the --name
flag (or ETCD_NAME
variable) that etcd was run with, which can also be found by accessing the self api, eg:
curl -L http://127.0.0.1:4001/v2/stats/self
Where the "name"
field is the name of the local machine.
Then, run the migration tool with
./bin/etcd-migrate --data-dir=<PATH TO YOUR DATA> --name=<NAME>
And the tool should migrate successfully. If it still has an error at this time, it's a failure or bug in the tool and it's worth reporting a bug.
If the conversion has completed, the entire cluster is running on something 2.0-based, and the disk space is important, the following command will clear 0.4.x data from the data-dir:
rm -ri snapshot conf log
It will ask before every deletion, but these are the 0.4.x files and will not affect the working 2.0 data.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。