Skip to content

Instantly share code, notes, and snippets.

@yoku0825
Created December 24, 2015 09:13
Show Gist options
  • Save yoku0825/266223106ce8873df1fe to your computer and use it in GitHub Desktop.
Save yoku0825/266223106ce8873df1fe to your computer and use it in GitHub Desktop.
  • こんなコンフィグがあるじゃろ?
# cat /tmp/setup/router.ini
[fabric_cache:dummy]
address     = 172.17.0.9
user        = dummy

[routing:master]
bind_address= 0.0.0.0:13306
mode        = read-write
destinations= fabric+cache://dummy/group/myfabric

[routing:slave]
bind_address= 0.0.0.0:23306
mode        = read-only
destinations= fabric+cache://dummy/group/myfabric
  • 13306と23306をLISTENしておるじゃろ?
# ss -ltpn
State      Recv-Q Send-Q                               Local Address:Port                                 Peer Address:Port
LISTEN     0      0                                                *:23306                                           *:*      users:(("mysqlrouter",1,6))
LISTEN     0      0                                                *:13306                                           *:*      users:(("mysqlrouter",1,5))
  • コンフィグを編集するじゃろ?
# cat /tmp/setup/router.ini
[fabric_cache:dummy]
address     = 172.17.0.9
user        = dummy

[routing:master]
bind_address= 0.0.0.0:33306
mode        = read-write
destinations= fabric+cache://dummy/group/myfabric

[routing:slave]
bind_address= 0.0.0.0:23306
mode        = read-only
destinations= fabric+cache://dummy/group/myfabric
  • これを
# ps auxww
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.2 435440  3052 ?        Ssl  18:11   0:00 /usr/sbin/mysqlrouter --extra-config=/tmp/setup/router.ini
root        30  0.0  0.2  13292  2052 ?        S    18:11   0:00 bash
root        44  0.0  0.1  21312  1380 ?        R+   18:11   0:00 ps auxww
  • こうじゃ
# kill -HUP 1

# ss -ltpn
State      Recv-Q Send-Q                               Local Address:Port                                 Peer Address:Port
LISTEN     0      0                                                *:23306                                           *:*      users:(("mysqlrouter",1,6))
LISTEN     0      0                                                *:13306                                           *:*      users:(("mysqlrouter",1,5))
  • 変わらぬ_| ̄|○
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment