Skip to content

Commit 4bf80b4

Browse files
committed
added add node & remove node
1 parent ef4e363 commit 4bf80b4

2 files changed

Lines changed: 119 additions & 3 deletions

File tree

docs/linux/sql-server-linux-configure-shared-disk-cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ To configure shared storage, you need to create a network share and mount it to
167167
# id mssql
168168
```
169169
170-
Update the following line and append it to `/etc/fstab` to instruct the operating system where and how to mount the file for SQL Server:
170+
1. Configure the operating system to mount the shared file. In the following line, update `//<storage server>/<share>` with the name of the file server and the shared disk. Update `<file>` with the name of the credential file. Update `<mssql uid>` with the SQL Server User ID, and `<gid>` with the Group ID. Update the following line and append it to `/etc/fstab` to instruct the operating system where and how to mount the file for SQL Server:
171171
172172
```bash
173173
//<storage server>/<share> /var/opt/mssql/data cifs credentials=<file>, uid=<mssql uid>, gid=<mssql gid> 0 0

docs/linux/sql-server-linux-operate-shared-disk-cluster.md

Lines changed: 118 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,125 @@ View the resource agent logs at `/var/log/cluster/corosync.log`
8585
8686
The file should be the same on every node.
8787
88-
1. Stop the SQL Server service.
88+
1. Stop the SQL Server service on the new node.
8989
90-
1. Install `cifs-utils` on both nodes.
90+
1. Install `cifs-utils` on the new node.
91+
92+
1. Create a file that contains credentials for mounting the share. The file needs to identify the username, password and domain as follows:
93+
94+
```bash
95+
username=<username>
96+
password=<password>
97+
domain=<domain>
98+
```
99+
100+
For example, the credential file may contain the following values:
101+
102+
```bash
103+
username=sqlfci
104+
password=KD(YE8e937!0008x
105+
domain=CORP
106+
```
107+
6. Get the SQL Server user ID (uid), and group ID (gid). To get the SQL Server uid and gid, run the following command **from the primary node**.
108+
109+
```bash
110+
# id mssql
111+
```
112+
113+
1. On the new node, configure the operating system to mount the shared file. In the following line, update `//<storage server>/<share>` with the name of the file server and the shared disk. Update `<file>` with the name of the credential file. Update `<mssql uid>` with the SQL Server User ID, and `<gid>` with the Group ID. Update the following line and append it to `/etc/fstab` to instruct the operating system where and how to mount the file for SQL Server:
114+
115+
```bash
116+
//<storage server>/<share> /var/opt/mssql/data cifs credentials=<file>, uid=<mssql uid>, gid=<mssql gid> 0 0
117+
```
91118
119+
For example, the following line adds the `\\StorageServer\SQL` share to the `/var/opt/mssql/data` with credentials for Linux cluster file with the SQL Server UID and gid.
120+
121+
```bash
122+
//machine/share /var/opt/mssql/data cifs credentials=/.cifscredfile,uid=995,gid=996 0 0
123+
```
124+
125+
If the `/etc/fstab` file was edited correctly, the share is mounted to`/var/opt/mssql/data` and will be automatically re-mounted when the node restarts.
126+
127+
1. On the new node, create a file to store the SQL Server username and password for the Pacemaker login. The following command creates and populates this file:
128+
129+
```bash
130+
# touch /var/opt/mssql/passwd
131+
# echo "<loginName>" >> /var/opt/mssql/secrets/passwd
132+
# echo "<loginPassword>" >> /var/opt/mssql/secrets/passwd
133+
# chown root:root /var/opt/mssql/passwd
134+
# chmod 600 /var/opt/mssql/passwd
135+
```
136+
137+
3. On the new node, open the Pacemaker firewall ports. To open these ports with `firewalld`, run the following command:
138+
139+
```bash
140+
# firewall-cmd --permanent --add-service=high-availability
141+
# firewall-cmd --reload
142+
```
143+
144+
> [AZURE.NOTE]If you’re using another firewall that doesn’t have a built-in high-availability configuration, the following ports need to be opened for Pacemaker to be able to communicate with other nodes in the cluster
145+
>
146+
> * TCP: Ports 2224, 3121, 21064
147+
> * UDP: Port 5405
148+
149+
1. Install Pacemaker packages on the new node.
150+
151+
```bash
152+
# yum install pacemaker pcs fence-agents-all resource-agents
153+
```
154+
155+
2. Set the password for for the default user that is created when installing Pacemaker and Corosync packages. Use the same password as the existing nodes.
156+
157+
```bash
158+
# passwd hacluster
159+
```
160+
161+
3. Enable and start `pcsd` service and Pacemaker. This will allow the new node to rejoin the cluster after the reboot. Run the following command on the new node.
162+
163+
```bash
164+
# systemctl enable pcsd
165+
# systemctl start pcsd
166+
# systemctl enable pacemaker
167+
```
168+
169+
4. Install the FCI resource agent for SQL Server. Run the following commands on the new node.
170+
171+
```bash
172+
# yum install mssql-server-ha
173+
```
174+
175+
1. On an existing node from the cluster, authenticate the new node and add it to the cluster:
176+
177+
```bash
178+
# pcs cluster auth <nodeName3> -u hacluster
179+
# pcs cluster node add <nodeName3>
180+
```
181+
182+
The following example ads a node named **vm3** to the cluster.
183+
184+
```bash
185+
# pcs cluster auth 
186+
# pcs cluster start
187+
```
188+
92189
## Remove nodes from a cluster
93190

191+
To remove a node from a cluster run the following command:
192+
193+
```bash
194+
# pcs cluster node remove <nodeName> 
195+
```
196+
197+
## Change the frequency of sqlservr resource monitoring interval
198+
199+
```bash
200+
# pcs resource op monitor interval=<interval>s <sqlResourceName>
201+
```
202+
203+
The following example sets the monitoring interval to 2 seconds for the mssql resource:
204+
205+
```bash
206+
# pcs resource op monitor interval=2s mssql
207+
```
208+
209+

0 commit comments

Comments
 (0)