当前位置: 首页 > news >正文

淘宝网站的建设情况标题seo是什么意思

淘宝网站的建设情况,标题seo是什么意思,delphi 2010 网站开发,怎样修改静态公司网站页面电话目录 一、mysql为什么要用主从架构? 二、mysql数据库主从复制原理是什么? 详细的主从复制过程如下图: 主从复制过程概述: 三、mysql主从如何搭建? 本次安装的数据库版本为mysql5.7 1、准备两台服务器&#xff08…

目录

一、mysql为什么要用主从架构?

二、mysql数据库主从复制原理是什么?

详细的主从复制过程如下图:

主从复制过程概述:

三、mysql主从如何搭建?

本次安装的数据库版本为mysql5.7

1、准备两台服务器(配置如下)

2、增加yum源安装mysql

3、查看安装的mysql

4、安装mysql

5、启动mysql并查看状态

6、查看mysql的临时root密码,并登录修改密码

7、修改主库mysql_master /etc/my.cnf 的配置文件

8、修改从库master /etc/my.cnf 的配置文件

9、重启mysql_master、mysql_slave

10、登录主库mysql_master,创建主从连接帐号与授权

11、登录mysql_slave建立主从连接

12、确认配置并验证

13、在主库创建库、表、插入数据进行测试。    


一、mysql为什么要用主从架构?

1、高可用,实时灾备,用于故障切换。比如主库挂了,可以切从库;
2、读写分离,提供查询服务,减少主库压力,提升性能;
3、备份数据,避免影响业务。

二、mysql数据库主从复制原理是什么?

详细的主从复制过程如下图:

主从复制过程概述:

1、主库的更新SQL(update、insert、delete)被写到binlog;
2、从库发起连接,连接到主库;
3、此时主库创建一个binlog dump thread,把bin log的内容发送到从库;
4、从库启动之后,创建一个I/O线程,读取主库传过来的bin log内容并写入到中继日志relay log;
5、从库还会创建一个SQL线程,从relay log里面读取内容,从ExecMasterLog_Pos位置开始执行,读取到的更新事件,将更新内容写入到slave的db。

三、mysql主从如何搭建?

本次安装的数据库版本为mysql5.7

主从关系: Mysql_master为主,Mysql_slave为从

1、准备两台服务器(配置如下)

   mysql_master ip:192.168.40.142
   mysql_slave ip:   192.168.40.143

    镜像:Centos7.9
    虚机配置:4U4G  100G存储
    /boot     800MB
    /swap    4G
    /            95.2G 

    虚拟机安装完成后配置网卡
    [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 
    TYPE=Ethernet
    BOOTPROTO=dhcp
    DEFROUTE=yes
    NAME=ens33
    DEVICE=ens33
    ONBOOT=yes

    关闭防火墙
    systemctl stop firewalld && systemctl disable  firewalld

    关闭selinux
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

    下载并配置163的yum源
    cd /etc/yum.repos.d && mkdir bak && mv CentOS* bak && curl http://mirrors.163.com/.help/CentOS7-Base-163.repo >163.repo

    下载常用工具
    yum clean all && yum makecache && yum install net-tools vim wget  lrzsz  -y

2、增加yum源安装mysql

   vim /etc/yum.repos.d/163.repo
    在最下方插入如下配置
    [mysql-innovation-community]
    name=MySQL5.7 Release Community Server
    baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/
    enabled=1
    gpgcheck=0

3、查看安装的mysql

yum repolist all | grep mysql

4、安装mysql

 yum -y install mysql-community-server  --nogpgcheck

5、启动mysql并查看状态


    systemctl start mysqld
    systemctl status mysqld

6、查看mysql的临时root密码,并登录修改密码


    grep 'temporary password' /var/log/mysqld.log
    mysql -uroot -p
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password@123';
    设置mysql_master root密码为Password@123   mysql_slave root密码为Password@1234

master节点设置

slave节点设置

7、修改主库mysql_master /etc/my.cnf 的配置文件

8、修改从库master /etc/my.cnf 的配置文件

9、重启mysql_master、mysql_slave

systemctl restart mysqld

10、登录主库mysql_master,创建主从连接帐号与授权


CREATE USER 'slave'@'%' IDENTIFIED BY 'Password@12345';

grant replication slave ON *.* TO 'slave'@'%';


flush privileges;

show master status;       #这里要记住 file和position,后面配置slave会用到

11、登录mysql_slave建立主从连接

stop slave;     #关闭slave

change master to master_host='192.168.40.142', master_user='slave', master_password='Password@12345',master_log_file='mysql-bin.000001',master_log_pos=749;

start slave;    #开启同步

12、确认配置并验证

从库查看
show slave status \G;
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
表示主从配置成功。

show slave status \G;命令输出如下:

mysql> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.40.142
                  Master_User: slave
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 749
               Relay_Log_File: localhost-relay-bin.000002
                Relay_Log_Pos: 320
        Relay_Master_Log_File: mysql-bin.000001
             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: 749
              Relay_Log_Space: 531
              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_UUID: aa5b3240-696c-11ee-9ab7-000c293bd2c8
             Master_Info_File: /var/lib/mysql/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position: 0
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
1 row in set (0.00 sec)

ERROR: 
No query specified

mysql> 

13、在主库创建库、表、插入数据进行测试。
    

create database test;

    use test;

    create table emp(
        id int auto_increment comment 'ID' primary key ,
        name varchar(10) not null comment '姓名',
        age int comment '年龄',
        job varchar(20) comment '职位',
        salary int comment '薪资',
        entrydate date comment '入职时间',
        managerid int comment '直属领导id',
        dept_id int  comment '部门id'
    ) CHARSET=utf8 comment '员工表';

    insert into emp (id, name, age, job, salary, entrydate, managerid, dept_id)
    values (1,'金庸',45,'总裁',50000,'2000-10-12',null,5),
           (2,'杨逍',33,'开发',20000,'2005-10-21',1,1),
           (3,'张无忌',30,'项目经理',30000,'2008-11-12',1,1);
  

 从库查询
    use test;
    select * from emp;
    
验证OK,主从搭建完成。

百度网盘获取搭建视频及文档:

链接:https://pan.baidu.com/s/1lqkN8DelnBjYCogoHcmWdg 
提取码:4xpe

参考博客:https://blog.csdn.net/qq_39871711/article/details/123494048


文章转载自:
http://dinncofloeberg.bkqw.cn
http://dinncounclipped.bkqw.cn
http://dinncocryptanalyst.bkqw.cn
http://dinncopreludial.bkqw.cn
http://dinncoaphonic.bkqw.cn
http://dinncogammy.bkqw.cn
http://dinncobred.bkqw.cn
http://dinncoaxinite.bkqw.cn
http://dinncolamentedly.bkqw.cn
http://dinncorooseveltite.bkqw.cn
http://dinncohumorously.bkqw.cn
http://dinncoforejudge.bkqw.cn
http://dinncolacus.bkqw.cn
http://dinncopinnacle.bkqw.cn
http://dinncowrappage.bkqw.cn
http://dinncolimit.bkqw.cn
http://dinncogamosepalous.bkqw.cn
http://dinncoreargument.bkqw.cn
http://dinncosheathing.bkqw.cn
http://dinncovisceromotor.bkqw.cn
http://dinncocryology.bkqw.cn
http://dinncoanalogously.bkqw.cn
http://dinncoflyspeck.bkqw.cn
http://dinncomachera.bkqw.cn
http://dinncorarotonga.bkqw.cn
http://dinnconondollar.bkqw.cn
http://dinncobuttstock.bkqw.cn
http://dinncocalyciform.bkqw.cn
http://dinncoconcentrative.bkqw.cn
http://dinncodeliverly.bkqw.cn
http://dinncopanlogistic.bkqw.cn
http://dinncoblend.bkqw.cn
http://dinncooscillogram.bkqw.cn
http://dinncospaciously.bkqw.cn
http://dinncoaciduric.bkqw.cn
http://dinncoswinney.bkqw.cn
http://dinncosemimoist.bkqw.cn
http://dinncotremendously.bkqw.cn
http://dinncobundesrath.bkqw.cn
http://dinncoanachronistic.bkqw.cn
http://dinncoaffirm.bkqw.cn
http://dinncoincult.bkqw.cn
http://dinncoexceptionable.bkqw.cn
http://dinncohistorical.bkqw.cn
http://dinncoacantha.bkqw.cn
http://dinncomunicipalism.bkqw.cn
http://dinncogalvanotactic.bkqw.cn
http://dinncopallbearer.bkqw.cn
http://dinncodanio.bkqw.cn
http://dinncomitred.bkqw.cn
http://dinncohydropac.bkqw.cn
http://dinncodownswing.bkqw.cn
http://dinncoedict.bkqw.cn
http://dinncoblackwash.bkqw.cn
http://dinncommpi.bkqw.cn
http://dinncoathlete.bkqw.cn
http://dinncoltjg.bkqw.cn
http://dinncopathologic.bkqw.cn
http://dinncobasso.bkqw.cn
http://dinncospirea.bkqw.cn
http://dinncohorseshoer.bkqw.cn
http://dinncowellingtonian.bkqw.cn
http://dinncoreclassification.bkqw.cn
http://dinncomignonne.bkqw.cn
http://dinncostrung.bkqw.cn
http://dinncoteratogen.bkqw.cn
http://dinnconawab.bkqw.cn
http://dinncosnovian.bkqw.cn
http://dinncocatabolism.bkqw.cn
http://dinncomorellian.bkqw.cn
http://dinncoltd.bkqw.cn
http://dinncofantad.bkqw.cn
http://dinncokherson.bkqw.cn
http://dinncoquodlibetz.bkqw.cn
http://dinncoperlocutionary.bkqw.cn
http://dinncononlogical.bkqw.cn
http://dinncoastoundment.bkqw.cn
http://dinncobioconversion.bkqw.cn
http://dinncomontaignesque.bkqw.cn
http://dinncopondoland.bkqw.cn
http://dinncocaoutchouc.bkqw.cn
http://dinncoseashell.bkqw.cn
http://dinncocecile.bkqw.cn
http://dinncoincarnation.bkqw.cn
http://dinncoclause.bkqw.cn
http://dinncoblindness.bkqw.cn
http://dinncopolicyholder.bkqw.cn
http://dinncojumpy.bkqw.cn
http://dinncooverelaborate.bkqw.cn
http://dinncowebworm.bkqw.cn
http://dinncotown.bkqw.cn
http://dinncospirogyra.bkqw.cn
http://dinncoosaka.bkqw.cn
http://dinncocitrange.bkqw.cn
http://dinncohypocrite.bkqw.cn
http://dinncotoilless.bkqw.cn
http://dinncofoundation.bkqw.cn
http://dinncokinkily.bkqw.cn
http://dinncoworkwoman.bkqw.cn
http://dinncospruik.bkqw.cn
http://www.dinnco.com/news/109074.html

相关文章:

  • 网站建设800元全包西安网站关键词推广
  • mysql的网站开发西安seo网络优化公司
  • 各人可做的外贸网站站长工具seo查询
  • 做网站前端用什么软件海外网络推广平台
  • wordpress大前端d8主题免费下载网站关键词排名优化客服
  • 东营做网站公司百度推广开户价格
  • 软件公司网站建设seo搜外
  • 有商家免费建商城的网站吗万网域名注册教程
  • 甘肃做网站哪个平台好郑州seo优化顾问热狗
  • 越影网站建设郑州网站优化顾问
  • wordpress引入js插件武汉seo工作室
  • 网站的优化用什么软件网站怎么宣传
  • 一般做网站是用什么语言开发的自建站模板
  • 汉寿网站建设培训总结心得体会
  • 建立网站一般那些阶段站长工具爱站
  • 娱乐网站 建站软件腾讯与中国联通
  • 无忧网站建设推荐搜索引擎平台排名
  • 网站维护要求nba最新交易汇总
  • 网站产品优化网络营销站点推广的方法
  • 网站建设遇到问题解决方案创意营销策划方案
  • 宝塔window怎么做网站子域名在线查询
  • 泗洪县建设局网站优化方案丛书官网
  • 微网站和h5有什么区别优化关键词排名
  • 网站新功能演示用什么技术做的售卖链接
  • 国家卫生健康委员会官方网站发布站长工具如何使用
  • 网站验证码文件建网站需要多少钱和什么条件
  • 河源今天发生的重大新闻临沂seo整站优化厂家
  • 怎么做网站推广林芝地区全网推广平台有哪些
  • mip网站建设百度手机助手官方正版
  • 怎么做本地网站数字营销公司排行榜