MySql slaves on Amazon EC2 RHEL 7.6 server not getting connected automatically after mysql service restart on...












0















I have setup MySQL Master - slave replication on Amazon EC2 instance.
OS : RHEL 7.6
MySQL Version: 8.0.13
Mater server IP : 192.168.1.128
Slave server IP : 192.168.1.129



I have two ec2 instance on which i have configured one ec2 as Master and another one as its slave.
I have created user "replicator" on master server for replication with " %" host.
After executing change master statement on slave server as mentioned below.



CHANGE MASTER TO MASTER_HOST='192.168.1.128',MASTER_USER='replicator', MASTER_PASSWORD='Replication@123', MASTER_HEARTBEAT_PERIOD=5, MASTER_LOG_FILE='mysql-bin.000063', MASTER_LOG_POS=195;



I have executed start slave and show slave statusG command on slave server i.e. on 192.168.1.129 .
i have got following error:



    Slave_IO_State: Connecting to master
Master_Host: 192.168.1.128
Master_User: replicator
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
Last_IO_Error: error connecting to master replication@192.168.1.128:3306 - retry-time: 60 retries: 8


Then i have taken login to master mysql server from slave server i.e.
mysql -u replicator -p -h192.168.1.128
slave started sucessfully.



show slave statusG ouput:



    Slave_IO_Running: Yes
Slave_SQL_Running: Yes


After all these i came to know that i have to repeat this step i.e. mysql -u replicator -p -h192.168.1.128 from slave server every time whenever master MySQL service restart. Otherwise replication will not take place and we will get the same error as describe above i,e. error connecting to master 'replication@192.168.1.128:3306'



!! Thanks for any help in advance !!









share









New contributor




Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have setup MySQL Master - slave replication on Amazon EC2 instance.
    OS : RHEL 7.6
    MySQL Version: 8.0.13
    Mater server IP : 192.168.1.128
    Slave server IP : 192.168.1.129



    I have two ec2 instance on which i have configured one ec2 as Master and another one as its slave.
    I have created user "replicator" on master server for replication with " %" host.
    After executing change master statement on slave server as mentioned below.



    CHANGE MASTER TO MASTER_HOST='192.168.1.128',MASTER_USER='replicator', MASTER_PASSWORD='Replication@123', MASTER_HEARTBEAT_PERIOD=5, MASTER_LOG_FILE='mysql-bin.000063', MASTER_LOG_POS=195;



    I have executed start slave and show slave statusG command on slave server i.e. on 192.168.1.129 .
    i have got following error:



        Slave_IO_State: Connecting to master
    Master_Host: 192.168.1.128
    Master_User: replicator
    Slave_IO_Running: Connecting
    Slave_SQL_Running: Yes
    Last_IO_Error: error connecting to master replication@192.168.1.128:3306 - retry-time: 60 retries: 8


    Then i have taken login to master mysql server from slave server i.e.
    mysql -u replicator -p -h192.168.1.128
    slave started sucessfully.



    show slave statusG ouput:



        Slave_IO_Running: Yes
    Slave_SQL_Running: Yes


    After all these i came to know that i have to repeat this step i.e. mysql -u replicator -p -h192.168.1.128 from slave server every time whenever master MySQL service restart. Otherwise replication will not take place and we will get the same error as describe above i,e. error connecting to master 'replication@192.168.1.128:3306'



    !! Thanks for any help in advance !!









    share









    New contributor




    Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have setup MySQL Master - slave replication on Amazon EC2 instance.
      OS : RHEL 7.6
      MySQL Version: 8.0.13
      Mater server IP : 192.168.1.128
      Slave server IP : 192.168.1.129



      I have two ec2 instance on which i have configured one ec2 as Master and another one as its slave.
      I have created user "replicator" on master server for replication with " %" host.
      After executing change master statement on slave server as mentioned below.



      CHANGE MASTER TO MASTER_HOST='192.168.1.128',MASTER_USER='replicator', MASTER_PASSWORD='Replication@123', MASTER_HEARTBEAT_PERIOD=5, MASTER_LOG_FILE='mysql-bin.000063', MASTER_LOG_POS=195;



      I have executed start slave and show slave statusG command on slave server i.e. on 192.168.1.129 .
      i have got following error:



          Slave_IO_State: Connecting to master
      Master_Host: 192.168.1.128
      Master_User: replicator
      Slave_IO_Running: Connecting
      Slave_SQL_Running: Yes
      Last_IO_Error: error connecting to master replication@192.168.1.128:3306 - retry-time: 60 retries: 8


      Then i have taken login to master mysql server from slave server i.e.
      mysql -u replicator -p -h192.168.1.128
      slave started sucessfully.



      show slave statusG ouput:



          Slave_IO_Running: Yes
      Slave_SQL_Running: Yes


      After all these i came to know that i have to repeat this step i.e. mysql -u replicator -p -h192.168.1.128 from slave server every time whenever master MySQL service restart. Otherwise replication will not take place and we will get the same error as describe above i,e. error connecting to master 'replication@192.168.1.128:3306'



      !! Thanks for any help in advance !!









      share









      New contributor




      Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have setup MySQL Master - slave replication on Amazon EC2 instance.
      OS : RHEL 7.6
      MySQL Version: 8.0.13
      Mater server IP : 192.168.1.128
      Slave server IP : 192.168.1.129



      I have two ec2 instance on which i have configured one ec2 as Master and another one as its slave.
      I have created user "replicator" on master server for replication with " %" host.
      After executing change master statement on slave server as mentioned below.



      CHANGE MASTER TO MASTER_HOST='192.168.1.128',MASTER_USER='replicator', MASTER_PASSWORD='Replication@123', MASTER_HEARTBEAT_PERIOD=5, MASTER_LOG_FILE='mysql-bin.000063', MASTER_LOG_POS=195;



      I have executed start slave and show slave statusG command on slave server i.e. on 192.168.1.129 .
      i have got following error:



          Slave_IO_State: Connecting to master
      Master_Host: 192.168.1.128
      Master_User: replicator
      Slave_IO_Running: Connecting
      Slave_SQL_Running: Yes
      Last_IO_Error: error connecting to master replication@192.168.1.128:3306 - retry-time: 60 retries: 8


      Then i have taken login to master mysql server from slave server i.e.
      mysql -u replicator -p -h192.168.1.128
      slave started sucessfully.



      show slave statusG ouput:



          Slave_IO_Running: Yes
      Slave_SQL_Running: Yes


      After all these i came to know that i have to repeat this step i.e. mysql -u replicator -p -h192.168.1.128 from slave server every time whenever master MySQL service restart. Otherwise replication will not take place and we will get the same error as describe above i,e. error connecting to master 'replication@192.168.1.128:3306'



      !! Thanks for any help in advance !!







      mysql





      share









      New contributor




      Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share









      New contributor




      Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share








      edited 1 min ago







      Rahul Kanaujia













      New contributor




      Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 7 mins ago









      Rahul KanaujiaRahul Kanaujia

      1




      1




      New contributor




      Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Rahul Kanaujia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Rahul Kanaujia is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231521%2fmysql-slaves-on-amazon-ec2-rhel-7-6-server-not-getting-connected-automatically-a%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Rahul Kanaujia is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Rahul Kanaujia is a new contributor. Be nice, and check out our Code of Conduct.













          Rahul Kanaujia is a new contributor. Be nice, and check out our Code of Conduct.












          Rahul Kanaujia is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231521%2fmysql-slaves-on-amazon-ec2-rhel-7-6-server-not-getting-connected-automatically-a%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL Server 17 - Attemping to backup to remote NAS but Access is denied

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          Restoring from pg_dump with foreign key constraints