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 检查主从一致 有 8,398 条回应

  1. hello there and thank you for your info – I have definitely picked
    up anything new from right here. I did however expertise some technical points using this site, since I experienced to reload the site a lot of times previous to I could get it to load properly.
    I had been wondering if your web hosting is OK?

    Not that I am complaining, but slow loading instances times will
    very frequently affect your placement in google and can damage
    your high quality score if advertising and marketing with Adwords.
    Well I’m adding this RSS to my email and could look out for much more of your respective
    intriguing content. Ensure that you update this again soon.

    回复
  2. I love what you guys are usually up too. Such clever work and reporting! Keep up the awesome works guys I’ve added you guys to my blogroll.| а

    回复
  3. It is appropriate time to make some plans for the future and it is time to be happy. I have read this post and if I could I desire to suggest you few interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read even more things about it!| а

    回复
  4. Its such as you learn my mind! You seem to understand a lot approximately this, like you wrote the guide in it or something. I think that you could do with a few % to drive the message house a little bit, but instead of that, that is wonderful blog. A great read. I’ll certainly be back.| а

    回复
  5. I know this if off topic but I’m looking into starting my own blog and was curious what all is needed to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very web savvy so I’m not 100% certain. Any recommendations or advice would be greatly appreciated. Cheers| а

    回复
  6. Hello i am kavin, its my first time to commenting anywhere, when i read this article i thought i could also create comment due to this good article.| а

    回复
  7. Painter And Decorator Gloucester
    38 Bruton Way
    Gloucester GL1 1DA, United Kingdom
    01452 223268

    回复
  8. I’m curious to find out what blog system you’re working with? I’m experiencing some small security issues with my latest site and I’d like to find something more risk-free. Do you have any suggestions?| а

    回复
  9. Hi, I truly do believe this is an excellent site. I stumbledupon it 😉 I will return yet again since i have bookmarked it. Money and freedom is the greatest way to change, may you be rich and then guide others.

    回复
  10. What a data of un-ambiguity and preserveness of valuable familiarity on the topic of unpredicted feelings.| а

    回复
  11. Its like you read my thoughts! You seem to understand so much approximately this, such as you wrote the e book in it or something. I believe that you just can do with a few percent to power the message home a little bit, but instead of that, this is fantastic blog. A fantastic read. I will definitely be back.| а

    回复
  12. I just want to say I am new to weblog and definitely loved your website. More than likely I’m going to bookmark your blog . You amazingly come with good articles. Appreciate it for sharing with us your web site.

    回复
  13. That is a good tip particularly to those new to the blogosphere. Short but very accurate information… Appreciate your sharing this one. A must read post!| а

    回复
  14. I’ll right away grasp your rss as I can’t find your email subscription hyperlink or newsletter service. Do you’ve any? Kindly permit me realize so that I may subscribe. Thanks.| а

    回复
  15. I believe everything typed made a bunch of sense. But, consider this, what if you wrote a catchier title? I mean, I don’t want to tell you how to run your blog, however what if you added something that grabbed people’s attention? I mean it is a little boring. You might peek at Yahoo’s front page and watch how they create article headlines to get viewers to click. You might try adding a video or a picture or two to get people interested about everything’ve written. In my opinion, it might make your posts a little livelier.

    回复
  16. I pay a quick visit everyday a few blogs and sites to read articles, however this weblog offers feature based writing.| а

    回复
  17. Hi there, I enjoy reading through your article post. I like to write a little comment to support you.| а

    回复
  18. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a little bit, but instead of that, this is magnificent blog. A great read. I’ll definitely be back.

    回复
  19. Hello! This is my 1st comment here so I just wanted to give a quick shout out and tell you I truly enjoy reading your posts. Can you suggest any other blogs/websites/forums that go over the same topics? Thank you!| а

    回复
  20. I do trust all of the ideas you have introduced in your post. They are really convincing and can certainly work. Nonetheless, the posts are too quick for starters. May you please extend them a little from subsequent time? Thank you for the post.| а

    回复
  21. excellent points altogether, you simply received a emblem new reader. What would you recommend about your publish that you simply made some days before? Any positive?

    回复
  22. I could not refrain from commenting. Exceptionally well written!| а

    回复
  23. Many thanks, I enjoy it. [url=http://amoxil.fr/]amoxicilina 500[/url]

    回复
  24. Valuable info. Lucky me I found your web site by accident, and I’m surprised why this twist of fate did not came about earlier! I bookmarked it.| а

    回复
  25. I really like looking through a post that will make men and women think. Also, thank you for permitting me to comment!| а

    回复
  26. Hello colleagues, how is the whole thing, and what you would like to say about this paragraph, in my view its truly awesome in support of me.| а

    回复
  27. Fine way of explaining, and fastidious paragraph to obtain information concerning my presentation subject, which i am going to present in university.| а

    回复
  28. Oh my goodness! Awesome article dude! Thank you,
    However I am going through difficulties with your RSS.
    I don’t know the reason why I cannot subscribe to it.

    Is there anybody else getting identical RSS issues?
    Anyone who knows the answer will you kindly respond?
    Thanks!!

    回复
  29. Hi i am kavin, its my first occasion to commenting anywhere, when i read this piece of writing i thought i could also create comment
    due to this good post.

    回复
  30. I like it when individuals come together and share thoughts. Great blog, stick with it!| а

    回复
  31. I’m not sure where you’re getting your info, but good topic.

    I needs to spend some time learning much more or understanding more.
    Thanks for great info I was looking for this information for my mission.

    回复
  32. Hi! I just wanted to ask if you ever have any trouble
    with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard
    work due to no backup. Do you have any solutions to prevent hackers?

    回复
  33. I enjoy what you guys are up too. This type of clever work and exposure! Keep up the great works guys I’ve incorporated you guys to my blogroll.| а

    回复
  34. Quality articles or reviews is the main to interest the viewers to go to see the web site, that’s what this web page is providing.| а

    回复
  35. Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and aid others like you helped me.| а

    回复
  36. hey there and thank you for your information – I’ve definitely picked up something new from right here. I did however expertise a few technical issues using this site, as I experienced to reload the site a lot of times previous to I could get it to load correctly. I had been wondering if your web hosting is OK? Not that I am complaining, but slow loading instances times will very frequently affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Anyway I’m adding this RSS to my email and could look out for a lot more of your respective intriguing content. Ensure that you update this again soon.| а

    回复
  37. Piece of writing writing is also a excitement, if you be familiar with then you can write otherwise it is difficult to write.| а

    回复
  38. Great post but I was wanting to know if you could write a litte more on this topic? I’d be very thankful if you could elaborate a little bit more. Kudos!| а

    回复
  39. I really like your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you? Plz respond as I’m looking to create my own blog and would like to know where u got this from. thank you| а

    回复
  40. Wonderful work! That is the type of information that are supposed to be shared across the net. Shame on the search engines for not positioning this post upper! Come on over and seek advice from my site . Thanks =)| а

    回复
  41. Every weekend i used to go to see this web site, as i wish for enjoyment, since this this site conations truly fastidious funny material too.| а

    回复
  42. I really like your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you? Plz reply as I’m looking to create my own blog and would like to find out where u got this from. kudos| а

    回复
  43. Hmm is anyone else experiencing problems with the images on this blog loading? I’m trying to figure out if its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated.| а

    回复
  44. Hi there! Someone in my Facebook group shared this site with us so I came to give it a look. I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers! Superb blog and wonderful design.| а

    回复
  45. When I originally commented I appear to have clicked the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I receive four emails with the same comment. There has to be an easy method you can remove me from that service? Appreciate it!| а

    回复
  46. I visited several blogs but the audio feature for audio songs present at this website is genuinely excellent.

    回复
  47. Undeniably believe that which you stated. Your favorite justification appeared to be on the web the easiest thing to be aware of.
    I say to you, I certainly get annoyed while people consider worries that they
    plainly don’t know about. You managed to hit the nail upon the top as well
    as defined out the whole thing without having side effect , people could take a signal.
    Will probably be back to get more. Thanks

    回复
  48. We stumbled over here from a different web address and thought I should check things out.
    I like what I see so now i’m following you. Look forward to checking out your web page yet again.

    回复

发表评论

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