Move a Meta2 Service

Preparation

Find information about the container you want to move. By running openio container locate <container> you will get the list of all meta2 service addresses and base names. You can get list of containers using openio container list.

Launch mover

Since openio-sds 5.0.0, there is a CLI to move the meta2 bases of a container. You can move the container by running openio-admin container move, with the name of the container (alternatively, instead of the name of the container, you can use the option --cid and the name of the base), and the meta2 service source of this container.

# openio-admin container move mycontainer --src 127.0.0.1:6018
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+--------+
| Container   | Base                                                               | Source         | Destination    | Status | Errors |
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+--------+
| mycontainer | 594C8B26EA13E562391013AE6FC360C2C1691F314164DD457EF583B16712E360.1 | 127.0.0.1:6018 | 127.0.0.1:6017 | OK     | None   |
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+--------+

The destination service is automatically selected. The command will return the bases moved.

Move to a specific destination

You can specify a destination where you want to move your container. Add the address of a destination service as a parameter; if the destination isn’t free or up, an error will occur.

# openio-admin container move mycontainer --src 127.0.0.1:6017 --dst 127.0.0.1:6018
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+--------+
| Container   | Base                                                               | Source         | Destination    | Status | Errors |
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+--------+
| mycontainer | 594C8B26EA13E562391013AE6FC360C2C1691F314164DD457EF583B16712E360.1 | 127.0.0.1:6017 | 127.0.0.1:6018 | OK     | None   |
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+--------+

With a destination not free or up, the command returns:

# openio-admin container move mycontainer --src 127.0.0.1:6018 --dst 127.0.0.1:6016
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+----------------------------------------------------------------------------------------------------+
| Container   | Base                                                               | Source         | Destination    | Status | Errors                                                                                             |
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+----------------------------------------------------------------------------------------------------+
| mycontainer | 594C8B26EA13E562391013AE6FC360C2C1691F314164DD457EF583B16712E360.1 | 127.0.0.1:6018 | 127.0.0.1:6016 | error  | Destination service is already used (peers=['127.0.0.1:6018', '127.0.0.1:6019', '127.0.0.1:6016']) |
+-------------+--------------------------------------------------------------------+----------------+----------------+--------+----------------------------------------------------------------------------------------------------+