LSX-blog

Feed Rss

【原创】利用pt-table-checksum 检查主从一致

09.24.2013, Linux, MYSQL, by .

官方参照

       http://www.percona.com/doc/percona-toolkit/2.2/pt-table-checksum.html

介绍

       pt-table-checksum是一个Percona的一个小工具,主要可以用于 主从迁移前后的数据检查

是否一致,或者主从复制出现问题,需要确定那些表不一致.

环境

      master:192.168.0.156—–slave:192.168.0.154

      校验数据库:X25

准备工作

1、登陆Slave库 执行如下SQL      

1
2
3
GRANT SELECT, PROCESS, SUPER, REPLICATION SLAVE \
ON *.* TO 'checksums'@'192.168.0.%' IDENTIFIED BY 'checksums';
flush privileges;

2、登陆Master库 创建数据库及表

1
2
3
4
5
6
7
8
9
CREATE DATABASE percona CHARACTER SET utf8;
CREATE TABLE `dsns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) DEFAULT NULL,
  `dsn` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
);
INSERT INTO dsns (parent_id,dsn) \
values (1,'h=192.168.0.154,u=checksums,p=checksums');

3、在Master 服务器执行

1
2
3
./pt-table-checksum --user='root' --password='password' \
--databases='x25' --recursion-method dsn=h=localhost,D=percona,t=dsns \
--no-check-binlog-format --no-check-replication-filters

【原创】利用pt-table-checksum 检查主从一致 有 30 条回应

  1. However, you will not get a second-chance to have your successful streak because of lack of finance.

    回复
  2. At this time it appears like WordPress is the preferred blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?| а

    回复
  3. magnificent put up, very informative. I ponder why the other
    specialists of this sector don’t understand this. You should proceed your writing.
    I am confident, you have a great readers’ base already!

    回复
  4. If you want to get a good deal from this paragraph then you have to apply these techniques to your
    won blog.

    回复
  5. This is a very good tip particularly to those
    fresh to the blogosphere. Brief but very accurate information… Appreciate your sharing this one.
    A must read article!

    回复
  6. Hello there, You’ve done a fantastic job.

    I’ll definitely digg it and personally suggest to my friends.
    I’m sure they’ll be benefited from this web site.

    回复
  7. Hi there, I enjoy reading through your article. I wanted to write a little comment to support you.

    回复
  8. If some one wishes to be updated with latest technologies therefore he
    must be pay a visit this website and be up to date
    everyday.

    回复
  9. I used to be recommended this website through my cousin.
    I’m now not sure whether or not this submit is written through him
    as nobody else recognise such specific about my problem. You’re amazing!
    Thank you!

    回复
  10. This is a topic that’s close to my heart… Thank you! Where
    are your contact details though?

    回复
  11. Hi there everyone, it’s my first visit at this web page, and paragraph is truly fruitful in favor of me, keep up posting
    such posts.

    回复
  12. Interesting blog! Is your theme custom made or did you download it from
    somewhere? A theme like yours with a few simple adjustements would
    really make my blog stand out. Please let me know where you got
    your design. With thanks

    回复
  13. Hello, I want to subscribe for this blog to get newest updates, therefore where
    can i do it please assist.

    回复
  14. Hey! This is kind of off topic but I need some help from an established blog.
    Is it very difficult to set up your own blog? I’m not very techincal but I can figure things
    out pretty fast. I’m thinking about setting up my own but I’m not sure where to start.
    Do you have any tips or suggestions? Thank you

    回复
  15. Attractive component of content. I just stumbled upon your weblog and in accession capital to assert that I
    get actually loved account your blog posts. Anyway I
    will be subscribing to your augment or even I achievement you access consistently rapidly.

    回复
  16. Hello, I log on to your new stuff on a regular basis.

    Your story-telling style is witty, keep doing what you’re doing!

    回复
  17. First of all I would like to say terrific blog!
    I had a quick question which I’d like to ask if you do not mind.

    I was interested to find out how you center yourself and clear your thoughts before writing.
    I’ve had a tough time clearing my mind in getting
    my thoughts out there. I do enjoy writing however it just
    seems like the first 10 to 15 minutes are lost just trying to figure out how to begin. Any ideas or tips?
    Many thanks!

    回复
  18. You really make it seem so easy with your presentation but I find
    this topic to be really something that I think I would
    never understand. It seems too complicated and extremely broad for me.
    I am looking forward for your next post, I’ll try to get the
    hang of it!

    回复
  19. I have been browsing online greater than three hours lately, but
    I by no means found any fascinating article like yours.
    It is lovely price sufficient for me. In my opinion, if
    all website owners and bloggers made excellent content as you did, the internet will probably be a lot more useful
    than ever before.

    回复
  20. Have you ever thought about including a little bit more than just your articles?
    I mean, what you say is fundamental and all.
    But think about if you added some great photos or video clips to give your posts more, “pop”!
    Your content is excellent but with pics and video clips, this website could
    certainly be one of the greatest in its field. Great blog!

    回复
  21. Hello there! This post could not be written much better!
    Reading through this article reminds me of my previous roommate!
    He continually kept preaching about this. I’ll forward this information to him.

    Pretty sure he’s going to have a great read.
    Thank you for sharing!

    回复
  22. Hi Dear, are you truly visiting this web site on a regular basis, if so afterward
    you will without doubt get nice knowledge.

    回复
  23. With havin so much content and articles do you ever run into any
    problems of plagorism or copyright violation? My website has a
    lot of exclusive content I’ve either authored myself or outsourced but it seems a lot of it
    is popping it up all over the web without my authorization. Do you know any techniques to help stop
    content from being stolen? I’d genuinely appreciate it.

    回复
  24. We stumbled over here coming from a different page
    and thought I might as well check things out. I like what I see so i am just
    following you. Look forward to looking into your web page for a second time.

    回复
  25. Aw, this was an extremely nice post. Spending some time
    and actual effort to make a top notch article… but what can I
    say… I procrastinate a lot and never seem to get nearly anything done.

    回复
  26. When some one searches for his vital thing, thus he/she wants to be available that in detail, so that thing
    is maintained over here.

    回复
  27. Heya i am for the first time here. I found this board and I find It truly useful & it helped me out a lot.
    I hope to give something back and help others like you aided me.

    回复
  28. Appreciate this post. Will try it out.

    回复
  29. This website was… how do I say it? Relevant!!
    Finally I have found something that helped me. Appreciate it!

    回复
  30. forum viagra pour femme

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注