简体   繁体   English

关于 Azure 中的异地复制

[英]Regarding Geo-Replication in Azure

I've configured an active Geo replication for Azure SQL DB.我已经为 Azure SQL DB 配置了一个活动的地理复制。 I have primary and secondary database without failover policy.我有没有故障转移策略的主数据库和辅助数据库。 Also, I have an App Service which fetches data by using primary database connection string.另外,我有一个应用服务,它使用主数据库连接字符串获取数据。 After doing forced failover, reads are working fine most of time but my inserts/updates were failed.进行强制故障转移后,大部分时间读取工作正常,但我的插入/更新失败。

My question is do I need to update my connection string(pointing to secondary database which has become primary database now due to failover) in the App Service to make insert/update work or is there any other way to make my application work without changing connection string in my app service?我的问题是我是否需要在应用服务中更新我的连接字符串(指向由于故障转移而成为主数据库的辅助数据库)以使插入/更新工作,或者是否有任何其他方法可以使我的应用程序工作而不更改连接我的应用服务中的字符串?

Thanks In Advance!!!提前致谢!!!

PS - I am new to Azure. PS - 我是 Azure 的新手。

There are two types of authentication level:有两种类型的身份验证级别:

  1. server level服务器级别
  2. database level数据库级别

When you are using SQL admin server user(server-level authentication) then you must update connection string manually in the application.当您使用 SQL 管理服务器用户(服务器级身份验证)时,您必须在应用程序中手动更新连接字符串。

If you do not want to update connection string then follow this to handle this situation by creating contained DB users in the primary database, wait until the next replication takes place or manual failover, and then try, here the authentication work on database level.如果您不想更新连接字符串,请按照此通过在主数据库中创建包含的数据库用户来处理这种情况,等到下一次复制发生或手动故障转移,然后尝试,这里的身份验证工作在数据库级别。

For more information: https://docs.microsoft.com/en-us/sql/relational-databases/security/contained-database-users-making-your-database-portable?view=sql-server-2017有关详细信息: https://docs.microsoft.com/en-us/sql/relational-databases/security/contained-database-users-making-your-database-portable?view=sql-server-2017

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM