|
| 1 | +<!--- |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +or more contributor license agreements. See the NOTICE file |
| 4 | +distributed with this work for additional information |
| 5 | +regarding copyright ownership. The ASF licenses this file |
| 6 | +to you under the Apache License, Version 2.0 (the |
| 7 | +"License"); you may not use this file except in compliance |
| 8 | +with the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | +Unless required by applicable law or agreed to in writing, |
| 13 | +software distributed under the License is distributed on an |
| 14 | +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +KIND, either express or implied. See the License for the |
| 16 | +specific language governing permissions and limitations |
| 17 | +under the License. |
| 18 | +--> |
| 19 | + |
| 20 | +# hbtop |
| 21 | + |
| 22 | +## Overview |
| 23 | + |
| 24 | +`hbtop` is a real-time monitoring tool for HBase like Unix's top command. |
| 25 | +It can display summary information as well as metrics per Region/Namespace/Table/RegionServer. |
| 26 | +In this tool, you can see the metrics sorted by a selected field and filter the metrics to see only metrics you really want to see. |
| 27 | +Also, with the drill-down feature, you can find hot regions easily in a top-down manner. |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +You can run hbtop with the following command: |
| 32 | + |
| 33 | +``` |
| 34 | +$ hbase hbtop |
| 35 | +``` |
| 36 | + |
| 37 | +In this case, the values of `hbase.client.zookeeper.quorum` and `zookeeper.znode.parent` in `hbase-site.xml` in the classpath or the default values of them are used to connect. |
| 38 | + |
| 39 | +Or, you can specify your own zookeeper quorum and znode parent as follows: |
| 40 | + |
| 41 | +``` |
| 42 | +$ hbase hbtop -Dhbase.client.zookeeper.quorum=<zookeeper quorum> -Dzookeeper.znode.parent=<znode parent> |
| 43 | +``` |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +The top screen consists of a summary part and of a metrics part. |
| 48 | +In the summary part, you can see `HBase Version`, `Cluster ID`, `The number of region servers`, `Region count`, `Average Cluster Load` and `Aggregated Request/s`. |
| 49 | +In the metrics part, you can see metrics per Region/Namespace/Table/RegionServer depending on the selected mode. |
| 50 | +The top screen is refreshed in a certain period – 3 seconds by default. |
| 51 | + |
| 52 | +### Scrolling metric records |
| 53 | + |
| 54 | +You can scroll the metric records in the metrics part. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +### Command line arguments |
| 59 | + |
| 60 | +| Argument | Description | |
| 61 | +|---|---| |
| 62 | +| -d,--delay <arg> | The refresh delay (in seconds); default is 3 seconds | |
| 63 | +| -h,--help | Print usage; for help while the tool is running press `h` key | |
| 64 | +| -m,--mode <arg> | The mode; `n` (Namespace)|`t` (Table)|r (Region)|`s` (RegionServer), default is `r` (Region) | |
| 65 | + |
| 66 | +### Modes |
| 67 | + |
| 68 | +There are the following 4 modes in hbtop: |
| 69 | + |
| 70 | +| Mode | Description | |
| 71 | +|---|---| |
| 72 | +| Region | Showing metric records per region | |
| 73 | +| Namespace | Showing metric records per namespace | |
| 74 | +| Table | Showing metric records per table | |
| 75 | +| RegionServer | Showing metric records per region server | |
| 76 | + |
| 77 | +#### Region mode |
| 78 | + |
| 79 | +In Region mode, the default sort field is `#REQ/S`. |
| 80 | + |
| 81 | +The fields in this mode are as follows: |
| 82 | + |
| 83 | +| Field | Description | Displayed by default | |
| 84 | +|---|---|---| |
| 85 | +| RNAME | Region Name | false | |
| 86 | +| NAMESPACE | Namespace Name | true | |
| 87 | +| TABLE | Table Name | true | |
| 88 | +| SCODE | Start Code | false | |
| 89 | +| REPID | Replica ID | false | |
| 90 | +| REGION | Encoded Region Name | true | |
| 91 | +| RS | Short Region Server Name | true | |
| 92 | +| LRS | Long Region Server Name | false | |
| 93 | +| #REQ/S | Request Count per second | true | |
| 94 | +| #READ/S | Read Request Count per second | true | |
| 95 | +| #FREAD/S | Filtered Read Request Count per second | true | |
| 96 | +| #WRITE/S | Write Request Count per second | true | |
| 97 | +| SF | StoreFile Size | true | |
| 98 | +| USF | Uncompressed StoreFile Size | false | |
| 99 | +| #SF | Number of StoreFiles | true | |
| 100 | +| MEMSTORE | MemStore Size | true | |
| 101 | +| LOCALITY | Block Locality | true | |
| 102 | +| SKEY | Start Key | false | |
| 103 | +| #COMPingCELL | Compacting Cell Count | false | |
| 104 | +| #COMPedCELL | Compacted Cell Count | false | |
| 105 | +| %COMP | Compaction Progress | false | |
| 106 | +| LASTMCOMP | Last Major Compaction Time | false | |
| 107 | + |
| 108 | +#### Namespace mode |
| 109 | + |
| 110 | +In Namespace mode, the default sort field is `#REQ/S`. |
| 111 | + |
| 112 | +The fields in this mode are as follows: |
| 113 | + |
| 114 | +| Field | Description | Displayed by default | |
| 115 | +|---|---|---| |
| 116 | +| NAMESPACE | Namespace Name | true | |
| 117 | +| #REGION | Region Count | true | |
| 118 | +| #REQ/S | Request Count per second | true | |
| 119 | +| #READ/S | Read Request Count per second | true | |
| 120 | +| #FREAD/S | Filtered Read Request Count per second | true | |
| 121 | +| #WRITE/S | Write Request Count per second | true | |
| 122 | +| SF | StoreFile Size | true | |
| 123 | +| USF | Uncompressed StoreFile Size | false | |
| 124 | +| #SF | Number of StoreFiles | true | |
| 125 | +| MEMSTORE | MemStore Size | true | |
| 126 | + |
| 127 | +#### Table mode |
| 128 | + |
| 129 | +In Table mode, the default sort field is `#REQ/S`. |
| 130 | + |
| 131 | +The fields in this mode are as follows: |
| 132 | + |
| 133 | +| Field | Description | Displayed by default | |
| 134 | +|---|---|---| |
| 135 | +| NAMESPACE | Namespace Name | true | |
| 136 | +| TABLE | Table Name | true | |
| 137 | +| #REGION | Region Count | true | |
| 138 | +| #REQ/S | Request Count per second | true | |
| 139 | +| #READ/S | Read Request Count per second | true | |
| 140 | +| #FREAD/S | Filtered Read Request Count per second | true | |
| 141 | +| #WRITE/S | Write Request Count per second | true | |
| 142 | +| SF | StoreFile Size | true | |
| 143 | +| USF | Uncompressed StoreFile Size | false | |
| 144 | +| #SF | Number of StoreFiles | true | |
| 145 | +| MEMSTORE | MemStore Size | true | |
| 146 | + |
| 147 | +#### RegionServer mode |
| 148 | + |
| 149 | +In RegionServer mode, the default sort field is `#REQ/S`. |
| 150 | + |
| 151 | +The fields in this mode are as follows: |
| 152 | + |
| 153 | +| Field | Description | Displayed by default | |
| 154 | +|---|---|---| |
| 155 | +| RS | Short Region Server Name | true | |
| 156 | +| LRS | Long Region Server Name | false | |
| 157 | +| #REGION | Region Count | true | |
| 158 | +| #REQ/S | Request Count per second | true | |
| 159 | +| #READ/S | Read Request Count per second | true | |
| 160 | +| #FREAD/S | Filtered Read Request Count per second | true | |
| 161 | +| #WRITE/S | Write Request Count per second | true | |
| 162 | +| SF | StoreFile Size | true | |
| 163 | +| USF | Uncompressed StoreFile Size | false | |
| 164 | +| #SF | Number of StoreFiles | true | |
| 165 | +| MEMSTORE | MemStore Size | true | |
| 166 | +| UHEAP | Used Heap Size | true | |
| 167 | +| MHEAP | Max Heap Size | true | |
| 168 | + |
| 169 | +### Changing mode |
| 170 | + |
| 171 | +You can change mode by pressing `m` key in the top screen. |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | +### Changing the refresh delay |
| 176 | + |
| 177 | +You can change the refresh by pressing `d` key in the top screen. |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | +### Changing the displayed fields |
| 182 | + |
| 183 | +You can move to the field screen by pressing `f` key in the top screen. In the fields screen, you can change the displayed fields by choosing a field and pressing `d` key or `space` key. |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | +### Changing the sort field |
| 188 | + |
| 189 | +You can move to the fields screen by pressing `f` key in the top screen. In the field screen, you can change the sort field by choosing a field and pressing `s`. Also, you can change the sort order (ascending or descending) by pressing `R` key. |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | +### Changing the order of the fields |
| 195 | + |
| 196 | +You can move to the fields screen by pressing `f` key in the top screen. In the field screen, you can change the order of the fields. |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | +### Filters |
| 201 | + |
| 202 | +You can filter the metric records with the filter feature. We can add filters by pressing `o` key for ignoring case or `O` key for case sensitive. |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | +The syntax is as follows: |
| 207 | +``` |
| 208 | +<Field><Operator><Value> |
| 209 | +``` |
| 210 | + |
| 211 | +For example, we can add filters like the following: |
| 212 | +``` |
| 213 | +NAMESPACE==default |
| 214 | +REQ/S>1000 |
| 215 | +``` |
| 216 | + |
| 217 | +The operators we can specify are as follows: |
| 218 | + |
| 219 | +| Operator | Description | |
| 220 | +|---|---| |
| 221 | +| = | Partial match | |
| 222 | +| == | Exact match | |
| 223 | +| > | Greater than | |
| 224 | +| >= | Greater than or equal to | |
| 225 | +| < | Less than | |
| 226 | +| <= | Less than and equal to | |
| 227 | + |
| 228 | +You can see the current filters by pressing `^o` key and clear them by pressing `=` key. |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | +### Drilling down |
| 233 | + |
| 234 | +You can drill down the metric record by choosing a metric record that you want to drill down and pressing `i` key in the top screen. With this feature, you can find hot regions easily in a top-down manner. |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | +### Help screen |
| 239 | + |
| 240 | +You can see the help screen by pressing `h` key in the top screen. |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | +## Others |
| 245 | + |
| 246 | +### How hbtop gets the metrics data |
| 247 | + |
| 248 | +hbtop gets the metrics from ClusterMetrics which is returned as the result of a call to Admin#getClusterMetrics() on the current HMaster. To add metrics to hbtop, they will need to be exposed via ClusterMetrics. |
0 commit comments