Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

异地多活 #2299

Closed
standup-jb opened this issue May 31, 2019 · 7 comments
Closed

异地多活 #2299

standup-jb opened this issue May 31, 2019 · 7 comments
Labels

Comments

@standup-jb
Copy link

请问一下,是否有考虑将Apollo做到多机房部署。异地多活。当某个机房里面的全部宕机了。可以去另一个机房拉取配置。

@nobodyiam
Copy link
Member

目前我们在生产也是多机房部署的,不过数据库连的是同一个库

@standup-jb
Copy link
Author

@nobodyiam 多机房部署,数据库连接同一个库。这个库是每个机房部署一套。然后数据库层自己有多个库的同步处理吗?如果都连到一个机房的数据库,一旦这个机房挂机了。其他机房的服务也就不能正常运行了。能大概讲一下你们的部署方式吗?

@lepdou
Copy link
Contributor

lepdou commented Jun 3, 2019

@standup-jb 携程的部署方式是:主库在一个机房,从库是在另外的机房。当主库机房宕机时,mysql 可以执行主从切换。这种部署模式不能保证 100% 可靠,主要有两个原因:1. 主从切换这段时间内,mysql 不可写,所以不能推送配置。 2. mysql 主从切换有损。

Apollo 有做容灾策略:

  1. config-server 有做内存缓存,所以 config-server 不重启的情况下,热点配置应该也是能从内存缓存中读取的。
  2. client 做了本地文件缓存,如果从服务端读取不到配置时,会从本地磁盘读取

@stale
Copy link

stale bot commented Dec 3, 2019

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in 14 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 3, 2019
@stale
Copy link

stale bot commented Dec 17, 2019

This issue has been automatically closed because it has not had activity in the last 14 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Dec 17, 2019
@ghost
Copy link

ghost commented Jul 20, 2021

@standup-jb 携程的部署方式是:主库在一个机房,从库是在另外的机房。当主库机房宕机时,mysql 可以执行主从切换。这种部署模式不能保证 100% 可靠,主要有两个原因:1. 主从切换这段时间内,mysql 不可写,所以不能推送配置。 2. mysql 主从切换有损。

Apollo 有做容灾策略:

  1. config-server 有做内存缓存,所以 config-server 不重启的情况下,热点配置应该也是能从内存缓存中读取的。
  2. client 做了本地文件缓存,如果从服务端读取不到配置时,会从本地磁盘读取

你好,我们这边也在讨论类似的部署。主库在一个机房,从库在另一个机房。每个机房都有config/admin。然后有个问题,由于config会定时回写数据库,而从库的机房都处于read only的状态会报错。请问你们是如何解决这个问题的。

@nobodyiam
Copy link
Member

@ljnszu 如果两个机房延时较低的话,可以都连主库,如果延时很大(比如跨州),可以参考 #1294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants