Ubuntu上配置SQL Server Always On Availability Group(5)

USE [master] GO CREATE LOGIN [pacemakerLogin] with PASSWORD= N'<Your Password>' ALTER SERVER ROLE [sysadmin] ADD MEMBER [pacemakerLogin]

也可以不给sysadmin权限,给上如下足够的权限即可:

GRANT ALTER, CONTROL, VIEW DEFINITION ON AVAILABILITY GROUP::UbuntuAG TO pacemakerLogin

c)      在所有节点上,保存SQL Server Login的信息:

echo 'pacemakerLogin' >> ~/pacemaker-passwd echo '<Your Password>' >> ~/pacemaker-passwd sudo mv ~/pacemaker-passwd /var/opt/mssql/secrets/passwd sudo chown root:root /var/opt/mssql/secrets/passwd sudo chmod 400 /var/opt/mssql/secrets/passwd # Only readable by root

d)      在Cluster中Primary节点上创建AG的资源:

sudo pcs resource create ag_cluster ocf:mssql:ag ag_name=UbuntuAG --master meta notify=true

e)      在Cluster中Primary节点上创建虚拟IP资源:

sudo pcs resource create virtualip ocf:heartbeat:IPaddr2 ip=**<10.2.38.204>**

f)        配置Cluster资源的依赖关系和启动顺序:

sudo pcs constraint colocation add virtualip ag_cluster-master INFINITY with-rsc-role=Master sudo pcs constraint order promote ag_cluster-master then start virtualip

g)      最后查看Cluster状态如下:

sudo pcs status

Ubuntu上配置SQL Server Always On Availability Group

可以用虚拟IP(10.2.38.204)访问这个AG:

Ubuntu上配置SQL Server Always On Availability Group

至此,Ubuntu上的Cluster管理的SQL Server Always On Availability Group就搭建完成了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/b06d999f047f7bed44aeb4d3a1d082be.html