can someone explain 'master d/b' & 'slave' ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karlm
    Senior Member
    • Jun 2006
    • 826
    • 5.3.x

    can someone explain 'master d/b' & 'slave' ?

    I understand the basic principle, for example a slave hard drive using the jumper settings on the back, but I don't understand how it functions in a software sense.

    I assume it means one of two things:
    1) the master contains all and then mirrors it on the slave, if the master cannot write then it refers to the slave.
    2) the master contains x amount of data and the remainer is written to the slave.

    Could someone explain this for a numbskull such as myself, please?

    Thankies

    also, does it offer any improvement by using a slave (i get a lot of timeouts/page cannot be found/server too loaded errors)
    VB 5.4.1 - PHP 7..2.4 - MySQL 5.5.56
    No Addons - none at all.
  • karlm
    Senior Member
    • Jun 2006
    • 826
    • 5.3.x

    #2
    Also, can I make it that my main database is held on one host (e.g. myforum.com) and the slave on another database (e.g. myslavemysql.com) ?
    VB 5.4.1 - PHP 7..2.4 - MySQL 5.5.56
    No Addons - none at all.

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 74167

      #3
      Master Database: All information is written here and copied to the slave by MySQL replication.

      Slave Database: All information is read from here to lower the demand on the master.

      the master contains all and then mirrors it on the slave, if the master cannot write then it refers to the slave.
      This would require failover and a clustering solution which would be different than what vBulletin supports directly.

      Option 2 isn't supported at all because partial databases are nothing but headache.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

      • karlm
        Senior Member
        • Jun 2006
        • 826
        • 5.3.x

        #4
        If I didn't include a slave originally, can I edit my conf to include a slave at a later point (like, now) - or will that cause any problems?
        VB 5.4.1 - PHP 7..2.4 - MySQL 5.5.56
        No Addons - none at all.

        Comment

        • Wayne Luke
          vBulletin Technical Support Lead
          • Aug 2000
          • 74167

          #5
          You can set it up later.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API

          Comment

          • karlm
            Senior Member
            • Jun 2006
            • 826
            • 5.3.x

            #6
            Thanks - i'll be adding a slave shortly in the hopes of improving my forum's performance a tad.
            VB 5.4.1 - PHP 7..2.4 - MySQL 5.5.56
            No Addons - none at all.

            Comment

            • bonjurkes
              Senior Member
              • Apr 2005
              • 257
              • 3.6.x

              #7
              is it a good idea to use slave and master db on same server or my slave database must be on different server than the master db?

              Comment

              • Wayne Luke
                vBulletin Technical Support Lead
                • Aug 2000
                • 74167

                #8
                A slave on the same machine serves no purpose and will only increase resource usage.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment

                • karlm
                  Senior Member
                  • Jun 2006
                  • 826
                  • 5.3.x

                  #9
                  This is something that has me confused (as ever) and I had planned to enquire about this anyway...

                  When going through the config file, I see that I can set the following for my Master database:
                  PHP Code:
                  $config['Database']['dbname'] = 'example-db-name1';
                  $config['MasterServer']['servername'] = 'abcdefg';
                  $config['MasterServer']['port'] = 1234;
                  $config['MasterServer']['username'] = 'my-username1';
                  $config['MasterServer']['password'] = 'my-password1'

                  Then, we move onto the slave... and I can only set these paramaters:

                  PHP Code:
                  $config['SlaveServer']['servername'] = 'example-db-name2';
                  $config['SlaveServer']['port'] = 4321;
                  $config['SlaveServer']['username'] = 'my-username2';
                  $config['SlaveServer']['password'] = 'my-password2'
                  Where do I set my database name for a slave db? Sorry if this a complete n00b question, but MySQL and php aren't really my thing. (though I'm sure you figured that already)
                  VB 5.4.1 - PHP 7..2.4 - MySQL 5.5.56
                  No Addons - none at all.

                  Comment

                  • jasonlitka
                    Senior Member
                    • Mar 2006
                    • 1489
                    • 4.0.x

                    #10
                    Originally posted by Wayne Luke
                    A slave on the same machine serves no purpose and will only increase resource usage.
                    Not at all true. If your site is to the point where you're seeing searches causing table locks, a second instance of mysqld can really decrease load by avoiding those locks.
                    Jason Litka - Utter Ramblings

                    Comment

                    • jasonlitka
                      Senior Member
                      • Mar 2006
                      • 1489
                      • 4.0.x

                      #11
                      Originally posted by karlm
                      Where do I set my database name for a slave db? Sorry if this a complete n00b question, but MySQL and php aren't really my thing. (though I'm sure you figured that already)
                      The DB name on the slave is the same as the master. This is because, unless you go well out of your way, MySQL does not do any translation when moving data from A to B using the binary log.

                      I think I need to ask at this point what it is that you think you are doing? It seems from your posting that you are under the impression that vBulletin will be handling the replication of data and that this is all really plug and play. As you can assume from that last statement, that simply isn't the case.

                      Database replication needs to be configured at the server level. If you don't have a dedicated server or VPS, this is not something you will be able to do. On that, even if you do, this is something that should really only be attempted by those that understand what they are doing and are willing to accept the risks along with the benefits (like RAID 0 on hard drives, you've just doubled your chance of failure).

                      If I have misjudged your site configuration or your abilities, my apologies. In that case, please post more data about your setup and I'll see if I can help you out.
                      Jason Litka - Utter Ramblings

                      Comment

                      • ComputerModding
                        Member
                        • Sep 2007
                        • 76

                        #12
                        Do you have to copy the master database over to the slave before setting this up or will vBulletin see that the slave is empty and automate the copy for you?

                        Comment

                        • jasonlitka
                          Senior Member
                          • Mar 2006
                          • 1489
                          • 4.0.x

                          #13
                          Originally posted by jason|xoxide
                          It seems from your posting that you are under the impression that vBulletin will be handling the replication of data and that this is all really plug and play. As you can assume from that last statement, that simply isn't the case.

                          Database replication needs to be configured at the server level. If you don't have a dedicated server or VPS, this is not something you will be able to do.
                          Everything is done at the server-level. All vB does is direct certain queries to the slave server to reduce the load on the master.
                          Jason Litka - Utter Ramblings

                          Comment

                          • Mansour_Q
                            New Member
                            • Nov 2007
                            • 20
                            • 3.6.x

                            #14
                            If you don't have a dedicated server or VPS, this is not something you will be able to do


                            Explain Why ?

                            Comment

                            • Wayne Luke
                              vBulletin Technical Support Lead
                              • Aug 2000
                              • 74167

                              #15
                              Because it requires setting up replication with MYSQL and that requires root access to the server.
                              Translations provided by Google.

                              Wayne Luke
                              The Rabid Badger - a vBulletin Cloud demonstration site.
                              vBulletin 5 API

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...