mysqlfabric helpコマンドで見てもオプションがはっきりしなかったので
一応確認中ですが、set_modeにはREAD_WRITEとREAD_ONLY以外にもモードがあるようです。

Possible values are:
(0, ‘OFFLINE’), (1, ‘READ_ONLY’), (2, ‘WRITE_ONLY’), (3, ‘READ_WRITE’).

-bash-4.2$ mysqlfabric help server set_mode
server set_mode server_id mode  [--synchronous]  

Set a server's mode.

The mode determines whether a server can process read-only, read-write
or both transaction types.

WRITEにしてみる

-bash-4.2$ mysqlfabric server set_mode fbe1d550-a7f8-11e4-8f83-08002766cefe WRITE_ONLY
Fabric UUID:  5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

                                uuid finished success result
------------------------------------ -------- ------- ------
8a084578-b917-4864-a1db-68a430fb0b51        1       1      1

state success          when                                                   description
----- ------- ------------- -------------------------------------------------------------
    3       2 1422603300.19 Triggered by <mysql.fabric.events.Event object at 0x2e36bd0>.
    4       2  1422603300.2                          Executing action (_set_server_mode).
    5       2  1422603300.2                           Executed action (_set_server_mode).


-bash-4.2$ mysqlfabric group lookup_servers global
Fabric UUID:  5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

                         server_uuid         address    status       mode weight
------------------------------------ --------------- --------- ---------- ------
fbe1d550-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63301   PRIMARY WRITE_ONLY    1.0
fc69c80d-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63302 SECONDARY  READ_ONLY    1.0
fd375683-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63303 SECONDARY  READ_ONLY    1.0
fdb1d34a-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63304 SECONDARY  READ_ONLY    1.0

READ_WRITEに戻してみる

-bash-4.2$ mysqlfabric server set_mode fbe1d550-a7f8-11e4-8f83-08002766cefe READ_WRITE
Fabric UUID:  5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

                                uuid finished success result
------------------------------------ -------- ------- ------
3f778541-33da-4e95-95b3-c549e6b72a7f        1       1      1

state success          when                                                   description
----- ------- ------------- -------------------------------------------------------------
    3       2 1422603379.35 Triggered by <mysql.fabric.events.Event object at 0x2e36bd0>.
    4       2 1422603379.35                          Executing action (_set_server_mode).
    5       2 1422603379.36                           Executed action (_set_server_mode).


-bash-4.2$ mysqlfabric group lookup_servers global
Fabric UUID:  5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

                         server_uuid         address    status       mode weight
------------------------------------ --------------- --------- ---------- ------
fbe1d550-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63301   PRIMARY READ_WRITE    1.0
fc69c80d-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63302 SECONDARY  READ_ONLY    1.0
fd375683-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63303 SECONDARY  READ_ONLY    1.0
fdb1d34a-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63304 SECONDARY  READ_ONLY    1.0


-bash-4.2$

OFFLINEにしてみる
OFFLINEになったが、Connector Cacheに何処まで影響されるか次回確認してみる。

-bash-4.2$ mysqlfabric server set_mode fdb1d34a-a7f8-11e4-8f83-08002766cefe offline
Fabric UUID:  5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

                                uuid finished success result
------------------------------------ -------- ------- ------
f920e623-ad8d-43cf-aeb5-4fb22e1682be        1       1      1

state success          when                                                   description
----- ------- ------------- -------------------------------------------------------------
    3       2 1422605003.74 Triggered by <mysql.fabric.events.Event object at 0x2e36bd0>.
    4       2 1422605003.74                          Executing action (_set_server_mode).
    5       2 1422605003.75                           Executed action (_set_server_mode).


-bash-4.2$ mysqlfabric group lookup_servers global
Fabric UUID:  5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

                         server_uuid         address    status       mode weight
------------------------------------ --------------- --------- ---------- ------
fbe1d550-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63301   PRIMARY READ_WRITE    1.0
fc69c80d-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63302 SECONDARY  READ_ONLY    1.0
fd375683-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63303 SECONDARY  READ_ONLY    1.0
fdb1d34a-a7f8-11e4-8f83-08002766cefe 127.0.0.1:63304 SECONDARY    OFFLINE    1.0


-bash-4.2$ 

Comments are closed.

Post Navigation