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

新网站怎么做谷歌推广呢网络宣传怎么做

新网站怎么做谷歌推广呢,网络宣传怎么做,门户网站运营,松江网站建设培训CSDN 成就一亿技术人&#xff01; 今天刚开学第一天给大家分享一期&#xff1a;MySQL集群双主的配置需求和命令 CSDN 成就一亿技术人&#xff01; 神秘泣男子主页&#xff1a;作者首页 <———— MySQL专栏 &#xff1a;MySQL数据库专栏<———— MySQL双主是一…

CSDN 成就一亿技术人!

今天刚开学第一天给大家分享一期:MySQL集群双主的配置需求和命令

CSDN 成就一亿技术人!

神秘泣男子主页:作者首页    <————

MySQL专栏      :MySQL数据库专栏<————

MySQL双主是一种高可用性和容错性的数据库架构,有两个主数据库(Master)。这种架构允许在其中一个主数据库出现故障时,系统仍然能够正常运行,并且在故障恢复后能够继续正常工作。

工作原理:

  • 两台 MySQL 实例都可读写,互为主备。
  • 默认情况下,只有一台主节点(称为主写节点)负责数据的写入,另一台主节点(称为备写节点)处于备用状态。
  • 主写节点将变更记录(binlog)发送给备写节点,备写节点应用变更记录,保证数据一致性。
  • 当主写节点发生故障时,备写节点可以被提升为主写节点,继续提供服务。

优点:

  • 提高读写性能: 两台主节点可以同时处理读写请求,从而提高数据库的整体性能。
  • 增强高可用性: 如果一台主节点发生故障,另一台主节点可以继续提供服务,从而保证数据库的高可用性。

缺点:

  • 数据一致性风险: 双主架构需要保证两台主节点的数据一致性,这可能会带来一些风险,例如数据冲突等。
  • 配置和管理复杂度: 双主架构的配置和管理比单主架构复杂,需要 DBA 具备一定的专业知识。

应用场景:

  • 对读写性能要求较高的应用
  • 对高可用性要求较高的应用

常见实现方式:

  • 双向复制: 两台主节点之间通过 binlog 进行双向复制,保证数据一致性。
  • 仲裁器: 引入一个仲裁器协调两台主节点之间的写入操作,保证数据一致性。

双主配置命令

1.master1配置

1.修改配置文件

配置完成后重启

vim /etc/my.cnflog_bin
server-id=1
gtid_mode=on
enforce_gtid_consistency=on
binlog_format=rowlog_bin:
此配置项启用二进制日志,它是 MySQL 复制所必需的。
server-id:
此配置项用于为 MySQL 服务器分配唯一的标识符。在复制设置中,每个服务器都应该有一个唯一的 server-id。在您的配置中,服务器的ID被设置为1。确保每个服务器都有一个唯一的ID。
gtid_mode:
此配置项启用 GTID 模式。GTID 是用于在不同 MySQL 实例之间唯一标识事务的机制。启用 GTID 有助于简化复制配置和处理。
enforce_gtid_consistency:
此配置项强制执行 GTID 一致性。这确保在执行复制时事务的一致性。
binlog_format=row:
此配置项指定二进制日志的格式。在您的配置中,设置为row,表示以行为基础记录二进制日志。这是推荐的设置,因为它提供更好的灵活性和一致性。
2.创建授权用户
grant replication slave on *.* to 'rep'@'192.168.180.%' identified by 'Sunshao-123';rep是用户名称
@后边跟上服务器网段


2.master2配置

1.修改配置文件

配置完成后重启

log_bin
server-id=2
#GTID:
gtid_mode=on #开启gtid模式
enforce_gtid_consistency=on
binlog_format=row

1.检测创建账户是否可用
mysql -h 目标服务器 -u创建用户 -p'密码'

master2 访问 master1

2.设置主服务器
4.***设置主服务器**    指向master1
mysql> change master to-> master_host='另外一个主服务器的IP',-> master_user='rep',-> master_password='Sunshao-123',-> master_auto_position=1;
Query OK, 0 rows affected, 2 warnings (0.01 sec)

mysql> start slave;        开启复制
Query OK, 0 rows affected (0.00 sec)

3.查看线程状态
mysql> show slave status \G;
************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.180.180Master_User: repMaster_Port: 3306Connect_Retry: 60Master_Log_File: master1-bin.000002Read_Master_Log_Pos: 1720Relay_Log_File: master2-relay-bin.000004Relay_Log_Pos: 966Relay_Master_Log_File: master1-bin.000002Slave_IO_Running: YesSlave_SQL_Running: YesReplicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0Last_Error: Skip_Counter: 0Exec_Master_Log_Pos: 1720Relay_Log_Space: 2452Until_Condition: NoneUntil_Log_File: Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_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: NoLast_IO_Errno: 0Last_IO_Error: Last_SQL_Errno: 0Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1Master_UUID: 0a562cb8-bf46-11ee-b233-000c2950269eMaster_Info_File: /var/lib/mysql/master.infoSQL_Delay: 0SQL_Remaining_Delay: NULLSlave_SQL_Running_State: Slave has read all relay log; waiting for more updatesMaster_Retry_Count: 86400Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: 0a562cb8-bf46-11ee-b233-000c2950269e:1-9Executed_Gtid_Set: 0a562cb8-bf46-11ee-b233-000c2950269e:1-9,
235616ef-b8fc-11ee-86c1-000c2952be42:1-2Auto_Position: 1Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 
1 row in set (0.00 sec)

都为yes表示成功

接下来返回master1继续配置

.***设置主服务器**    指向master2
mysql> change master to-> master_host='另外一个主服务器的IP',-> master_user='rep',-> master_password='Sunshao-123',-> master_auto_position=1;
Query OK, 0 rows affected, 2 warnings (0.01 sec)
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)mysql> show slave status \G;
*************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.180.181Master_User: repMaster_Port: 3306Connect_Retry: 60Master_Log_File: master2-bin.000002Read_Master_Log_Pos: 194Relay_Log_File: master1-relay-bin.000003Relay_Log_Pos: 411Relay_Master_Log_File: master2-bin.000002Slave_IO_Running: YesSlave_SQL_Running: YesReplicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0Last_Error: Skip_Counter: 0Exec_Master_Log_Pos: 194Relay_Log_Space: 1233Until_Condition: NoneUntil_Log_File: Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_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: NoLast_IO_Errno: 0Last_IO_Error: Last_SQL_Errno: 0Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 2Master_UUID: 235616ef-b8fc-11ee-86c1-000c2952be42Master_Info_File: /var/lib/mysql/master.infoSQL_Delay: 0SQL_Remaining_Delay: NULLSlave_SQL_Running_State: Slave has read all relay log; waiting for more updatesMaster_Retry_Count: 86400Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: 235616ef-b8fc-11ee-86c1-000c2952be42:1-2Executed_Gtid_Set: 0a562cb8-bf46-11ee-b233-000c2950269e:1-10,
235616ef-b8fc-11ee-86c1-000c2952be42:1-2Auto_Position: 1Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 
1 row in set (0.00 sec)

测试

master1

master2同步master1

master1上
mysql> insert into t1 values(666666);
Query OK, 1 row affected (0.01 sec)mysql> select * from test.t1;
+--------+
| id     |
+--------+
|     11 |
|     22 |
|     22 |
|     22 |
| 666666 |
+--------+
5 rows in set (0.00 sec)mysql> master2上
mysql> select * from test.t1;
+--------+
| id     |
+--------+
|     11 |
|     22 |
|     22 |
|     22 |
| 666666 |
+--------+
5 rows in set (0.01 sec)

master2

master1同步master2

master2上
mysql> insert into test.t1 values(77777);
Query OK, 1 row affected (0.01 sec)mysql> select * from test.t1;
+--------+
| id     |
+--------+
|     11 |
|     22 |
|     22 |
|     22 |
| 666666 |
|  77777 |
+--------+
6 rows in set (0.00 sec)mysql> master1上
mysql> select * from test.t1;
+--------+
| id     |
+--------+
|     11 |
|     22 |
|     22 |
|     22 |
| 666666 |
|  77777 |
+--------+
6 rows in set (0.00 sec)
http://www.dinnco.com/news/44018.html

相关文章:

  • 制作网站源码帮我搜一下长沙做网络销售
  • wordpress提示插件安装插件郑州seo网站排名
  • 群晖搭建企业网站排名点击软件怎样
  • 公司网站建设浩森宇特现在如何进行网上推广
  • 专业营销的网站建设公司排名电商软文范例
  • 网站推广淘宝联盟怎么做广州网站优化费用
  • tp框架做的图片网站《新闻联播》今天
  • 做网站的前期准备百度搜索智能精选入口
  • 企业做网站注意事项全网营销整合推广
  • 做资料分享网站电商推广平台有哪些
  • 做微网站公司中国万网官网
  • 沧州网站建设icp备seo在线诊断工具
  • php网站开发工程师笔试google下载安装
  • 中文设置wordpress上海优化seo公司
  • django做企业级网站网络营销是什么课程
  • 西南交通建设集团有限公司网站一元手游平台app
  • 网站开发产品规划要求百度安装应用
  • 潍坊青州网站建设百度app广告
  • 桂林东西巷美食网络舆情优化公司
  • 美国主机网站建设房地产最新消息
  • 广州做响应式网站网站域名查询官网
  • 常州网站关键词优化软件网推公司干什么的
  • wordpress file uploadseo排名专业公司
  • 校园网站建设目的当日网站收录查询统计
  • 楼盘动态晨阳seo顾问
  • 企业网站公众号网络营销案例分析
  • 注册完域名之后怎么找到网站如何宣传自己的网站
  • 闵行交大网站建设逆冬seo
  • 工业产品设计图关于进一步优化 广州
  • 视频网站 如何做seo成年学校培训班