Instalei o mssql-server e o mssql-server-ha no Ubuntu Server 16.04 LTS. Estou usando o drbd em dois nós, com o pacemaker e o corosync tentando controlar o failover automático entre os dois nós. crm status
mostra 2 erros:
Failed Actions:
* res_mssql_monitor_5000 on hostname2 'invalid parameter' (2): call=57, status=complete, exitreason='2017/11/09 12:33:01 Expected local server name to be res_mssql but it was hostname1',
last-rc-change='Thu Nov 9 12:33:01 2017', queued=0ms, exec=5241ms
* res_mssql_start_0 on hostname2 'unknown error' (1): call=6086, status=complete, exitreason='SQL Server crashed during startup.',
last-rc-change='Thu Nov 9 12:32:39 2017', queued=0ms, exec=24329ms
(nomes de host reais substituídos por "hostname1 e hostname2")
TL; DR
Se alguém configurou com êxito um marcapasso de dois nós / corosync / drbd SQL Server 2017 na configuração do Linux com um IP flutuante, estou interessado em descobrir o que estou fazendo de errado. Se você precisar de arquivos adicionais de configuração ou log, por favor me avise.
Eu não sei onde está encontrando o hostname1 real vs rs_mssql como o hostname esperado. O erro acima está no hostname2, então acho que pode ter sido quando eu copiei um arquivo de configuração de hostname1 para hostname2 durante a configuração inicial.
Minha configuração de CRM:
(Nota: eu ainda não ataquei o problema IPaddr2; eu tenho ens160 e ens192 para meus endereços IP regulares, e eu quero mais tarde configurar um alias IP como ip_mssql para o acesso IP público ao servidor SQL )
node 1: hostname1 \
attributes
node 2: hostname2 \
attributes
primitive ip_mssql IPaddr2 \
params ip=(virt IP addr) iflabel=ip_mssql \ #I think iflabel is wrong
op monitor interval=5s nic=ip_mssql \
meta target-role=Stopped
primitive res_drbd_mssql ocf:linbit:drbd \
params drbd_resource=mssql \
op start interval=0 timeout=240s \
op stop interval=0 timeout=120s
primitive res_fs_mssqlData Filesystem \
params device="/dev/drbd0" directory="/var/opt/mssql/data" fstype=xfs \
op start interval=0 timeout=60s \
op stop interval=0 timeout=120s
primitive res_fs_mssqlLog Filesystem \
params device="/dev/drbd1" directory="/var/opt/mssql/log" fstype=xfs \
op start interval=0 timeout=60s \
op stop interval=0 timeout=120s
primitive res_fs_mssqlTempDB Filesystem \
params device="/dev/drbd2" directory="/var/opt/mssql/tempDB" fstype=xfs \
op start interval=0 timeout=60s \
op stop interval=0 timeout=120s
primitive res_mssql ocf:mssql:fci \
op monitor interval=5s timeout=30s \
op start interval=0 timeout=60s \
op stop interval=0 timeout=60s
group mssqlserver res_fs_mssqlData res_fs_mssqlLog res_fs_mssqlTempDB ip_mssql
ms ms_drbd_mssql res_drbd_mssql \
meta notify=true master-max=1 master-node-max=1 clone-max=2 clone-node-max=1
colocation col_mssql_drbd inf: mssqlserver ms_drbd_mssql:Master
order ord_mssql inf: ms_drbd_mssql:promote mssqlserver:start
property cib-bootstrap-options: \
have-watchdog=false \
dc-version=1.1.14-70404b0 \
cluster-infrastructure=corosync \
cluster-name=mssqlserver \
stonith-enabled=false \
start-failure-is-fatal=false \
last-lrm-refresh=1510177588 \
startup-fencing=true \
enable-startup-probes=true \
symmetric-cluster=true \
stop-orphan-actions=true \
stonith-action=reboot \
remove-after-stop=false \
stop-all-resources=false \
stop-orphan-resources=true \
no-quorum-policy=ignore \
is-managed-default=true
Eu posso iniciar manualmente mssql-server
bem:
sudo systemctl start mssql-server
sudo systemctl status mssql-server
mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-11-09 12:49:21 CST; 1s ago
Docs: https://docs.microsoft.com/en-us/sql/linux
Main PID: 3368 (sqlservr)
Tasks: 62
Memory: 171.0M
CPU: 1.770s
CGroup: /system.slice/mssql-server.service
3368 /opt/mssql/bin/sqlservr
3371 /opt/mssql/bin/sqlservr
Nov 09 12:49:21 hostname2 systemd[1]: Started Microsoft SQL Server Database Engine.
Estes são os únicos erros reais que encontrei em /var/opt/mssql/log/errorlog
:
2017-11-09 12:49:28.17 spid4s Service Master Key could not be decrypted using one of its encryptions. See sys.key_encryptions for details.
2017-11-09 12:49:28.17 spid4s An error occurred during Service Master Key initialization. SQLErrorCode=33095, State=8, LastOsError=0.
2017-11-09 12:49:31.14 spid22s The Service Broker endpoint is in disabled or stopped state.
2017-11-09 12:49:31.14 spid22s The Database Mirroring endpoint is in disabled or stopped state.
2017-11-09 12:49:31.17 spid22s Service Broker manager has started.
2017-11-09 12:49:31.37 spid4s Recovery is complete. This is an informational message only. No user action is required.
O failover manual de drbd funciona em umount /dev/drbd0 /dev/drbd1 /dev/drbd2
e drbdadm secondary mssql
e, em seguida, inverte esse processo no novo primário ( drbdadm primary mssql
e mount ...).
Meu /etc/drbd.d/mssql.res conf (/etc/drbd.d/global_common.conf está inalterado dos repositórios):
resource mssql {
handlers {
split-brain "/usr/lib/drbd/notify-split-brain.sh root";
}
net {
after-sb-0pri discard-least-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
}
volume 0 {
device minor 0;
disk /dev/VG-SqlData/LV-SqlData;
meta-disk internal;
}
volume 1 {
device minor 1;
disk /dev/VG-SqlLogs/LV-SqlLogs;
meta-disk internal;
}
volume 2 {
device minor 2;
disk /dev/VG-TempDB/LV-TempDB;
meta-disk internal;
}
syncer {
rate 35M;
verify-alg md5;
}
on hostname1 {
address <ip addr1>:7788;
}
on hostname2 {
address <ip addr2>:7788;
}
}