registry-service

command
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

README

registry-service

Note regarding restarting etcd cluster: If you kill majority of etcd nodes, ie. you lose quorum, you will need to restore the cluster. Trying to simply restart any of the nodes doesn't work. Etcd retains its old ID and cluster membership info in its data directory (<name>.etcd). Restarting a node with its old data directory causes it to attempt and fail to reach quorum among the old members, which might not even be alive anymore. Starting a brand new cluster means you lose key-value store data. Trying to connect a new node to a node from the old cluster causes mismatched cluster IDs.

In my own testing, this is how I recovered the key-value store while starting a new cluster.

  1. Kill all etcd and hl-service nodes.

  2. Pick one node. Save its snapshot "db" file somewhere. It can be found under etcd's data directory, <name>.etcd/member/snap/db. You will then have to delete (or just move to be safe) the data directory. Note in hl-service the convention for name is <ip>-<client_port>-<peer_port> eg. 10.11.17.11-2379-2380

  3. Restore from the snapshot db, creating a new data directory, but with the ID and cluster membership info overwritten, allowing you to start a new cluster, but with the old key-value data.

$ etcdctl snapshot restore <path/to/snapshot/db> \
  --name <name> \
  --initial-cluster <name>=http://<ip>:<peer_port> \
  --initial-advertise-peer-urls http://<ip>:<peer_port> \
  --skip-hash-check=true

eg.

$ etcdctl snapshot restore old.etcd/member/snap/db \
  --name 10.11.17.11-2379-2380 \
  --initial-cluster 10.11.17.11-2379-2380=http://10.11.17.11:2380 \
  --initial-advertise-peer-urls http://10.11.17.11:2380 \
  --skip-hash-check=true
  1. Start hl-service as if you were starting a new cluster. You should find you can successfully run this node and still have the original key-value data. eg. $ ./hl-service --etcd-ip 10.11.17.11 --new-etcd-cluster

  2. To restart other nodes, delete the other nodes' etcd data directory and run hl-service as if you were connecting to an existing cluster. eg. $ ./hl-service --etcd-ip 10.11.17.13

  3. Done.

More info: https://etcd.io/docs/v3.3.12/op-guide/recovery/

Documentation

Overview

Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL