Interface Guide

  • Describes the DRX's CLI commands and explains the application considerations from a programming perspective.


Summary

The DRX CLI is divided into status inquiries and control / notification commands for the replicated resources and provides the same interface regardless of platform through the drx-ctl utility.

  • The query command prints a generic summary of the resource and prints verbose information if the -v option is included on the command line.
  • The control command is a command that can dynamically initiate and stop DRX on a resource basis.
  • The Notify command is a command that outputs the real-time status change situation occurring in DRX in resource units. It provides a function to perform once and receive events that occur until termination and output the result to the console.


CLI 

The DRX's CLI is divided into views, controls, and notifications.

The command format of the CLI is drx-ctl {option} [command] [command argument ...]. The output type is determined by "command" and "command argument", and "option" for selecting the detail mode (-v) can be omitted. "Command argument" can use the connection name and "resource".

The output format of the CLI depends on the "command" and you can use "command arguments" to specify the desired output items.

CLI List


CategorizeItemOptionCommandAliasEtc.
queryDRX versionN/Adrx-ctl versionverdrx version
DRX info"drx-ctl info-start or stop status of the DRX process
license"drx-ctl licenseliclicense info
resource configuration"drx-ctl dump [res|all]-
  • resource configuration, drx.conf
  • Since resource configuration file is processed by drbdadm, enter resource.
information during up"drx-ctl show [res|conn|all]-Configuration information during up.
connection-v

drx-ctl connection [res|conn|all]

co
  • connection information
  • verbose mode (-v): IP, Up Since, Remove arrow
statistics-vdrx-ctl statistics [res|conn|all]st
  • Statistical information
  • verbose mode (-v): Tx/Rx packet, compress/crypto Cur, Min, Max
BAB -vdrx-ctl memusage [res|conn|all] mem
  • BAB information
  • verbose mode (-v) : Begin, End, BAB Latency
logN/Adrx-ctl log  [connect name or main] -
  • Output the currently logged log file
  • Rolled log files are not output.
control

resource up"drx-ctl up [res|conn|all]-up resource 
resource down"drx-ctl down [res|conn|all]-down resource
resource adjust"drx-ctl adjust [res|conn|all] -update resources
compress"drx-ctl set compress [type] [level] [res|conn|all] -Resource Compression Settings
crypto"drx-ctl set crypto [on or off] [res|conn|all] -Resource Encryption Settings
bwlimit"drx-ctl set bwlimit [limit] [res|conn|all] -
  • unit : Bytes Per Second (K, M, G available)
  • limit : Bandwidth of input resource

"drx-ctl set license [file-path]-
  • file-path : License file path.
  • Validate the license on the specified path and replace it.
  • When replacing with a valid license, the terminated DRX is retained.
reset statistics"drx-ctl reset statistics [res|conn|all] st
  • Option alias : statistics is only st.
notificationevent notificationNAdrx-ctl events {conn|all}-event notification


Notification List


EventItemType타깃DATA설명
CommonActionstartcommon[start] Start Event Notification
stopcommon[stop] Stop Event Notification
shutdown[success or fail]Termination by command
Setsetlicense[temporary, permanent, invalid] Set specific license
loglevel[none, trace, debug, info, warning, critical] log level (file, console)
Individualconnectup[connect name ][success or fail] connection activation result
down[connect name ][success or fail] connection deletion result
[drx or drbd]_accept[connect name ][IP:Port] accept result
[accept or connector]_state[connect name ]

[stopped/stopping, waiting, bridging/bridged, 

connecting/connected, establishing/established] 

  • Connection Status and Results
  • add the state subject and connect name
Setset[connect name ]compressor [none, zlib, lz4] [level] compression settings
[connect name ]crypto [none, openssl] encryption settings
[connect name ]bwlimit [size] bandwidth of resource
reset[connect name ][success or fail] reset statistics
statuspacket[connect name ][receive_fail] [origin size] [receive size] 

notification of failure only

compress[connect name ][compress or decompress]_fail [origin size] [receive size] [return value]

notification of failure only

crypto[connect name ][encrypto or decrypto]_fail [origin size] [receive size] [return value]

notification of failure only

Considerations

  • DRX's control commands are performed asynchronously. That is, the point at which the CLI control command is executed and returned is not the final completion of the state control. Therefore, after executing the control command, it is necessary to check whether the status has changed normally through the inquiry command.
    • To determine if the state change has been completed, you must check the DRX events in real time after running the event notification command.
  • The drx-ctl command performs only one command at a time by default on the receiving drx server, which can cause a timeout for some queued commands if multiple commands are delivered simultaneously by DRX. To avoid timeouts, you need to ensure that the drx-ctl command is executed sequentially.
    • The return value of drx-ctl is as follows. 

      CommandReturn valueDescription
      WindowsLinux
      drx-ctl 

      00success
      -1255failure
      -2254timeout
      -3253DRX not running (not working)
      128128Invalid argument

      In Linux, the return value is limited to 0-255, so negative values are represented by adding 256.

Operation 

DRX configures the resource information into a file and controls each resource with the drx-ctl command.

The following are typical examples of configuring and starting replication resources.

  1. configures the resource
  2. start DRX service.
  3. Reset the BAB size incorrectly.
    1. Performs a "down" operation on resource r0.
    2. Change BAB size of resource r0 to 700M
    3. Performs a "up" operation on resource r0.
  4. Apply LZ4 compression algorithm to active resources
    1. Enter "drx-ctl set compress lz4 1 r0" command
    2. Use "drx-ctl mem r0" command to check BAB usage rate of resource r0
    3. To permanently apply compression settings, add settings to the resource file.



CLI output format


Query command

  • drx-ctl version
    • Option alias : ver
    • Print version information of DRX.
    • Setting example
      version
      < test version >
      [root@c69-r1 dgkim]# drx-ctl ver
      drx     : Test version: Nov 29 2018, 16:13:46
      
      [root@c69-r1 dgkim]#
      
      < Release version >
      [root@c69-r1 dgkim]# drx-ctl ver
      drx     : 1.2(2018-11-29_16-52-41_TEST1) GIT-hash: b62c996 Nov 29 2018, 16:55:04
      
      [root@c69-r1 dgkim]#
      
  • drx-ctl license
    • Option alias : lic
    • Outputs license information. 
    • Setting example
      license
      [root@c73-p1 drbd.d]# drx-ctl lic
      Product type : DRX
      License status : Temporary, Expire date: 30-nov-2018, Validity day: 9
      
      [root@c73-p1 drbd.d]#
  • drx-ctl dump [res|all]
    • Outputs the settings of the resource and drx.conf. 
    • Enter resource because the drbdadm utility processes the resource configuration file.
    • The contents of drx.conf are output in "<DRX configuration>" and output in ini format (name = value).

    • Setting example
      dump
      [root@c73-p1 drbd.d]# drx-ctl dump all
      # /etc/drbd.conf
      global {
          usage-count yes;
      }
      
      common {
      }
      
      # resource r0 on c73-p1: ignored, not stacked
      # defined at /etc/drbd.d/r0.res:1
      resource r0 {
          device               /dev/drbd0 minor 0;
          disk                 /dev/sdd1;
          meta-disk        /dev/sdb1;
          on c74-1 {
              node-id 1;
          }
          on c74-3 {
              node-id 3;
          }
          connection DR-1-3 {
              host c74-1         address         ipv4 31.1.1.164:6677         via proxy on c73-p1 {
                  inside           ipv4 31.1.1.191:6678;
                  outside          ipv4 31.1.1.191:6679;
              }
              host c74-3         address         ipv4 31.1.1.166:6677         via proxy on c73-p2 {
                  inside           ipv4 31.1.1.192:6678;
                  outside          ipv4 31.1.1.192:6679;
              }
          }
          net {
              protocol           A;
              on-congestion    pull-ahead;
              sndbuf-size      10M;
              congestion-fill  480M;
          }
          proxy {
              memlimit         500M;
          }
      }
      
      # resource r0-1 on c73-p1: ignored, not stacked
      # defined at /etc/drbd.d/r0.res:36
      resource r0-1 {
          device               /dev/drbd1 minor 1;
          disk                 /dev/sdd2;
          meta-disk        /dev/sdb2;
          on c74-2 {
              node-id 2;
          }
          on c74-3 {
              node-id 3;
          }
          connection DR-2-3 {
              host c74-2         address         ipv4 31.1.1.165:6680         via proxy on c73-p1 {
                  inside           ipv4 31.1.1.191:6681;
                  outside          ipv4 31.1.1.191:6682;
              }
              host c74-3         address         ipv4 31.1.1.166:6680         via proxy on c73-p2 {
                  inside           ipv4 31.1.1.192:6681;
                  outside          ipv4 31.1.1.192:6682;
              }
          }
          net {
              protocol           A;
              on-congestion    pull-ahead;
              sndbuf-size      10M;
              congestion-fill  480M;
          }
          proxy {
              memlimit         500M;
          }
      }
      
      
      <DRX configuration>
      lang=korean
      proxy-type=1
      loglevel-file=debug
      
      [root@c73-p1 drbd.d]#
  • drx-ctl show [res|conn|all]
    • Outputs the settings that are in use by the process. 
    • Global setting items are output in "<DRX configuration>" and output as ini format (name = value).
    • Node configuration items are output in tabular format for readability.

    • Setting example
      show
      [root@c73-p1 dgkim]# drx-ctl show all
      -----------------------------------------------------------------------
      Name                 bwlimit min-raw-block-size compress level crypto  
      -----------------------------------------------------------------------
      DR-1-3-c73-p2-c73-p1 0       0                  NONE     9     OPENSSL 
      -----------------------------------------------------------------------
      DR-2-3-c73-p2-c73-p1 0       0                  LZ4      1     NONE    
      -----------------------------------------------------------------------
      <DRX configuration>
      language=korean
      base-dir=not set
      drbd-conf=not set
      connect-timeout=10
      loglevel-file=debug
      loglevel-stdout=info
      logfile-max-size=10.00 MB
      logfile-max-count=10
      performance-log-enable=disable
      ip-verification=on
      process-thread-count=auto
      
      [root@c73-p1 dgkim]#
  • drx-ctl connections [res|conn|all]
    • Option alias : co
    • verbose option : -v 
    • Outputs connection information for a resource.
      • normal mode : Omit IP Address, connect arrow output

      • verbose mode : Output IP address, omit connection arrow
    • Setting example
      connections
      < normal mode >
      [root@74-p1 ~]# drx-ctl co all
      -------------------------------------------------------------------------------------------------
      Name                 Type local-drbd-ip State          local-drx-ip State          remote-drx-ip
      -------------------------------------------------------------------------------------------------
      r0-74-p2-74-p1 meta (local-drbd)  -established-> (local-drx)  <-bridged----- (remote-drx)
      r0-74-p2-74-p1 data (local-drbd)  <-established- (local-drx)  -----bridged-> (remote-drx)
      -------------------------------------------------------------------------------------------------
       All connections : 2, Established : 2
      [root@74-p1 ~]#
      
      < verbose mode >
      [root@74-p1 ~]# drx-ctl co all -v
      ----------------------------------------------------------------------------------------------------------------------------------
      Name                 Type local-drbd-ip   State       local-drx-ip                    State   remote-drx-ip   Up since
      ----------------------------------------------------------------------------------------------------------------------------------
      r0-74-p2-74-p1 meta 31.1.1.121:8800 established 31.1.1.138:8801/31.1.1.138:8802 bridged 31.1.1.139:8802 -
      r0-74-p2-74-p1 data 31.1.1.121:8800 established 31.1.1.138:8801/31.1.1.138:8802 bridged 31.1.1.139:8802 2018-11-23 18:07:49
      ----------------------------------------------------------------------------------------------------------------------------------
       All connections : 2, Established : 2
      [root@74-p1 ~]#
  • drx-ctl statistics [res|conn|all]
    • Option alias : st
    • normal mode : Outputs the average latency of TX speed/RX speed/Compress/Unlock/Encrypt. 
    • verbose mode : Outputs the current value, maximum value, and minimum value for RAW data/Compression/Decompression/Encryption of RX/TX. 
    • Filter output mode: Outputs the desired column.
    • The output unit(B, KB, MB, GB) is fixed to KiloBytes and is omitted. Values ​​less than KiloBytes are output as zero.
    • options
      • verbose option : v 
      • fileter option : --filter 
    • Abbreviation explanation
      AbbreviationDescriptionAbbreviationDescriptionAbbreviationDescription
      txTX speedratiocompress average ratioecencrypto
      rxRX speedcurcompress current ratio dcdecrypto
      t-netTX-Network 전송 사이즈worstcompress worst ratio

      t-rawTX RAW 사이즈bestcompress best ratio

      r-rawRX-Network 전송 사이즈cpcompress

      r-netRX RAW 사이즈dedecompress

    • Setting example
      statistics
      < normal mode > 
      C:\Users\Administrator>drx-ctl st all
      ---------------------------------------------------------------
      name              type tx rx ratio cp-avg ec-avg dc-avg de-avg
      ---------------------------------------------------------------
      w1-w2-w16-2-w16-1 meta 0  0
      w1-w2-w16-2-w16-1 data 0  0  0.00  0      0      0      0
      ---------------------------------------------------------------
       All connections : 2, Established : 2
      
      C:\Users\Administrator>
      
      < verbose mode >
      C:\Users\Administrator>drx-ctl st all -v
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name              type tx rx t-raw t-net r-raw r-net ratio cur  best worst cp-avg cp-cur cp-min cp-max ec-avg ec-cur ec-min ec-max dc-avg dc-cur dc-min dc-max de-avg de-cur de-min de-max
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      w1-w2-w16-2-w16-1 meta 0  0
      w1-w2-w16-2-w16-1 data 90 0  63118 63135 0     0     0.00  0.00 0.00 0.00  0      0      0      0      0      0      0      0      0      0      0      0      0      0      0      0
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       All connections : 2, Established : 2
      
      C:\Users\Administrator>
      
      < filter mode >
      C:\Users\Administrator>drx-ctl st all -v --filter=name,tx,rx,cp-avg,cp-cur,cp-min,cp-max
      ----------------------------------------------------
      name              tx rx cp-avg cp-cur cp-min cp-max
      ----------------------------------------------------
      w1-w2-w16-2-w16-1 0  0
      w1-w2-w16-2-w16-1 0  0  0      0      0      0
      ----------------------------------------------------
       All connections : 2, Established : 2
      
      C:\Users\Administrator>
      
      
  • drx-ctl memusage [res|conn|all] 
    • Outputs the BAB information for the resource.
    • The output unit(B, KB, MB, GB) is fixed to KiloBytes and is omitted. Values ​​less than KiloBytes are output as zero.
    • Option alias : mem
    • verbose option 
      • option : v
      • Outputs BAB Latency (TX, RX, compression / release) information of the connected resource. 
    • Setting example

      memusage
      < normal mode >
      [root@c73-p1 dgkim]# drx-ctl mem all
      --------------------------------------------------------------------------------------
      Name                 Capacity Use (Size)                                  Full Counts 
      --------------------------------------------------------------------------------------
      DR-1-3-c73-p2-c73-p1 716800   [>>>>>>>.....................] 23% (163277) 0           
                           10240    [............................]  0% (0)      -           
      --------------------------------------------------------------------------------------
      DR-2-3-c73-p2-c73-p1 512000   [............................]  0% (0)      0           
                           10240    [............................]  0% (0)      -           
      --------------------------------------------------------------------------------------
       Active bab counts : 2
      
      <verbose mode>
      [root@c73-p1 dgkim]# drx-ctl mem all -v
      ----------------------------------------------------------------------------------------------------------
      Name                 Capacity Begin     End       Use (Size)                                  Full Counts 
      ----------------------------------------------------------------------------------------------------------
      DR-1-3-c73-p2-c73-p1 716800   340236152 504137496 [>>>>>>>.....................] 22% (160060) 0           
                           10240    0         0         [............................]  0% (0)      -           
      ----------------------------------------------------------------------------------------------------------
      DR-2-3-c73-p2-c73-p1 512000   64273922  64273922  [............................]  0% (0)      0           
                           10240    0         0         [............................]  0% (0)      -           
      ----------------------------------------------------------------------------------------------------------
       Active bab counts : 2
      ----------------------------------------------------------------------------------------------------------
      name                 Latency    cur             avg             max             min             
      ----------------------------------------------------------------------------------------------------------
      DR-1-3-c73-p2-c73-p1 TX BAB     00:00:00.000000 00:00:00.443516 00:00:06.765142 00:00:00.000101 
                           RX BAB     00:00:00.000000 00:00:00.000000 00:00:00.000000 00:00:00.000000 
                           Compress   00:00:00.000088 00:00:00.000087 00:00:00.001439 00:00:00.000001 
                           Decompress 00:00:00.000000 00:00:00.000000 00:00:00.000000 00:00:00.000000 
      ----------------------------------------------------------------------------------------------------------
      DR-2-3-c73-p2-c73-p1 TX BAB     00:00:00.000000 00:00:00.001627 00:00:00.004173 00:00:00.000261 
                           RX BAB     00:00:00.000000 00:00:00.000000 00:00:00.000000 00:00:00.000000 
                           Compress   00:00:00.000000 00:00:00.000113 00:00:00.001440 00:00:00.000001 
                           Decompress 00:00:00.000000 00:00:00.000000 00:00:00.000000 00:00:00.000000 
      ----------------------------------------------------------------------------------------------------------
       Active bab counts : 2
      [root@c73-p1 dgkim]#
      
      
  • drx-ctl log  [res|conn|all] 
    • Outputs the contents of the log being recorded. 
    • options
      • If no options are entered, only the common (main) log is output.
      • Outputs a log of all resources or input resources.
      • m : output the main log.
      • n [number] : print the last n logs.
    • Setting example

      log
      < main log >
      [root@c69-r1 ~]# drx-ctl log
      Online mode. (main)
      I1126 08:50:17.448040 t30088 main] Resource create complete (success: 2, failed: 0)
      ^C[root@c69-r1 ~]#
      
      
      < resource log >
      [root@c69-r1 ~]# drx-ctl log r0
      Online mode. (without main, r0-c69-r2-c69-r1)
      D1126 08:53:50.977215 t30109 r0-c69-r2-c69-r1:ad:o] <<=== drxp_type::ping
      ^C[root@c69-r1 ~]#
      [root@c69-r1 ~]# drx-ctl log r0_1
      Online mode. (without main, r0_1-c69-r3-c69-r1)
      D1126 08:54:08.696168 t30133 r0_1-c69-r3-c69-r1:cd:o] <<=== drxp_type::ping
      D1126 08:54:14.707857 t30129 r0_1-c69-r3-c69-r1:am:o]  ===>> send stream payload_len (16) meta
      D1126 08:54:14.708035 t30127 r0_1-c69-r3-c69-r1:am:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      D1126 08:54:14.708129 t30128 r0_1-c69-r3-c69-r1:am:o]  ===>> send stream payload_len (16) meta
      D1126 08:54:14.708208 t30127 r0_1-c69-r3-c69-r1:am:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      ^C[root@c69-r1 ~]#
      
      
      < All logs of common and resources >
      [root@c69-r1 ~]# drx-ctl log -m all
      Online mode. (main, r0-c69-r2-c69-r1, r0_1-c69-r3-c69-r1)
      D1126 08:54:24.708287 t30126 r0_1-c69-r3-c69-r1:am:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      ^C[root@c69-r1 ~]#
      [root@c69-r1 ~]#
      
      
      < prints the last 10 logs and all logs (common, resources) >
      [root@c69-r1 ~]# drx-ctl log -m -n 10 all
      Online mode. (main, r0-c69-r2-c69-r1, r0_1-c69-r3-c69-r1)
      D1126 08:54:34.708110 t30129 r0_1-c69-r3-c69-r1:am:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      D1126 08:54:34.708215 t30126 r0_1-c69-r3-c69-r1:am:o]  ===>> send stream payload_len (16) meta
      D1126 08:54:34.708425 t30127 r0_1-c69-r3-c69-r1:am:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      D1126 08:54:38.992691 t30114 r0-c69-r2-c69-r1:cm:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      D1126 08:54:38.992832 t30114 r0-c69-r2-c69-r1:cm:o]  ===>> send stream payload_len (16) meta
      D1126 08:54:40.696530 t30131 r0_1-c69-r3-c69-r1:cd:o] <<=== drxp_type::ping
      D1126 08:54:44.707844 t30127 r0_1-c69-r3-c69-r1:am:o]  ===>> send stream payload_len (16) meta
      D1126 08:54:44.708060 t30129 r0_1-c69-r3-c69-r1:am:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      D1126 08:54:44.708151 t30126 r0_1-c69-r3-c69-r1:am:o]  ===>> send stream payload_len (16) meta
      D1126 08:54:44.708223 t30129 r0_1-c69-r3-c69-r1:am:o] <<=== drxp_type::stream (crypto:NONE) (compress:NONE) [16]
      ^C[root@c69-r1 ~]#
      [root@c69-r1 ~]#

Control

  • drx-ctl up [res|conn|all]
    • the input resource is up. 
    • Setting example
      up
      < resource up >
      [root@c73-p1 dgkim]# drx-ctl up r0
      DR-1-3-c73-p2-c73-p1: up.
      Result: 1 resource(s) up.
      
      [root@c73-p1 dgkim]#
      
      < all resource up >
      [root@c73-p1 dgkim]# drx-ctl up all
      DR-1-3-c73-p2-c73-p1: up.
      DR-2-3-c73-p2-c73-p1: up.
      Result: 2 resource(s) up.
      
      [root@c73-p1 dgkim]#
      
      
  • drx-ctl down [res|conn|all]
    • the input resource is down.
    • Setting example
      down
      < resource down >
      [root@c73-p1 dgkim]# drx-ctl down r0
      DR-1-3-c73-p2-c73-p1: resource down.
      Result: 1 resource(s) down.
      
      [root@c73-p1 dgkim]#
      
      < resource down >
      [root@c73-p1 dgkim]# drx-ctl down all
      DR-1-3-c73-p2-c73-p1: resource down.
      DR-2-3-c73-p2-c73-p1: resource down.
      Result: 2 resource(s) down.
      
      [root@c73-p1 dgkim]#
       
  • drx-ctl adjust [res|conn|all] 
    • The active resource is updated, and the inactive resource is started.
    • Setting example
      adjust
      [root@c73-p1 drbd.d]# drx-ctl adjust all
      DR-1-3-c73-p2-c73-p1: up.
      DR-2-3-c73-p2-c73-p1: up.
      Result: 2 resource(s) updated.
      
      [root@c73-p1 drbd.d]#
    • The BAB size of the active resource can not be changed.
    • Error 

      adjust error
      [root@c73-p1 drbd.d]# drx-ctl adjust all 
      DR-1-3-c73-p2-c73-p1:ad: Can't change memory limit of active resource.
      DR-1-3-c73-p2-c73-p1:cm: Can't change memory limit of active resource.
      DR-1-3-c73-p2-c73-p1: updated.
      DR-2-3-c73-p2-c73-p1: updated.
      Result: 2 resource(s) updated.
      
      [root@c73-p1 drbd.d]#
  • drx-ctl set compress [type] [level] [res|conn|all] 
    • Sets the compression plug-in for the resource you enter.
    • options

      TypeMethodRangeETC
      NONE--OFF
      IQAHW1~9-
      ZLIBSW1~9-
      LZ4SW1~9-
    • Setting example

      set compress
      < lz4 compression plugin only set r0 >
      [root@c73-p1 dgkim]# drx-ctl set compress lz4 1 DR-1-3-c73-p2-c73-p1
      Result: 1 resource(s) updated.
      
      [root@c73-p1 dgkim]#
      
      <log output>
      I1126 17:31:10.271886 t77473 DR-1-3-c73-p2-c73-p1:ad] Set compressor: LZ4
      I1126 17:31:10.271918 t77473 DR-1-3-c73-p2-c73-p1:ad] Set compressor level: 1
      I1126 17:31:10.271924 t77473 DR-1-3-c73-p2-c73-p1:cm] Set compressor: LZ4
      I1126 17:31:10.271925 t77473 DR-1-3-c73-p2-c73-p1:cm] Set compressor level: 1
      
      
      < Disable r0 compression plug-in >
      [root@c73-p1 dgkim]# drx-ctl set compress none 1 DR-1-3-c73-p2-c73-p1
      DR-1-3-c73-p2-c73-p1: updated.
      Result: 1 resource(s) updated.
      
      [root@c73-p1 dgkim]#
      
      <log output>
      I1126 17:31:37.741765 t77473 DR-1-3-c73-p2-c73-p1:ad] Set compressor: NONE
      I1126 17:31:37.741795 t77473 DR-1-3-c73-p2-c73-p1:ad] Set compressor level: 1
      I1126 17:31:37.741800 t77473 DR-1-3-c73-p2-c73-p1:cm] Set compressor: NONE
      I1126 17:31:37.741802 t77473 DR-1-3-c73-p2-c73-p1:cm] Set compressor level: 1
      
      
      
      < set the lz4 compression plugin to all resources >
      [root@c73-p1 dgkim]# drx-ctl set compress lz4 1 all
      Result: 2 resource(s) updated.
      
      [root@c73-p1 dgkim]#
      
      <log output>
      I1126 17:32:30.656067 t77473 DR-1-3-c73-p2-c73-p1:ad] Set compressor: LZ4
      I1126 17:32:30.656089 t77473 DR-1-3-c73-p2-c73-p1:ad] Set compressor level: 1
      I1126 17:32:30.656095 t77473 DR-1-3-c73-p2-c73-p1:cm] Set compressor: LZ4
      I1126 17:32:30.656118 t77473 DR-2-3-c73-p2-c73-p1:am] Set compressor: LZ4
      I1126 17:32:30.656096 t77473 DR-1-3-c73-p2-c73-p1:cm] Set compressor level: 1
      I1126 17:32:30.656133 t77473 DR-2-3-c73-p2-c73-p1:am] Set compressor level: 1
      I1126 17:32:30.656138 t77473 DR-2-3-c73-p2-c73-p1:cd] Set compressor: LZ4
      I1126 17:32:30.656139 t77473 DR-2-3-c73-p2-c73-p1:cd] Set compressor level: 1
      
      
  • drx-ctl set crypto [on or off] [res|conn|all] 
    • sets the encryption plugin for the resource you enter. 
    • Setting example
      set crypto
      < enable crypto plugin r0 only > 
      [root@c73-p1 dgkim]# drx-ctl set crypto on DR-1-3-c73-p2-c73-p1
      DR-1-3-c73-p2-c73-p1: updated.
      Result: 1 resource(s) updated.
      
      [root@c73-p1 dgkim]#
      
      <log output>
      I1126 17:10:10.611963 t77473 DR-1-3-c73-p2-c73-p1:ad] Set crypto: OPENSSL
      I1126 17:10:10.611987 t77473 DR-1-3-c73-p2-c73-p1:cm] Set crypto: OPENSSL
      
      
      < enable the crypto plugin for all resources > 
      [root@c73-p1 dgkim]# drx-ctl set crypto on all
      DR-2-3-c73-p2-c73-p1: updated.
      Result: 2 resource(s) updated.
      
      [root@c73-p1 dgkim]#
      
      <log output>
      I1126 17:08:26.156687 t77473 DR-1-3-c73-p2-c73-p1:ad] Set crypto: OPENSSL
      I1126 17:08:26.156713 t77473 DR-2-3-c73-p2-c73-p1:am] Set crypto: OPENSSL
      I1126 17:08:26.156702 t77473 DR-1-3-c73-p2-c73-p1:cm] Set crypto: OPENSSL
      I1126 17:08:26.156719 t77473 DR-2-3-c73-p2-c73-p1:cd] Set crypto: OPENSSL
      
      
      < 모든 리소스의 암호화 플러그인을 비활성화 > 
      [root@c73-p1 dgkim]# drx-ctl set crypto off all
      DR-1-3-c73-p2-c73-p1: updated.
      DR-2-3-c73-p2-c73-p1: updated.
      Result: 2 resource(s) updated.
      
      [root@c73-p1 dgkim]# 
      
      <log output>
      I1206 14:12:59.701227 t81344 DR-1-3-c73-p2-c73-p1:am] Set crypto: NONE
      I1206 14:12:59.701250 t81344 DR-1-3-c73-p2-c73-p1:cd] Set crypto: NONE
      I1206 14:12:59.701305 t81344 DR-2-3-c73-p2-c73-p1:ad] Set crypto: NONE
      I1206 14:12:59.701315 t81344 DR-2-3-c73-p2-c73-p1:cm] Set crypto: NONE
      
      
  • drx-ctl set bwlimit [limit] [res|conn|all] 
    • Sets the B/W of the input resource.
    • Setting example

      set bwlimit
      < set B/W of resource r0 to 1G >
      [root@c73-p1 dgkim]# drx-ctl set bwlimit 1G DR-1-3-c73-p2-c73-p1
      DR-1-3-c73-p2-c73-p1: updated.
      Result: 1 resource(s) updated.
      
      [root@c73-p1 dgkim]#
      
      <log output>
      I1126 17:21:11.633557 t77473 DR-1-3-c73-p2-c73-p1:ad] Set bandwidth limit: 1.00 GB
      I1126 17:21:11.633573 t77473 DR-1-3-c73-p2-c73-p1:cm] Set bandwidth limit: 1.00 GB
      
      
      < set the B/W of all resources to 100M >
      [root@c73-p1 dgkim]# drx-ctl set bwlimit 100M all
      DR-1-3-c73-p2-c73-p1: updated.
      DR-2-3-c73-p2-c73-p1: updated.
      Result: 2 resource(s) updated.
      
      [root@c73-p1 dgkim]#
      
      <log output>
      I1126 17:20:55.431890 t77473 DR-1-3-c73-p2-c73-p1:ad] Set bandwidth limit: 100.00 MB
      I1126 17:20:55.431916 t77473 DR-1-3-c73-p2-c73-p1:cm] Set bandwidth limit: 100.00 MB
      I1126 17:20:55.431964 t77473 DR-2-3-c73-p2-c73-p1:am] Set bandwidth limit: 100.00 MB
      I1126 17:20:55.431984 t77473 DR-2-3-c73-p2-c73-p1:cd] Set bandwidth limit: 100.00 MB
      
      
  • drx-ctl set license [file-path]
    • After checking the license validity of the specified path, change the license information of the default path. 
    • Changing to a valid license does not change the behavior of the DRX process because the resource must remain connected.
    • Setting example
      set license
      C:\Users\Administrator>drx-ctl set license drx.lic
      License status : Temporary, Expire date: 30-nov-2018, Validity day: 4
      Result: done.
      
      
      C:\Users\Administrator>
      
      <log output>
      I1127 09:28:40.374185 t5880 main] Verify license is available
      I1127 09:28:40.374185 t5880 main:license] Checking license for [C:\Users\Administrator\drx.lic]
      I1127 09:28:40.374185 t5880 main:license] License Status: Temporary, Expire date: 30-nov-2018, Validity day: 4
      I1127 09:28:40.389865 t5880 main] License applied
  • drx-ctl reset statistics [res|conn|all] 
    • Initializes the statistic value of the resource entered.
    • Option alias : st
    • Setting example
      reset statistics
      < initialize resource r0 only >
      [root@c73-p1 dgkim]# drx-ctl reset st DR-1-3-c73-p2-c73-p1
      DR-1-3-c73-p2-c73-p1: reseted.
      Result: 1 resource(s) reseted.
      
      [root@c73-p1 dgkim]#
      
      < initialize all resources >
      [root@c73-p1 dgkim]# drx-ctl reset st all
      DR-1-3-c73-p2-c73-p1: reseted.
      DR-2-3-c73-p2-c73-p1: reseted.
      Result: 2 resource(s) reseted.
      
      [root@c73-p1 dgkim]#
      
      

Notification

The event that occurred in DRX process can be received through the client (drx-ctl).

  • drx-ctl events {conn|all}
    • options

      • empty(Do not type) : only receive public events.
      • all : receive all events.
      • connect name : output events of the input resource
    • Setting example
      events
      < only receive public events. >
      [root@c73-p1 drbd.d]# drx-ctl events 
      [system] connected
      [2018-11-27 11:22:38.933] start common
      
      
      < output events of the input resource >
      [root@c73-p1 drbd.d]# drx-ctl events DR-1-3-c73-p2-c73-p1
      [system] connected
      
      
      < receive all events >
      [root@c73-p1 drbd.d]# drx-ctl events all
      [system] connected
      [2018-11-27 10:43:12.831] start common
      
      
  • List of events. 
EventTypeDescriptionExample
Commonstartnotification started
start
[root@c73-p1 drbd.d]# drx-ctl events 
[system] connected
[2018-11-27 11:22:38.933] start common
stopend of notification
stop
[2018-11-27 11:12:39.098] stop common
shutdownexit by command
shutdown
[2018-11-27 11:12:39.076] shutdown success
set licenseLicense settings.
  • temporary, permanent, invalid
set license
[2018-11-27 13:17:58.806] set license temporary
set loglevellog level (file, console)
set loglevel
[2018-11-27 13:44:31.681] set loglevel-file trace
[2018-11-27 13:44:41.496] set loglevel-file debug
[2018-11-27 13:44:44.328] set loglevel-file info
[2018-11-27 13:44:46.088] set loglevel-file warning
[2018-11-27 13:44:47.968] set loglevel-file error
[2018-11-27 13:44:48.104] set loglevel-file critical
[2018-11-27 13:44:57.776] set loglevel-file off

Individualupactivate
up
[2018-11-27 13:50:29.151] up DR-1-3-c73-p2-c73-p1 success
downinactivate
down
[2018-11-27 13:46:37.141] down DR-1-3-c73-p2-c73-p1 success
acceptIP Accept 결과
accetp state
[2018-11-27 13:50:29.659] drx_accept DR-1-3-c73-p2-c73-p1 31.1.1.192:33476
[2018-11-27 13:50:34.298] drbd_accept DR-1-3-c73-p2-c73-p1 31.1.1.164:40557
connconnection status
conn state
[2018-11-27 14:23:39.120] acceptor_state DR-1-3-c73-p2-c73-p1 bridging
[2018-11-27 14:23:39.121] connector_state DR-1-3-c73-p2-c73-p1 bridging
[2018-11-27 14:23:39.123] connector_state DR-1-3-c73-p2-c73-p1 bridged
[2018-11-27 14:23:39.222] connector_state DR-1-3-c73-p2-c73-p1 connecting
[2018-11-27 14:23:39.328] acceptor_state DR-1-3-c73-p2-c73-p1 bridged
[2018-11-27 14:23:39.422] acceptor_state DR-1-3-c73-p2-c73-p1 waiting
[2018-11-27 14:23:43.960] acceptor_state DR-1-3-c73-p2-c73-p1 connected
[2018-11-27 14:23:43.960] acceptor_state DR-1-3-c73-p2-c73-p1 establishing
[2018-11-27 14:23:44.038] acceptor_state DR-1-3-c73-p2-c73-p1 established
[2018-11-27 14:23:44.069] connector_state DR-1-3-c73-p2-c73-p1 establishing
[2018-11-27 14:23:44.069] connector_state DR-1-3-c73-p2-c73-p1 established
setcompressor
set compress
[2018-11-27 15:27:26.895] set DR-1-3-c73-p2-c73-p1 compressor NONE
[2018-11-27 15:27:50.308] set DR-1-3-c73-p2-c73-p1 compressor LZ4 1
[2018-11-27 15:30:34.584] set DR-1-3-c73-p2-c73-p1 compressor ZLIB 1
[2018-11-27 17:48:31.204] set DR-1-3-c73-p2-c73-p1 compressor IQA 1
crypto
set crypto
[2018-11-27 17:50:32.851] set DR-1-3-c73-p2-c73-p1 crypto OPENSSL
[2018-11-27 17:50:46.264] set DR-1-3-c73-p2-c73-p1 crypto NONE
Bandwidth
set bwlimit
[2018-11-27 17:56:07.698] set DR-1-3-c73-p2-c73-p1 bwlimit 1073741824
[2018-11-27 17:58:12.380] set DR-1-3-c73-p2-c73-p1 bwlimit 104857600
resetreset statistics
reset statistics
[2018-11-27 17:58:52.962] reset DR-1-3-c73-p2-c73-p1 success
packet

transmit / receive failure

packet error
[2018-11-28 11:12:19.953] packet DR-1-3-c73-p2-c73-p1 receive_fail 15 15
compress

Prints the failure.

compress error
[2018-11-28 09:43:04.543] compress DR-1-3-c73-p2-c73-p1 compress_fail 80 1048576 0
[2018-11-28 10:28:30.629] compress DR-1-3-c73-p1-c73-p2 decompress_fail 47 1048576 0
crypto

Prints the failure.

crypto error
[2018-11-28 10:28:42.186] crypto DR-2-3-c73-p2-c73-p1 encrypto_fail 41 1048576 48
[2018-11-28 10:28:42.081] crypto DR-2-3-c73-p1-c73-p2 decrypto_fail 96 1048576 80