1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
      mariadb主從同步

      本文是搭建的mariadb-10.0.17版本的下載地址:https://downloads.mariadb.org/interstitial/mariadb-10.0.17/source/mariadb-10.0.17.tar.gz/from/http%3A//ftp.hosteurope.de/mirror/archive.mariadb.org/?serve

      創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),長(zhǎng)子企業(yè)網(wǎng)站建設(shè),長(zhǎng)子品牌網(wǎng)站建設(shè),網(wǎng)站定制,長(zhǎng)子網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,長(zhǎng)子網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力。可充分滿足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

      master:192.168.1.166

      slave:192.168.1.165

      1.創(chuàng)建MySQL普通賬號(hào),設(shè)置數(shù)據(jù)庫(kù)存儲(chǔ)數(shù)據(jù)的目錄,設(shè)置權(quán)限

      [root@zsxyweb3 ~]# groupadd -r mysql

      [root@zsxyweb3~]# useradd -r -g mysql -s /sbin/nologin mysql

      [root@zsxyweb3~]# mkdir -p /data/mydata

      [root@zsxyweb3~]# chown -R mysql:mysql /data

       

      2.安裝數(shù)據(jù)庫(kù)依賴軟件包

      [root@zsxyweb3~]# yum install -y gcc gcc-c++ make cmake ncurses ncurses libxml2 libxml2-developenssl-devel bison bison-devel ncurses-devel

       

      3.上傳mariadb包,解壓,編譯安裝。

      [root@zsxyweb3 ~]# tar zxvf mariadb-10.0.17.tar.gz

      [root@zsxyweb3 mariadb-10.0.17]# cmake-DCMAKE_INSTALL_PREFIX=/app/mysql -DMYSQL_DATADIR=/data/mydata-DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STPRAGE_ENGINE=1-DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWIYH_READLINE=1 -DWIYH_SSL=system -DVITH_ZLIB=system-DWITH_LOBWRAP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci

      [root@zsxyweb3 mariadb-10.0.17]# make&& make install

      4.復(fù)制數(shù)據(jù)庫(kù)啟動(dòng)腳本到/etc/init.d/mysqld目錄下,修改/etc/my.cnf配置文件。

      [root@zsxyweb3mariadb-10.0.17]# cd /app/mysql/

      [root@zsxyweb3mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld

      [root@zsxyweb3mysql]# chmod +x /etc/rc.d/init.d/mysqld

      [root@zsxyweb3mysql]# cp support-files/my-large.cnf /etc/my.cnf

      5.初始化數(shù)據(jù)庫(kù),啟動(dòng)數(shù)據(jù)庫(kù)

      [root@zsxyweb3mysql]# scripts/mysql_install_db --user=mysql --datadir=/app/mysql/data

      [root@zsxyweb3mysql]#mkdir log

      [root@zsxyweb3mysql]#service mysqld start

      6.數(shù)據(jù)庫(kù)的系統(tǒng)變量

      [root@zsxyweb3 mysql]# vim/etc/profile.d/mysqld.sh

      export PATH=$PATH:/usr/local/mysql/bin

      [root@zsxyweb3 mysql]# source/etc/profile.d/mysqld.sh

      [root@zsxyweb3 mysql]# mysql

      Welcome to the MySQL monitor.  Commands end with ; or \g.

      Your MySQL connection id is 148

      Server version: 5.5.5-10.0.17-MariaDB-logSource distribution

       

      Copyright (c) 2000, 2013, Oracle and/orits affiliates. All rights reserved.

       

      Oracle is a registered trademark of OracleCorporation and/or its

      affiliates. Other names may be trademarksof their respective

      owners.

       

      Type 'help;' or '\h' for help. Type '\c'to clear the current input statement.

       

      mysql>

      7.master192.168.1.166里/etc/my.cnf 如下

      [client]

      port = 3306

      socket = /tmp/mysql.sock

      [mysqld]

      port = 3306

      socket = /tmp/mysql.sock

      skip-external-locking

      key_buffer_size = 256M

      max_allowed_packet = 4690M

      table_open_cache = 16

      sort_buffer_size = 64M

      read_buffer_size = 32M

      read_rnd_buffer_size = 256M

      myisam_sort_buffer_size = 1024M

      thread_cache_size = 8

      query_cache_size= 128M

      log-error=/app/mysql/log/alert.log

      slow_query_log_file=/app/mysql/log/slow.log

      general_log_file=/app/mysql/log/general.log

      datadir = /app/mysql/data

      log-bin=mysql-bin

      binlog_format=mixed

      server-id = 1

      [mysqldump]

      quick

      max_allowed_packet = 4690M

      [mysql]

      no-auto-rehash

      [myisamchk]

      key_buffer_size = 128M

      sort_buffer_size = 128M

      read_buffer = 2M

      write_buffer = 2M

      [mysqlhotcopy]

      interactive-timeout

       

      8.slave192.168.1.165里/etc/my.cnf

      port = 3306

      socket = /tmp/mysql.sock

      skip-external-locking

      key_buffer_size = 256M

      max_allowed_packet = 1M

      table_open_cache = 256

      sort_buffer_size = 1M

      read_buffer_size = 1M

      read_rnd_buffer_size = 4M

      myisam_sort_buffer_size = 64M

      thread_cache_size = 8

      query_cache_size= 16M

      log-error=/app/mysql/log/alert.log

      slow_query_log_file=/app/mysql/log/slow.log

      general_log_file=/app/mysql/log/general.log

      thread_concurrency = 8

      datadir = /data/mydata

      log-bin=mysql-bin

      binlog_format=mixed

      server-id = 2

      [mysqldump]

      quick

      max_allowed_packet = 16M

      [mysql]

      no-auto-rehash

      [myisamchk]

      key_buffer_size = 128M

      sort_buffer_size = 128M

      read_buffer = 2M

      write_buffer = 2M

      [mysqlhotcopy]

      interactive-timeout

      9.在master數(shù)據(jù)庫(kù)上授權(quán)    mysql

      mysql> GRANT ALL PRIVILEGES ON *.* TO'root'@'192.168.1.% IDENTIFIED BY 'passwd' WITH GRANT OPTION;

      mysql>flush privileges;

      mysql> show master status;

      +------------------+----------+--------------+------------------+

      | File             | Position | Binlog_Do_DB |Binlog_Ignore_DB |

      +------------------+----------+--------------+------------------+

      | mysql-bin.000008 |     2890 |              |                  |

      +------------------+----------+--------------+------------------+

      1 row in set (0.00 sec)

      10.在從slave mysql

      mysql>stop slave;

      mysql> change master tomaster_host='192.168.1.166',master_user='root',master_password='passwd',master_log_file='mysql-bin.000008',master_log_pos=2890,master_connect_retry=5,master_heartbeat_period=2,Master_Port=3306;

      mysql>flush privileges;

      mysql>start slave;

      mysql>show slave status\G

      *************************** 1. row***************************

                     Slave_IO_State: Waiting formaster to send event

                        Master_Host: 192.168.1.166

                        Master_User: root

                        Master_Port: 3306

                      Connect_Retry: 5

                    Master_Log_File: mysql-bin.000008

               Read_Master_Log_Pos: 2890

                     Relay_Log_File:zsxyweb3-relay-bin.000002

                      Relay_Log_Pos: 1198

             Relay_Master_Log_File: mysql-bin.000008

                   Slave_IO_Running: Yes

                 Slave_SQL_Running: Yes

                    Replicate_Do_DB:

               Replicate_Ignore_DB:

                Replicate_Do_Table:

            Replicate_Ignore_Table:

            Replicate_Wild_Do_Table:

       Replicate_Wild_Ignore_Table:

                         Last_Errno: 0

                         Last_Error:

                       Skip_Counter: 0

               Exec_Master_Log_Pos: 2890

                    Relay_Log_Space: 1498

                    Until_Condition: None

                     Until_Log_File:

                      Until_Log_Pos: 0

                Master_SSL_Allowed: No

                Master_SSL_CA_File:

                Master_SSL_CA_Path:

                    Master_SSL_Cert:

                 Master_SSL_Cipher:

                     Master_SSL_Key:

             Seconds_Behind_Master: 0

      Master_SSL_Verify_Server_Cert: No

                      Last_IO_Errno: 0

                      Last_IO_Error:

                     Last_SQL_Errno: 0

                     Last_SQL_Error:

       Replicate_Ignore_Server_Ids:

                   Master_Server_Id: 1

                     Master_SSL_Crl:

                Master_SSL_Crlpath:

                         Using_Gtid: No

                        Gtid_IO_Pos:

      1 row in set (0.00 sec)

      注:主要看看Slave_IO_Running: Yes Slave_SQL_Running: Yes  是否為yes


      文章標(biāo)題:mariadb主從同步
      網(wǎng)址分享:http://ef60e0e.cn/article/gegecc.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        合江县| 白城市| 娄底市| 乌恰县| 弥勒县| 泸溪县| 蒲城县| 柘城县| 成都市| 甘泉县| 平罗县| 定日县| 隆化县| 淮北市| 芦溪县| 黎城县| 延边| 两当县| 寿光市| 海林市| 秦皇岛市| 清徐县| 韶山市| 榆中县| 韶关市| 陕西省| 山西省| 灌南县| 广汉市| 嘉峪关市| 高雄市| 沂源县| 会昌县| 义马市| 东丽区| 温宿县| 濮阳县| 修水县| 南漳县| 庄浪县| 锦州市|