Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need docs on how to add a new vttablet to an existing shard #403

Closed
lihezh opened this issue Feb 13, 2015 · 4 comments
Closed

Need docs on how to add a new vttablet to an existing shard #403

lihezh opened this issue Feb 13, 2015 · 4 comments

Comments

@lihezh
Copy link

lihezh commented Feb 13, 2015

first I have a live shard in a cell and two vttablets/databases instance in the shard, I create a table in the master database of the shard and insert data into the database through the mysql client(not vtgate), the other database of the shard could auto sync data from master database.Then I add a new vttablet and daabase instance into the shard,but I found that the new database didn't auto sync data from master database of the shard finally, the new database is empty.
Thanks very much!

@enisoc enisoc changed the title problem about data consistency after add a new vttablet into a shard Need docs on how to add a new vttablet to an existing shard Feb 13, 2015
@enisoc
Copy link
Member

enisoc commented Feb 13, 2015

We've had a couple questions about this, so I'm making this into a tracking issue to consolidate.

To add a new tablet to an existing shard, you need to do one of two things:

  1. Use the vtctlclient Clone command to copy the data from an existing tablet that has it. Note that this will take the source tablet out of serving state during the copy.

  2. Take a backup from an existing tablet with vtctlclient Snapshot and use a hook script to copy it to external storage somewhere. Then use vtctlclient Restore on the new tablet with a hook script that copies it back from external storage. The advantage of this over Clone is that you can make a single backup and then restore it to any number of tablets without taking existing tablets out of serving during the restore.

We're still working on writing documentation for these processes, and we'll update this issue when we have something. In the meantime, if you want to try to forge ahead of our docs, you can look at how it's done in the integration test script:

  1. For Clone: https://github.com/youtube/vitess/blob/master/test/clone.py#L234
  2. For Snapshot/Restore: https://github.com/youtube/vitess/blob/master/test/clone.py#L150

If you have any followup questions along the way, we'd be happy to help as it will be useful for the documentation effort.

@lihezh
Copy link
Author

lihezh commented Feb 14, 2015

Thanks! I will look at the test scripts and hope to do something helpful. I think that is useful to make the process as simple as possible.

@mitiger
Copy link

mitiger commented Feb 28, 2015

I see the clone.py and try it, but with a problem , it need wo tablet alias type for idle, but i do not know hao to create a tablet which type is idle?

@alainjobart
Copy link
Contributor

We just reworked our backup / restore to be a lot more straightforward and much simpler. Now the backups are handled with the 'vtctl Backup' command, and the restore is a vttablet startup option. See doc/BackupAndRestore.md for more details.

At this point, we are just in need of an implementation of BackupStorage on different Cloud services (we already provide the local file system one, that would work over NFS, or any file system that can be mounted on the local machine).

So I'm going to close this issue, let us know if something still needs attention. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants