Table of Contents | ||
---|---|---|
|
Summary
DRBD operates on two channels for one resource. Each channel is established in the opposite direction to each other, and operates as P2P without distinguishing between the server and the client.
In order to relay DRBD communication, DRX also uses two channels. When DRX connection procedure is added, the number of connections increases to six.
In the local DRX, only four connections are visible except for the connection state between the remote DRX and the remote DRBD.
Structure
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
------------------------------------------------------------------------------------------- Name Type local-drbd-ip State local-drx-ip State remote-drx-ip ------------------------------------------------------------------------------------------- r0-node2-node1 data (local-drbd) -established-> (local-drx) <-bridged----- (remote-drx) r0-node2-node1 meta (local-drbd) <-established- (local-drx) -----bridged-> (remote-drx) ------------------------------------------------------------------------------------------- All connections : 2, Established : 2 |
...
When connecting to DRX, the channel type (meta / data) of each channel is undefined. When a connection with DRBD is established, channel type is received from DRBD.
Connection States
Category | States | Channel type | Description | Action |
---|---|---|---|---|
Preparing | allocating | All | Allocating memory to BAB. | Switches to 'bridging' state when memory allocation is complete. |
Connection to remote DRX | bridging | All | Attempting to connect to remote DRX. | Switches to 'bridged' state when connection is complete. |
bridged | All | Connected with remote DRX. | Switches to 'waiting' or 'connecting' state immediately. | |
Connection to local DRBD | waiting | Acceptor | Waiting for local DRBD to connect. | Switches to 'connected' state when connected with DRBD. DRBD와 연결되면 connected 상태로 전환 |
connecting | Connector | Connecting to local DRBD. | After receiving the channel type from the remote DRX, connect to local DRBD. | |
connected | Acceptor | Connected with local DRBD. | It receives the channel type from local DRBD, transfers it to the remote DRX. | |
establishing | All | Finishing connection process. | Connector: forward 'established' event to remote DRX and switches to 'established' state. | |
established | All | Connection process is complete. | Starts relaying packet data of DRBD. | |
Disconnecting | close_pending | All | Cleanup steps before closing the connection | Transmits the remaining data of the BAB and switches to 'stopping' state. |
stopping | All | Closing connection | Closes current connection and switches to 'stopped' state. | |
stopped | All | Connection closed | Prepares for reconnection and switches to 'bridging' state. |
State Changes
The state changes for each channel in normal connection is as follows.
...
- Disconnected with local DRBD
- Both channels are switchs to 'stopping' state. (data channel goes through 'close_pending' state to empty the BAB.)
- When the operation to close the connection is completed, it is switches to 'stopped' state.
- Switches to 'connection' or 'waiting' state for reconnection with local DRBD.
- Disconnected between remote DRBD and remote DRX
- As in the above situation, local DRX is also switches to 'connecting' or 'waiting' state through 'stopping' and 'stopped' state.
- Since the local DRBD can reconnect, the following operation is performed for each channel.
- Acceptor: DRBD will be connected and switches to 'establishing' state through 'connected' state.
- Connector: Since remote DRX is not connected to remote DRBD, it remains 'connected' state.
- Disconnected with remote DRX
- Both channels are switchs to 'stopping' state. (data channel goes through 'close_pending' state to empty the BAB.)
- When the operation to close the connection is completed, it is switches to 'stopped' state.
- Switches to 'bridging' state for reconnection with remote DRX.
Situation According To Connection States
Acceptor | Connector | Situation |
---|---|---|
allocating | allocating | It can be seen when the size of the TX BAB is very large or it is allocated to virtual memory and is slow. |
bridging | bridging | Remote DRX is off, or local DRX and remote DRX can not connect to each other. |
bridging | connecting | Remote DRX can not connect to local DRX. |
waiting | bridging | Can not connect to remote DRX. |
waiting | connecting | The resource in the local DRBD is not in the 'connecting' state or it can not connect to the local DRX. |
establishing | connecting | Local DRBD is connected, but remote DRX can not connect to remote DRBD. |
established | connecting | Local DRBD can connect to local DRX, but local DRX can not connect to local DRBD. |
establishing | established | Remote DRBD can connect to remote DRX, but remote DRX can not connect to remote DRBD. |
waiting | established | Local DRX can connect to local DRBD, but local DRBD can not connect to local DRX. |
established | connecting | Remote DRX can connect to remote DRBD, but remote DRBD can not connect to remote DRX. |
...