flare-tools 0.1.4 → 0.4.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/Flare-tools.txt +0 -0
- data/History.txt +114 -2
- data/LICENSE +21 -0
- data/Manifest.txt +65 -8
- data/README.txt +356 -0
- data/Rakefile +90 -25
- data/Tutorial.txt +370 -0
- data/bin/flare-admin +6 -0
- data/bin/flare-argv0 +6 -0
- data/bin/flare-deploy +6 -0
- data/bin/flare-keychecker +6 -0
- data/bin/flare-part +6 -0
- data/bin/flare-ping +6 -0
- data/bin/flare-stats +4 -10
- data/bin/flare-zkadmin +6 -0
- data/lib/flare/net/connection.rb +98 -0
- data/lib/flare/test/cluster.rb +140 -0
- data/lib/flare/test/daemon.rb +144 -0
- data/lib/flare/test/node.rb +62 -0
- data/lib/flare/tools.rb +18 -16
- data/lib/flare/tools/cli.rb +32 -0
- data/lib/flare/tools/cli/activate.rb +106 -0
- data/lib/flare/tools/cli/balance.rb +83 -0
- data/lib/flare/tools/cli/cli_util.rb +77 -0
- data/lib/flare/tools/cli/deploy.rb +170 -0
- data/lib/flare/tools/cli/down.rb +85 -0
- data/lib/flare/tools/cli/dump.rb +219 -0
- data/lib/flare/tools/cli/dumpkey.rb +117 -0
- data/lib/flare/tools/cli/flare_admin.rb +81 -0
- data/lib/flare/tools/cli/flare_argv0.rb +60 -0
- data/lib/flare/tools/cli/flare_keychecker.rb +106 -0
- data/lib/flare/tools/cli/flare_zkadmin.rb +226 -0
- data/lib/flare/tools/cli/index.rb +54 -0
- data/lib/flare/tools/cli/list.rb +93 -0
- data/lib/flare/tools/cli/master.rb +143 -0
- data/lib/flare/tools/cli/part.rb +100 -0
- data/lib/flare/tools/cli/ping.rb +81 -0
- data/lib/flare/tools/cli/reconstruct.rb +164 -0
- data/lib/flare/tools/cli/remove.rb +119 -0
- data/lib/flare/tools/cli/restore.rb +180 -0
- data/lib/flare/tools/cli/slave.rb +125 -0
- data/lib/flare/tools/cli/stats.rb +229 -122
- data/lib/flare/tools/cli/sub_command.rb +73 -0
- data/lib/flare/tools/cli/summary.rb +97 -0
- data/lib/flare/tools/cli/threads.rb +78 -0
- data/lib/flare/tools/cli/verify.rb +202 -0
- data/lib/flare/tools/client.rb +267 -0
- data/lib/flare/tools/cluster.rb +319 -0
- data/lib/flare/tools/common.rb +196 -0
- data/lib/flare/tools/index_server.rb +51 -0
- data/lib/flare/tools/node.rb +162 -0
- data/lib/flare/tools/stats.rb +75 -0
- data/lib/flare/tools/zk_util.rb +28 -0
- data/lib/flare/util.rb +34 -0
- data/lib/flare/util/bwlimit.rb +132 -0
- data/lib/flare/util/command_line.rb +79 -0
- data/lib/flare/util/conf.rb +71 -0
- data/lib/flare/util/constant.rb +25 -0
- data/lib/flare/util/conversion.rb +26 -0
- data/lib/flare/util/default_logger.rb +52 -0
- data/lib/flare/util/exception.rb +19 -0
- data/lib/flare/util/filesystem.rb +30 -0
- data/lib/flare/util/flared_conf.rb +33 -0
- data/lib/flare/util/flarei_conf.rb +32 -0
- data/lib/flare/util/hash_function.rb +32 -0
- data/lib/flare/util/interruption.rb +70 -0
- data/lib/flare/util/key_resolver.rb +67 -0
- data/lib/flare/util/log4r_logger.rb +79 -0
- data/lib/flare/util/logger.rb +40 -0
- data/lib/flare/util/logging.rb +84 -0
- data/lib/flare/util/result.rb +53 -0
- data/test/test/experimental/cache_test.rb +113 -0
- data/test/test/experimental/key_distribution_test.rb +38 -0
- data/test/test/experimental/keychecker_test.rb +60 -0
- data/test/test/experimental/list_test.rb +108 -0
- data/test/test/extra/replication_test.rb +184 -0
- data/test/test/integration/cli_test.rb +348 -0
- data/test/test/integration/dump_expired_test.rb +103 -0
- data/test/test/integration/dump_test.rb +128 -0
- data/test/test/integration/index_server_test.rb +35 -0
- data/test/test/integration/node_test.rb +78 -0
- data/test/test/integration/partition_test.rb +235 -0
- data/test/test/integration/proxy_test.rb +54 -0
- data/test/test/integration/stats_test.rb +79 -0
- data/test/test/system/flare_admin_test.rb +191 -0
- data/test/test/unit/bwlimit_test.rb +52 -0
- data/test/test/unit/cluster_test.rb +96 -0
- data/test/test/unit/daemon_test.rb +30 -0
- data/test/test/unit/logger_test.rb +46 -0
- data/test/test/unit/tools_test.rb +25 -0
- data/test/test/unit/util_test.rb +70 -0
- metadata +239 -84
- data/README.rdoc +0 -83
- data/bin/flare-partition-setting +0 -12
- data/lib/flare/tools/cli/partition_setting.rb +0 -86
- data/lib/flare/tools/core.rb +0 -189
- data/lib/flare/tools/logger.rb +0 -31
- data/test/test_flare-tools.rb +0 -11
- data/test/test_helper.rb +0 -3
data/.gemtest
ADDED
File without changes
|
data/Flare-tools.txt
ADDED
File without changes
|
data/History.txt
CHANGED
@@ -1,4 +1,116 @@
|
|
1
|
-
=== 0.
|
1
|
+
=== 0.4.5 / 2012-10-17
|
2
|
+
* Minor Enhancements
|
3
|
+
* Fixed install target of Makefile.
|
2
4
|
|
3
|
-
|
5
|
+
=== 0.4.4 / 2012-08-01
|
6
|
+
* Major Enhancements
|
7
|
+
* Added 'summary' subcommand
|
8
|
+
|
9
|
+
=== 0.4.3 / 2012-07-04
|
10
|
+
* Minor Enhancements
|
11
|
+
* Added --timeout option
|
12
|
+
* Fixed uptime column of 'stats' subcommand.
|
13
|
+
|
14
|
+
=== 0.4.2 / 2012-05-23
|
15
|
+
* Minor Enhancements
|
16
|
+
* Fixed option attributes for optparse.
|
17
|
+
|
18
|
+
=== 0.4.1 / 2012-05-15
|
19
|
+
* Minor Enhancements
|
20
|
+
* Added FLARE_INDEX_SERVER environment variable support.
|
21
|
+
* Added --cluster option to specify a cluster by name.
|
22
|
+
|
23
|
+
=== 0.4.0 / 2012-05-08
|
24
|
+
* Major Enhancements
|
25
|
+
* Added LICENSE file.
|
26
|
+
|
27
|
+
=== 0.3.5 / 2012-05-04
|
28
|
+
* Minor Enhancements
|
29
|
+
* Added --version option.
|
30
|
+
* Added --raw option to 'dump' subcommand.
|
31
|
+
|
32
|
+
=== 0.3.4 / 2012-04-26
|
33
|
+
* Major Enhancements
|
34
|
+
* Added 'restore' sub command.
|
35
|
+
* Fixed --bwlimit option of 'dump' subcommand.
|
36
|
+
|
37
|
+
=== 0.3.3 / 2012-04-23
|
38
|
+
* Minor Enhancements
|
39
|
+
* Suppressed vefiry error message of verify subcommand for each key.
|
40
|
+
* Added --meta option to 'verify' subcommand.
|
41
|
+
* Removed prebuilt debian package files.
|
42
|
+
|
43
|
+
=== 0.3.2 / 2012-04-16
|
44
|
+
* Major Enhancements
|
45
|
+
* Added 'verify' subcommand for checking dump results.
|
46
|
+
* Minor Enhancements
|
47
|
+
* Fixed uptime column of 'stats' subcommand.
|
48
|
+
* Fixed 'stats' subcommand not to block for down nodes.
|
49
|
+
|
50
|
+
=== 0.3.1 / 2012-02-25
|
51
|
+
* Minor Enhancements
|
52
|
+
* Fixed 'threads' subcommand not to work for flare-1.0.9 or earlier.
|
53
|
+
|
54
|
+
=== 0.3.0 / 2012-02-24
|
55
|
+
* Major Enhancements
|
56
|
+
* Incremented the version number for internal release.
|
57
|
+
* Minor Enhancements
|
58
|
+
* Fixed flare-part command to activate master nodes.
|
59
|
+
* Fixed node listing functions to sort by partition number.
|
60
|
+
* Added experimental options to flare-deploy command.
|
61
|
+
|
62
|
+
=== 0.2.7 / 2012-01-20
|
63
|
+
* Major Enhancements
|
64
|
+
* Added flare-keydump command for checking key distribution among nodes.
|
65
|
+
* Minor Enhancements
|
66
|
+
* Added bandwidth limit function to Flare::Net::Connection class.
|
67
|
+
|
68
|
+
=== 0.2.6 / 2012-01-06
|
69
|
+
* Major Enhancements
|
70
|
+
* Added 'dump' subcommand for dumping data.
|
71
|
+
* Added 'dumpkey' subcommand for dumping keys.
|
72
|
+
* Minor Enhancements
|
73
|
+
* Added experimental list operations to flare/tools/node.rb.
|
74
|
+
|
75
|
+
=== 0.2.5 / 2011-12-29
|
76
|
+
* Major Enhancements
|
77
|
+
* Added various options to 'deploy' subcommand.
|
78
|
+
* Minor Enhancements
|
79
|
+
* Fixed 'master' subcommand to retry role change commands in case of failure.
|
80
|
+
* Changed default retry limit to 10 times for safety.
|
81
|
+
* Modified 'reconstruct' subcommand to ask before restoring a balance value.
|
82
|
+
|
83
|
+
=== 0.2.4 / 2011-12-22
|
84
|
+
* Major Enhancements
|
85
|
+
* Added 'activate' subcommand to flare-admin for activating a master node in ready state.
|
86
|
+
* Minor Enhancements
|
87
|
+
* Removed --keep-ready option from 'master' subcommand. Now it's the default behavior.
|
88
|
+
* Added --activate option to activate a new master after its construction.
|
89
|
+
|
90
|
+
=== 0.2.3 / 2011-11-30
|
91
|
+
* Major Enhancements
|
92
|
+
* Added 'remove' subcommand to flare-admin for removing nodes from a cluster.
|
93
|
+
* Minor Enhancements
|
94
|
+
* Aded --keep-ready option to 'master' subcommand, which is used for keeping
|
95
|
+
the constructed master in ready state.
|
96
|
+
* Modified 'reconstruct' subcommand to skip when a node isn't ready for reconstruction.
|
97
|
+
* Added --clean option to 'slave' subcommand to rebuild database from scratch.
|
98
|
+
* Removed --transitive option from 'index' subcommand because it's the default behavior now.
|
99
|
+
|
100
|
+
=== 0.2.2 / 2011-11-24
|
101
|
+
* Minor Enhancements
|
102
|
+
* Introduced log4r.
|
103
|
+
* Implemented a reconnection routine of Connection class.
|
104
|
+
* Modified cli/reconstruct.rb to get out of confirmation skip mode when Ctrl+C is pressed.
|
105
|
+
|
106
|
+
=== 0.2.1 / 2011-11-18
|
107
|
+
* Minor Enhancements
|
108
|
+
* Added --all option to the 'reconstruct' subcommand to flush and reconstruct all
|
109
|
+
the nodes in a cluster one by one.
|
110
|
+
* Improved the confirmation step of the reconstruct sumcommand.
|
111
|
+
|
112
|
+
=== 0.2.0 / 2011-11-15
|
113
|
+
|
114
|
+
* Major enhancements
|
4
115
|
* Initial release
|
116
|
+
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
-------------------------------------
|
3
|
+
Copyright (c) 2011 GREE, Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/Manifest.txt
CHANGED
@@ -1,15 +1,72 @@
|
|
1
|
+
Flare-tools.txt
|
1
2
|
History.txt
|
3
|
+
LICENSE
|
2
4
|
Manifest.txt
|
3
5
|
PostInstall.txt
|
4
|
-
README.
|
6
|
+
README.txt
|
5
7
|
Rakefile
|
6
|
-
|
8
|
+
Tutorial.txt
|
9
|
+
bin/flare-admin
|
10
|
+
bin/flare-argv0
|
11
|
+
bin/flare-deploy
|
12
|
+
bin/flare-keychecker
|
13
|
+
bin/flare-part
|
14
|
+
bin/flare-ping
|
7
15
|
bin/flare-stats
|
8
|
-
|
9
|
-
lib/flare/
|
16
|
+
bin/flare-zkadmin
|
17
|
+
lib/flare/net/connection.rb
|
18
|
+
lib/flare/test/cluster.rb
|
19
|
+
lib/flare/test/daemon.rb
|
20
|
+
lib/flare/test/node.rb
|
10
21
|
lib/flare/tools.rb
|
11
|
-
lib/flare/tools/cli
|
12
|
-
lib/flare/tools/cli/
|
22
|
+
lib/flare/tools/cli.rb
|
23
|
+
lib/flare/tools/cli/activate.rb
|
24
|
+
lib/flare/tools/cli/balance.rb
|
25
|
+
lib/flare/tools/cli/cli_util.rb
|
26
|
+
lib/flare/tools/cli/deploy.rb
|
27
|
+
lib/flare/tools/cli/down.rb
|
28
|
+
lib/flare/tools/cli/dump.rb
|
29
|
+
lib/flare/tools/cli/dumpkey.rb
|
30
|
+
lib/flare/tools/cli/flare_admin.rb
|
31
|
+
lib/flare/tools/cli/flare_argv0.rb
|
32
|
+
lib/flare/tools/cli/flare_keychecker.rb
|
33
|
+
lib/flare/tools/cli/flare_zkadmin.rb
|
34
|
+
lib/flare/tools/cli/index.rb
|
35
|
+
lib/flare/tools/cli/list.rb
|
36
|
+
lib/flare/tools/cli/master.rb
|
37
|
+
lib/flare/tools/cli/part.rb
|
38
|
+
lib/flare/tools/cli/ping.rb
|
39
|
+
lib/flare/tools/cli/reconstruct.rb
|
40
|
+
lib/flare/tools/cli/remove.rb
|
41
|
+
lib/flare/tools/cli/restore.rb
|
42
|
+
lib/flare/tools/cli/slave.rb
|
13
43
|
lib/flare/tools/cli/stats.rb
|
14
|
-
lib/flare/tools/
|
15
|
-
lib/flare/tools/
|
44
|
+
lib/flare/tools/cli/sub_command.rb
|
45
|
+
lib/flare/tools/cli/summary.rb
|
46
|
+
lib/flare/tools/cli/threads.rb
|
47
|
+
lib/flare/tools/cli/verify.rb
|
48
|
+
lib/flare/tools/client.rb
|
49
|
+
lib/flare/tools/cluster.rb
|
50
|
+
lib/flare/tools/common.rb
|
51
|
+
lib/flare/tools/index_server.rb
|
52
|
+
lib/flare/tools/node.rb
|
53
|
+
lib/flare/tools/stats.rb
|
54
|
+
lib/flare/tools/zk_util.rb
|
55
|
+
lib/flare/util.rb
|
56
|
+
lib/flare/util/bwlimit.rb
|
57
|
+
lib/flare/util/command_line.rb
|
58
|
+
lib/flare/util/conf.rb
|
59
|
+
lib/flare/util/constant.rb
|
60
|
+
lib/flare/util/conversion.rb
|
61
|
+
lib/flare/util/default_logger.rb
|
62
|
+
lib/flare/util/exception.rb
|
63
|
+
lib/flare/util/filesystem.rb
|
64
|
+
lib/flare/util/flared_conf.rb
|
65
|
+
lib/flare/util/flarei_conf.rb
|
66
|
+
lib/flare/util/hash_function.rb
|
67
|
+
lib/flare/util/interruption.rb
|
68
|
+
lib/flare/util/key_resolver.rb
|
69
|
+
lib/flare/util/log4r_logger.rb
|
70
|
+
lib/flare/util/logger.rb
|
71
|
+
lib/flare/util/logging.rb
|
72
|
+
lib/flare/util/result.rb
|
data/README.txt
ADDED
@@ -0,0 +1,356 @@
|
|
1
|
+
:title: README
|
2
|
+
|
3
|
+
= flare-tools
|
4
|
+
|
5
|
+
http://labs.gree.jp/Top/OpenSource/Flare-en.html
|
6
|
+
|
7
|
+
Flare-tools is a collection of command line tools to maintain a flare cluster.
|
8
|
+
|
9
|
+
* flare-stats
|
10
|
+
* flare-stats is a command used for aquring statistics of nodes in a flare cluster.
|
11
|
+
|
12
|
+
* flare-admin
|
13
|
+
* flare-admin is a command used for maintaining your flare clusters.
|
14
|
+
|
15
|
+
== DESCRIPTION:
|
16
|
+
|
17
|
+
Management Tools for Flare
|
18
|
+
|
19
|
+
Authors:: Kiyoshi Ikehara <kiyoshi.ikehara@gree.net>
|
20
|
+
Copyright:: Copyright (C) GREE, Inc. 2011.
|
21
|
+
License:: MIT-style
|
22
|
+
|
23
|
+
== SYNOPSIS:
|
24
|
+
|
25
|
+
=== flare-stats
|
26
|
+
|
27
|
+
$ flare-stats [options] [hostname:port] ...
|
28
|
+
|
29
|
+
=== flare-admin
|
30
|
+
|
31
|
+
$ flare-admin [subcommand] [options] [arguments]
|
32
|
+
|
33
|
+
== REQUIREMENTS:
|
34
|
+
|
35
|
+
* Flare >= 1.0.14
|
36
|
+
|
37
|
+
== INSTALL:
|
38
|
+
|
39
|
+
* Install Flare
|
40
|
+
|
41
|
+
Please see the web pages about {Flare}[http://labs.gree.jp/Top/OpenSource/Flare-en.html] in GREE Labs.
|
42
|
+
|
43
|
+
* Install flare-tools
|
44
|
+
# gem install flare-tools
|
45
|
+
|
46
|
+
== AUTHORS:
|
47
|
+
|
48
|
+
* Kiyoshi Ikehara
|
49
|
+
|
50
|
+
== USAGE:
|
51
|
+
|
52
|
+
=== SPECIFYING YOUR INDEX SERVER
|
53
|
+
|
54
|
+
All the commands in flare-tools have common ways to specify an index server.
|
55
|
+
|
56
|
+
If your flare index server doesn't listen to the defalut port (12120), you have to specify
|
57
|
+
its hostname (or IP address) and port of your index node specifically.
|
58
|
+
|
59
|
+
This is done by setting options, --index-server and --index-server-port.
|
60
|
+
(other tools can also accept these two options.)
|
61
|
+
|
62
|
+
$ flare-stats --index-server=your.index.server --index-server-port=13130
|
63
|
+
|
64
|
+
You can also set or FLARE_INDEX_SERVER and FLARE_INDEX_SERVER_PORT environment variables.
|
65
|
+
These variables dosen't override the index node specified by options.
|
66
|
+
|
67
|
+
$ export FLARE_INDEX_SERVER=your.index.server
|
68
|
+
$ export FLARE_INDEX_SERVER_PORT=13130
|
69
|
+
$ flare-stats
|
70
|
+
|
71
|
+
or
|
72
|
+
|
73
|
+
$ export FLARE_INDEX_SERVER=your.index.server:13130
|
74
|
+
$ flare-stats
|
75
|
+
|
76
|
+
=== flare-stats
|
77
|
+
|
78
|
+
Flare-stats is a dedicated command line tool used for aquiring statistics of flare nodes.
|
79
|
+
This tool shows a list of nodes in a flare cluster and their summarized information.
|
80
|
+
|
81
|
+
$ flare-stats --index-server=flare1.example.com
|
82
|
+
hostname:port state role partition balance items conn behind hit size uptime version
|
83
|
+
flare1.example.com:12121 active master 0 1 10000 111 0 100 10 12d 1.0.10
|
84
|
+
flare2.example.com:12121 active slave 0 1 10000 111 0 100 10 12d 1.0.10
|
85
|
+
flare3.example.com:12121 active master 1 1 10001 111 0 100 10 12d 1.0.10
|
86
|
+
flare4.example.com:12121 active slave 1 1 10001 111 0 100 10 12d 1.0.10
|
87
|
+
|
88
|
+
Flare-stats is a short-cut version of stats subcommand of flare-admin.
|
89
|
+
Please see the stats subcommand section of flare-admin for further detail.
|
90
|
+
|
91
|
+
==== flare-stats's options
|
92
|
+
|
93
|
+
Usage: flare-stats [options]
|
94
|
+
-h, --help shows this message
|
95
|
+
-d, --debug enables debug mode
|
96
|
+
-w, --warn turns on warnings
|
97
|
+
-i, --index-server=[HOSTNAME] index server hostname(default:127.0.0.1)
|
98
|
+
-p, --index-server-port=[PORT] index server port(default:12120)
|
99
|
+
-q, --qps show qps
|
100
|
+
--wait=[SECOND] wait time for repeat(second)
|
101
|
+
-c, --count=[REPEATTIME] repeat count
|
102
|
+
--delimiter=[CHAR] delimiter
|
103
|
+
|
104
|
+
=== flare-stdmin
|
105
|
+
|
106
|
+
Flare-admin consists of a battery of subcommands used for maintaining a flare cluster.
|
107
|
+
You must specify the hostname and port number of the index node by telling them as options
|
108
|
+
or environment variables.
|
109
|
+
|
110
|
+
==== MASTER subcommand
|
111
|
+
|
112
|
+
'master' subcommand is used for creating a new partition in a cluster.
|
113
|
+
You must specify a hostname, a port number, an intitial balance and a partition number
|
114
|
+
for each partition in "hostname:port:balance:partition" format. The specified node will
|
115
|
+
be changed from 'proxy' state to 'master' state and given the specified balance after
|
116
|
+
the construction.
|
117
|
+
|
118
|
+
If the node isn't a proxy or the partition already exists, this subcommand fails.
|
119
|
+
|
120
|
+
$ flare-admin master newmaster1:12131:1:1
|
121
|
+
(confirmation)
|
122
|
+
(construction)
|
123
|
+
|
124
|
+
This subcommand asks you before committing the change to make sure that you know the
|
125
|
+
result. If you're convinced of the effect of this subcommand and doesn't want to be
|
126
|
+
bothered, you can specify --force option to skip the confirmation steps.
|
127
|
+
|
128
|
+
$ flare-admin master --force newmaster:12131:1:1
|
129
|
+
|
130
|
+
==== RECONSTRUCT subcommand
|
131
|
+
|
132
|
+
'reconstruct' subcommand flushes the existing data and reconstruct new database from
|
133
|
+
another node. This subcommand can be applied to both slaves and masters.
|
134
|
+
If you reconstruct a master, the node will be turned down and one of slave nodes will
|
135
|
+
take over master's role.
|
136
|
+
|
137
|
+
$ flare-admin reconstruct node1:12121
|
138
|
+
(confirmation)
|
139
|
+
(construction)
|
140
|
+
|
141
|
+
If you want to reconstruct all nodes in a cluster, you can specify --all option.
|
142
|
+
|
143
|
+
$ flare-admin reconstruct --all
|
144
|
+
(confirmation)
|
145
|
+
(construction)
|
146
|
+
...
|
147
|
+
|
148
|
+
This subcommand asks you before committing the change to make sure that you know the
|
149
|
+
result. If you're convinced of the effect of this subcommand and doesn't want to be
|
150
|
+
bothered, you can specify --force option to skip the confirmation steps.
|
151
|
+
|
152
|
+
$ flare-admin reconstruct --force node1:12121
|
153
|
+
(construction)
|
154
|
+
|
155
|
+
==== PING subcommand
|
156
|
+
|
157
|
+
'ping' subcommand checks if the nodes specified as arguments are alive or not by
|
158
|
+
connecting each node and sending a ping request. If the response is positive (OK),
|
159
|
+
flare-admin exits with a status code 0 (otherwise 1). You can check the soundness
|
160
|
+
of a node by this subcommand in scripts.
|
161
|
+
|
162
|
+
$ flare-admin ping
|
163
|
+
alive
|
164
|
+
|
165
|
+
If you want to wait for a node to start up, you should specify --wait option and
|
166
|
+
the command repeatedly sends ping requests until the node is available.
|
167
|
+
|
168
|
+
$ flare-admin ping --wait
|
169
|
+
|
170
|
+
==== DEPLOY subcommand (experimental)
|
171
|
+
|
172
|
+
'deploy' subcommand generates node settings with control scripts.
|
173
|
+
This subcommand is mainly used for experiments.
|
174
|
+
|
175
|
+
==== SLAVE subcommand
|
176
|
+
|
177
|
+
'slave' subcommand makes a node a slave state and construct the slave database.
|
178
|
+
Before changing the state, this confirms the current state and the resulted state.
|
179
|
+
After that, duplication of data starts and the progress is put on your console.
|
180
|
+
|
181
|
+
$ flare-admin slave newslave1:12132:1:0 newslave2:12132:1:0
|
182
|
+
(confirmation)
|
183
|
+
(construction)
|
184
|
+
|
185
|
+
==== BALANCE subcommand
|
186
|
+
|
187
|
+
'balance' subcommand sets balance parameters of nodes.
|
188
|
+
|
189
|
+
$ flare-admin balance node1:12131:3 node2:12131:2
|
190
|
+
(confirmation)
|
191
|
+
(setting balance)
|
192
|
+
|
193
|
+
==== LIST subcommand
|
194
|
+
|
195
|
+
'list' subcommand shows a node list in a cluster.
|
196
|
+
|
197
|
+
$ flare-admin list
|
198
|
+
node partition role state balance
|
199
|
+
server1:12121 - proxy active 0
|
200
|
+
|
201
|
+
This subcommand just refers the cluster information the index node in a cluster.
|
202
|
+
If 'stats' subcommand fails, please check the node status by this subcommand.
|
203
|
+
|
204
|
+
==== THREADS subcommand (experimental)
|
205
|
+
|
206
|
+
'threads' subcommand shows the thread status of the specified node.
|
207
|
+
|
208
|
+
$ flare-admin threads node1:12121
|
209
|
+
|
210
|
+
==== STATS subcommand
|
211
|
+
|
212
|
+
'stats' subcommand shows the status of nodes in a cluster.
|
213
|
+
|
214
|
+
$ flare-admin stats
|
215
|
+
hostname:port state role partition balance items conn behind hit size uptime version
|
216
|
+
server1:12121 active master 0 1 30 11 0 70 0 1d 1.0.14
|
217
|
+
server2:12121 active slave 0 1 35 19 0 68 0 1h 1.0.14
|
218
|
+
|
219
|
+
This subcommand also display qps (query per second) statistics of each node.
|
220
|
+
|
221
|
+
$ flare-admin stats --qps --count=100
|
222
|
+
...
|
223
|
+
hostname:port state role partition balance items conn behind hit size uptime version qps qps-r qps-w
|
224
|
+
server1:12121 active master 0 1 30 11 0 70 0 1d 1.0.14 100.3 50.1 50.2
|
225
|
+
server2:12121 active slave 0 1 35 19 0 68 0 1h 1.0.14 52.1 0 52.1
|
226
|
+
...
|
227
|
+
|
228
|
+
==== INDEX subcommand (experimental)
|
229
|
+
|
230
|
+
'index' subcommand generates the index file of a cluster.
|
231
|
+
|
232
|
+
$ flare-admin index
|
233
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
234
|
+
<!DOCTYPE boost_serialization>
|
235
|
+
<boost_serialization signature="serialization::archive" version="4">
|
236
|
+
<node_map class_id='0' tracking_level='0' version='0'> ... </node_map>
|
237
|
+
|
238
|
+
==== DOWN subcommand
|
239
|
+
|
240
|
+
'down' subcommand turn nodes down.
|
241
|
+
|
242
|
+
$ flare-admin down node1:12121 node2:12121
|
243
|
+
|
244
|
+
==== flare-admin's options
|
245
|
+
|
246
|
+
Usage: flare-admin [subcommand] [options] [arguments]
|
247
|
+
-h, --help show this message
|
248
|
+
-d, --debug enable debug mode
|
249
|
+
-w, --warn turn on warnings
|
250
|
+
-n, --dry-run dry run
|
251
|
+
-i, --index-server=[HOSTNAME] index server hostname(default:)
|
252
|
+
-p, --index-server-port=[PORT] index server port(default:)
|
253
|
+
--log-file=[LOGFILE] output log to LOGFILE
|
254
|
+
subcommands:
|
255
|
+
|
256
|
+
[dumpkey] dump key from nodes.
|
257
|
+
Usage: flare-admin dumpkey [hostname:port] ...
|
258
|
+
-o, --output=[FILE] output to file
|
259
|
+
-f, --format=[FORMAT] output format [csv]
|
260
|
+
-p, --partition=[NUMBER] partition number
|
261
|
+
-s, --partition-size=[SIZE] partition size
|
262
|
+
--bwlimit=[BANDWIDTH] bandwidth limit (bps)
|
263
|
+
--all dump form all partitions
|
264
|
+
|
265
|
+
[master] construct a partition with a proxy node for master role.
|
266
|
+
Usage: flare-admin master [hostname:port:balance:partition] ...
|
267
|
+
--force commit changes without confirmation
|
268
|
+
--retry=[COUNT] specify retry count (default:10)
|
269
|
+
--activate change node's state from ready to active
|
270
|
+
|
271
|
+
[balance] set the balance values of nodes.
|
272
|
+
Usage: flare-admin balance [hostname:port:balance] ...
|
273
|
+
--force commit changes without confirmation
|
274
|
+
|
275
|
+
[down] turn down nodes and move them to proxy state.
|
276
|
+
Usage: flare-admin down [hostname:port] ...
|
277
|
+
--force commit changes without confirmation
|
278
|
+
|
279
|
+
[restore] restore data to nodes. (experimental)
|
280
|
+
Usage: flare-admin restore [hostname:port]
|
281
|
+
-i, --input=[FILE] input from file
|
282
|
+
-f, --format=[FORMAT] input format [tch]
|
283
|
+
--bwlimit=[BANDWIDTH] bandwidth limit (bps)
|
284
|
+
--include=[PATTERN] include pattern
|
285
|
+
--prefix-include=[STRING] prefix string
|
286
|
+
--exclude=[PATTERN] exclude pattern
|
287
|
+
--print-keys enables key dump to console
|
288
|
+
|
289
|
+
[stats] show the statistics of a flare cluster.
|
290
|
+
Usage: flare-admin stats [hostname:port] ...
|
291
|
+
-q, --qps show qps
|
292
|
+
-w, --wait=[SECOND] specify wait time for repeat(second)
|
293
|
+
-c, --count=[REPEATTIME] specify repeat count
|
294
|
+
-d, --delimiter=[CHAR] spedify delimiter
|
295
|
+
|
296
|
+
[verify] verify the cluster. (experimental)
|
297
|
+
Usage: flare-admin verify
|
298
|
+
--key-hash-algorithm=[TYPE] key hash algorithm
|
299
|
+
--use-test-data store test data
|
300
|
+
--debug use debug mode
|
301
|
+
--64bit (experimental) 64bit mode
|
302
|
+
--verbose use verbose mode
|
303
|
+
--meta use meta command
|
304
|
+
--quiet use quiet mode
|
305
|
+
|
306
|
+
[remove] remove a node. (experimental)
|
307
|
+
Usage: flare-admin remove
|
308
|
+
--force commit changes without confirmation
|
309
|
+
--wait=[SECOND] specify the time to wait node for getting ready (default:30)
|
310
|
+
--retry=[COUNT] retry count(default:5)
|
311
|
+
--connection-threshold=[COUNT]
|
312
|
+
specify connection threashold (default:2)
|
313
|
+
|
314
|
+
[dump] dump data from nodes. (experimental)
|
315
|
+
Usage: flare-admin dump [hostname:port] ...
|
316
|
+
-o, --output=[FILE] output to file
|
317
|
+
-f, --format=[FORMAT] specify output format [default,csv,tch]
|
318
|
+
--bwlimit=[BANDWIDTH] specify bandwidth limit (bps)
|
319
|
+
--all dump from all master nodes
|
320
|
+
--raw raw dump mode (for debugging)
|
321
|
+
|
322
|
+
[threads] show the list of threads in a flare cluster.
|
323
|
+
Usage: flare-admin threads [hostname:port]
|
324
|
+
|
325
|
+
[slave] construct slaves from proxy nodes.
|
326
|
+
Usage: flare-admin slave [hostname:port:balance:partition] ...
|
327
|
+
--force commit changes without confirmation
|
328
|
+
--retry=[COUNT] specify retry count(default:10)
|
329
|
+
--clean clear datastore before construction
|
330
|
+
|
331
|
+
[list] show the list of nodes in a flare cluster.
|
332
|
+
Usage: flare-admin list
|
333
|
+
--numeric-hosts show numerical host addresses
|
334
|
+
|
335
|
+
[activate] activate
|
336
|
+
Usage: flare-admin down [hostname:port] ...
|
337
|
+
--force commit changes without confirmation
|
338
|
+
|
339
|
+
[ping] ping
|
340
|
+
Usage: flare-admin ping [hostname:port] ...
|
341
|
+
--wait wait for OK responses from nodes
|
342
|
+
|
343
|
+
[index] print the index XML document from a cluster information.
|
344
|
+
Usage: flare-admin index
|
345
|
+
--output=[FILE] output index to a file
|
346
|
+
|
347
|
+
[reconstruct] reconstruct the database of nodes by copying.
|
348
|
+
Usage: flare-admin reconstruct [hostname:port] ...
|
349
|
+
--force commit changes without confirmation
|
350
|
+
--safe reconstruct a node safely
|
351
|
+
--retry=[COUNT] specify retry count (default:10)
|
352
|
+
--all reconstruct all nodes
|
353
|
+
|
354
|
+
== THANKS:
|
355
|
+
* Masaki FUJIMOTO (the author of Flare)
|
356
|
+
* kgws[http://d.hatena.ne.jp/kgws] (the author of old flare-tools)
|