From 06e0a771e768095b4d8fb11ffc36009684f8de03 Mon Sep 17 00:00:00 2001 From: Zhiguo Wu Date: Fri, 13 Dec 2024 14:50:23 +0800 Subject: [PATCH 1/2] BIGTOP-4133: Add HBase component on Bigtop-3.3.0 stack --- .../hadoop/configuration/core-site.xml | 23 +- .../hadoop/configuration/hadoop.conf.xml | 4 +- .../bigtop/3.3.0/services/hadoop/order.json | 5 +- .../hbase/configuration/hbase-env.xml | 153 +++++++ .../hbase/configuration/hbase-log4j.xml | 183 ++++++++ .../hbase/configuration/hbase-policy.xml | 49 +++ .../hbase/configuration/hbase-site.xml | 416 ++++++++++++++++++ .../hbase/configuration/hbase.conf.xml | 64 +++ .../hbase/configuration/regionservers.xml | 57 +++ .../bigtop/3.3.0/services/hbase/metainfo.xml | 85 ++++ .../bigtop/3.3.0/services/hbase/order.json | 13 + .../3.3.0/services/zookeeper/order.json | 3 +- .../v3_3_0/hbase/HBaseClientScript.java | 52 +++ .../bigtop/v3_3_0/hbase/HBaseParams.java | 115 +++++ .../stack/bigtop/v3_3_0/hbase/HBaseSetup.java | 103 +++++ .../bigtop/v3_3_0/hbase/HMasterScript.java | 88 ++++ .../v3_3_0/hbase/HRegionServerScript.java | 90 ++++ 17 files changed, 1488 insertions(+), 15 deletions(-) create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-env.xml create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-log4j.xml create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-policy.xml create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase.conf.xml create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/regionservers.xml create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/metainfo.xml create mode 100644 bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/order.json create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScript.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParams.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseSetup.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScript.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScript.java diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/core-site.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/core-site.xml index 9f76aeea..945ff7ba 100644 --- a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/core-site.xml +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/core-site.xml @@ -28,7 +28,8 @@ io.file.buffer.size 131072 - The size of buffer for use in sequence files. + + The size of buffer for use in sequence files. The size of this buffer should probably be a multiple of hardware page size (4096 on Intel x86), and it determines how much data is buffered during read and write operations. @@ -37,15 +38,15 @@ io.serializations org.apache.hadoop.io.serializer.WritableSerialization - A list of comma-delimited serialization classes that can be used for obtaining serializers and - deserializers. + + A list of comma-delimited serialization classes that can be used for obtaining serializers and deserializers. io.compression.codecs org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.SnappyCodec - A list of the compression codec classes that can be used - for compression/decompression. + + A list of the compression codec classes that can be used for compression/decompression. @@ -59,7 +60,8 @@ fs.trash.interval 360 - Number of minutes after which the checkpoint gets deleted. + + Number of minutes after which the checkpoint gets deleted. If zero, the trash feature is disabled. This option may be configured both on the server and the client. If trash is disabled server side then the client side configuration is checked. @@ -88,7 +90,8 @@ ipc.server.tcpnodelay true - Turn on/off Nagle's algorithm for the TCP socket + + Turn on/off Nagle's algorithm for the TCP socket connection on the server. Setting to true disables the algorithm and may decrease latency with a cost of more/smaller packets. @@ -105,8 +108,7 @@ hadoop.security.authentication simple - Set the authentication for the cluster. Valid values are: simple or - kerberos. + Set the authentication for the cluster. Valid values are: simple or kerberos. @@ -117,7 +119,8 @@ hadoop.security.auth_to_local DEFAULT - The mapping from kerberos principal names to local OS mapreduce.job.user.names. + + The mapping from kerberos principal names to local OS mapreduce.job.user.names. So the default rule is just "DEFAULT" which takes all principals in your default domain to their first component. "omalley@APACHE.ORG" and "omalley/admin@APACHE.ORG" to "omalley", if your default domain is APACHE.ORG. diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/hadoop.conf.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/hadoop.conf.xml index 427fd926..97d5d7d1 100644 --- a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/hadoop.conf.xml +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/configuration/hadoop.conf.xml @@ -52,8 +52,8 @@ # limitations under the License. # -${hadoop_user} - nofile ${hdfs_user_nofile_limit} -${hadoop_group} - nproc ${hdfs_user_nproc_limit} +${hadoop_user} - nofile ${hadoop_user_nofile_limit} +${hadoop_group} - nproc ${hadoop_user_nproc_limit} ]]> diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/order.json b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/order.json index 41035f89..88d0990f 100644 --- a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/order.json +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hadoop/order.json @@ -6,11 +6,12 @@ "NAMENODE-RESTART" ], "DATANODE-STOP": [ - "NAMENODE-START" + "HBASE_MASTER-STOP" ], "NAMENODE-STOP": [ "DATANODE-STOP", - "SECONDARYNAMENODE-STOP" + "SECONDARYNAMENODE-STOP", + "HBASE_MASTER-STOP" ], "NAMENODE-START": [ "ZKFC-START", diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-env.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-env.xml new file mode 100644 index 00000000..79d40da7 --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-env.xml @@ -0,0 +1,153 @@ + + + + + + hbase_log_dir + /var/log/hbase + HBase Log Dir Prefix + Log Directories for HBase. + + + hbase_pid_dir + /var/run/hbase + HBase PID Dir + Pid Directory for HBase. + + + regionserver_heapsize + 4096 + Maximum amount of memory each HBase RegionServer can use. + HBase RegionServer Maximum Memory + + + regionserver_xmn_max + 4000 + RegionServers maximum value for -Xmn + + Sets the upper bound on HBase RegionServers' young generation size. + This value is used in case the young generation size (-Xmn) calculated based on the max heapsize (regionserver_heapsize) + and the -Xmn ratio (regionserver_xmn_ratio) exceeds this value. + + + + regionserver_xmn_ratio + 0.2 + RegionServers -Xmn in -Xmx ratio + Percentage of max heap size (-Xmx) which used for young generation heap (-Xmn). + + + master_heapsize + 4096 + HBase Master Maximum Memory + Maximum amount of memory each HBase Master can use. + + + parallel_gc_threads + 8 + HBase Parallel GC Threads + The number of JVM parallel garbage collection threads (e.g. -XX:ParallelGCThreads) + + + java_io_tmpdir + HBase Java IO Tmpdir + /tmp + Used in hbase-env.sh as HBASE_OPTS=-Djava.io.tmpdir=java_io_tmpdir + + + regionserver_shutdown_timeout + 30 + HBase RegionServer shutdown timeout + + After this number of seconds waiting for graceful stop of HBase Master it will be forced to exit with SIGKILL. + The timeout is introduced because there is a known bug when from time to time HBase RegionServer hangs forever on stop if NN safemode is on. + + + + + content + hbase-env template + This is the freemarker template for hbase-env.sh file + + + + longtext + + + diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-log4j.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-log4j.xml new file mode 100644 index 00000000..5d74c740 --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-log4j.xml @@ -0,0 +1,183 @@ + + + + + + hbase_log_maxfilesize + 256 + The maximum size of backup file before the log is rotated + HBase Log: backup file size + + + hbase_log_maxbackupindex + 20 + The number of backup files + HBase Log: # of backup files + + + hbase_security_log_maxfilesize + 256 + The maximum size of security backup file before the log is rotated + HBase Security Log: backup file size + + + hbase_security_log_maxbackupindex + 20 + The number of security backup files + HBase Security Log: # of backup files + + + content + hbase-log4j template + This is the freemarker template for log4j.properties file + +log4j.rootLogger=${hbase.root.logger} + + +# Logging Threshold +log4j.threshold=ALL + +# +# Daily Rolling File Appender +# +log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender +<#noparse> +log4j.appender.DRFA.File=${hbase.log.dir}/${hbase.log.file} + + +# Rollver at midnight +log4j.appender.DRFA.DatePattern=.yyyy-MM-dd + +# 30-day backup +#log4j.appender.DRFA.MaxBackupIndex=30 +log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout + +# Pattern format: Date LogLevel LoggerName LogMessage +<#noparse> +log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n + + +# Rolling File Appender properties +hbase.log.maxfilesize=${hbase_log_maxfilesize}MB +hbase.log.maxbackupindex=${hbase_log_maxbackupindex} + +# Rolling File Appender +log4j.appender.RFA=org.apache.log4j.RollingFileAppender +<#noparse> +log4j.appender.RFA.File=${hbase.log.dir}/${hbase.log.file} + + +log4j.appender.RFA.MaxFileSize=${hbase_log_maxfilesize}MB +log4j.appender.RFA.MaxBackupIndex=${hbase_log_maxbackupindex} + +log4j.appender.RFA.layout=org.apache.log4j.PatternLayout +<#noparse> +log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n + + +# +# Security audit appender +# +hbase.security.log.file=SecurityAuth.audit +hbase.security.log.maxfilesize=${hbase_security_log_maxfilesize}MB +hbase.security.log.maxbackupindex=${hbase_security_log_maxbackupindex} +log4j.appender.RFAS=org.apache.log4j.RollingFileAppender +<#noparse> +log4j.appender.RFAS.File=${hbase.log.dir}/${hbase.security.log.file} + +log4j.appender.RFAS.MaxFileSize=${hbase_security_log_maxfilesize}MB +log4j.appender.RFAS.MaxBackupIndex=${hbase_security_log_maxbackupindex} +log4j.appender.RFAS.layout=org.apache.log4j.PatternLayout +<#noparse> +log4j.appender.RFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n +log4j.category.SecurityLogger=${hbase.security.logger} + +log4j.additivity.SecurityLogger=false +#log4j.logger.SecurityLogger.org.apache.hadoop.hbase.security.access.AccessController=TRACE + +# +# Null Appender +# +log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender + +# +# console +# Add "console" to rootlogger above if you want to use this +# +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.target=System.err +log4j.appender.console.layout=org.apache.log4j.PatternLayout +<#noparse> +log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n + + +# Custom Logging levels + +log4j.logger.org.apache.zookeeper=ERROR +#log4j.logger.org.apache.hadoop.fs.FSNamesystem=DEBUG +log4j.logger.org.apache.hadoop.hbase=ERROR +# Make these two classes INFO-level. Make them DEBUG to see more zk debug. +log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=INFO +log4j.logger.org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher=INFO +#log4j.logger.org.apache.hadoop.dfs=DEBUG +# Set this class to log INFO only otherwise its OTT +# Enable this to get detailed connection error/retry logging. +# log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=TRACE + + +# Uncomment this line to enable tracing on _every_ RPC call (this can be a lot of output) +#log4j.logger.org.apache.hadoop.ipc.HBaseServer.trace=DEBUG + +# Uncomment the below if you want to remove logging of client region caching' +# and scan of .META. messages +# log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=INFO +# log4j.logger.org.apache.hadoop.hbase.client.MetaScanner=INFO +]]> + + + longtext + + + diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-policy.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-policy.xml new file mode 100644 index 00000000..0d906684 --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-policy.xml @@ -0,0 +1,49 @@ + + + + + + security.client.protocol.acl + * + ACL for HRegionInterface protocol implementations (ie. + clients talking to HRegionServers) + The ACL is a comma-separated list of user and group names. The user and + group list is separated by a blank. For e.g. "alice,bob users,wheel". + A special value of "*" means all users are allowed. + + + security.admin.protocol.acl + * + ACL for HMasterInterface protocol implementation (ie. + clients talking to HMaster for admin operations). + The ACL is a comma-separated list of user and group names. The user and + group list is separated by a blank. For e.g. "alice,bob users,wheel". + A special value of "*" means all users are allowed. + + + security.masterregion.protocol.acl + * + ACL for HMasterRegionInterface protocol implementations + (for HRegionServers communicating with HMaster) + The ACL is a comma-separated list of user and group names. The user and + group list is separated by a blank. For e.g. "alice,bob users,wheel". + A special value of "*" means all users are allowed. + + diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml new file mode 100644 index 00000000..70afdfbd --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml @@ -0,0 +1,416 @@ + + + + + + hbase.rootdir + HBase root directory + /hadoop/hbase + + The directory shared by region servers and into + which HBase persists. The URL should be 'fully-qualified' + to include the filesystem scheme. For example, to specify the + HDFS directory '/hbase' where the HDFS instance's namenode is + running at namenode.example.org on port 9000, set this value to: + hdfs://namenode.example.org:9000/hbase. By default HBase writes + into /tmp. Change this configuration else all data will be lost + on machine restart. + + + + hbase.cluster.distributed + true + + The mode the cluster will be in. Possible values are + false for standalone mode and true for distributed mode. If + false, startup will run all HBase and ZooKeeper daemons together + in the one JVM. + + + + hbase.master.port + 16000 + HBase Master Port + The port the HBase Master should bind to. + + + hbase.tmp.dir + /tmp/hbase + HBase tmp directory + + Temporary directory on the local filesystem. + Change this setting to point to a location more permanent + than '/tmp' (The '/tmp' directory is often cleared on + machine restart). + + + + hbase.local.dir + HBase Local directory + ${hbase.tmp.dir}/local + Directory on the local filesystem to be used as a local storage + + + hbase.master.info.bindAddress + 0.0.0.0 + The bind address for the HBase Master web UI. + + + hbase.master.info.port + 16010 + The port for the HBase Master web UI. + + + hbase.regionserver.info.port + 16030 + The port for the HBase RegionServer web UI. + + + hbase.regionserver.handler.count + 30 + Number of Handlers per RegionServer + + Count of RPC Listener instances spun up on RegionServers. + Same property is used by the Master for count of master handlers. + + + + hbase.hregion.majorcompaction + 604800000 + + Time between major compactions, expressed in milliseconds. Set to 0 to disable + time-based automatic major compactions. User-requested and size-based major compactions will + still run. This value is multiplied by hbase.hregion.majorcompaction.jitter to cause + compaction to start at a somewhat-random time during a given window of time. The default value + is 7 days, expressed in milliseconds. If major compactions are causing disruption in your + environment, you can configure them to run at off-peak times for your deployment, or disable + time-based major compactions by setting this parameter to 0, and run major compactions in a + cron job or by another external mechanism. + + Major Compaction Interval + + + hbase.hregion.memstore.block.multiplier + 4 + + Block updates if memstore has hbase.hregion.memstore.block.multiplier + times hbase.hregion.memstore.flush.size bytes. Useful preventing + runaway memstore during spikes in update traffic. Without an + upper-bound, memstore fills such that when it flushes the + resultant flush files take a long time to compact or split, or + worse, we OOME. + + HBase Region Block Multiplier + + + hbase.hregion.memstore.flush.size + 134217728 + + The size of an individual memstore. Each column familiy within each region is allocated its own memstore. + + Memstore Flush Size + + + hbase.hregion.memstore.mslab.enabled + true + + Enables the MemStore-Local Allocation Buffer, + a feature which works to prevent heap fragmentation under + heavy write loads. This can reduce the frequency of stop-the-world + GC pauses on large heaps. + + + + hbase.hregion.max.filesize + 10737418240 + + Maximum HFile size. If the sum of the sizes of a region's HFiles has grown to exceed this + value, the region is split in two. + + Maximum Region File Size + + + hbase.client.scanner.caching + 100 + + Number of rows that will be fetched when calling next + on a scanner if it is not served from (local, client) memory. Higher + caching values will enable faster scanners but will eat up more memory + and some calls of next may take longer and longer times when the cache is empty. + Do not set this value such that the time between invocations is greater + than the scanner timeout; i.e. hbase.regionserver.lease.period + + Number of Fetched Rows when Scanning from Disk + + + zookeeper.session.timeout + 90000 + + ZooKeeper session timeout in milliseconds. It is used in two different ways. + First, this value is used in the ZK client that HBase uses to connect to the ensemble. + It is also used by HBase when it starts a ZK server and it is passed as the 'maxSessionTimeout'. See + http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkSessions. + For example, if a HBase region server connects to a ZK ensemble that's also managed by HBase, then the + session timeout will be the one specified by this configuration. But, a region server that connects + to an ensemble managed with a different configuration will be subjected that ensemble's maxSessionTimeout. So, + even though HBase might propose using 90 seconds, the ensemble can have a max timeout lower than this and + it will take precedence. + + Zookeeper Session Timeout + + + hbase.client.keyvalue.maxsize + 1048576 + + Specifies the combined maximum allowed size of a KeyValue + instance. This is to set an upper boundary for a single entry saved in a + storage file. Since they cannot be split it helps avoiding that a region + cannot be split any further because the data is too large. It seems wise + to set this to a fraction of the maximum region size. Setting it to zero + or less disables the check. + + Maximum Record Size + + + hbase.hstore.compactionThreshold + 3 + + The maximum number of StoreFiles which will be selected for a single minor + compaction, regardless of the number of eligible StoreFiles. Effectively, the value of + hbase.hstore.compaction.max controls the length of time it takes a single compaction to + complete. Setting it larger means that more StoreFiles are included in a compaction. For most + cases, the default value is appropriate. + + Maximum Store Files before Minor Compaction + + + hbase.hstore.blockingStoreFiles + hstore blocking storefiles + 100 + + If more than this number of StoreFiles in any one Store + (one StoreFile is written per flush of MemStore) then updates are + blocked for this HRegion until a compaction is completed, or + until hbase.hstore.blockingWaitTime has been exceeded. + + + + hfile.block.cache.size + 0.40 + Percentage of RegionServer memory to allocate to read buffers. + % of RegionServer Allocated to Read Buffers + + + + + hbase.superuser + hbase + + List of users or groups (comma-separated), who are allowed + full privileges, regardless of stored ACLs, across the cluster. + Only used when HBase security is enabled. + + + + hbase.security.authentication + simple + + Select Simple or Kerberos authentication. Note: Kerberos must be set up before the Kerberos option will take effect. + + Enable Authentication + + + hbase.security.authorization + false + Set Authorization Method. + Enable Authorization + + + hbase.coprocessor.region.classes + org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint + + A comma-separated list of Coprocessors that are loaded by + default on all tables. For any override coprocessor method, these classes + will be called in order. After implementing your own Coprocessor, just put + it in HBase's classpath and add the fully qualified class name here. + A coprocessor can also be loaded on demand by setting HTableDescriptor. + + + + hbase.coprocessor.master.classes + + + A comma-separated list of + org.apache.hadoop.hbase.coprocessor.MasterObserver coprocessors that are + loaded by default on the active HMaster process. For any implemented + coprocessor methods, the listed classes will be called in order. After + implementing your own MasterObserver, just put it in HBase's classpath + and add the fully qualified class name here. + + + + zookeeper.znode.parent + ZooKeeper Znode Parent + /hbase-unsecure + + Root ZNode for HBase in ZooKeeper. All of HBase's ZooKeeper + files that are configured with a relative path will go under this node. + By default, all of HBase's ZooKeeper file path are configured with a + relative path, so they will all go under this directory unless changed. + + + + hbase.client.retries.number + 35 + + Maximum retries. Used as maximum for all retryable + operations such as the getting of a cell's value, starting a row update, + etc. Retry interval is a rough function based on hbase.client.pause. At + first we retry at this interval but then with backoff, we pretty quickly reach + retrying every ten seconds. See HConstants#RETRY_BACKOFF for how the backup + ramps up. Change this setting and hbase.client.pause to suit your workload. + + Maximum Client Retries + + + hbase.rpc.timeout + 90000 + + This is for the RPC layer to define how long HBase client applications + take for a remote call to time out. It uses pings to check connections + but will eventually throw a TimeoutException. + + HBase RPC Timeout + + + hbase.defaults.for.version.skip + true + Disables version verification. + + + dfs.domain.socket.path + /var/run/hadoop/dn._PORT + Path to domain socket. + + + hbase.rpc.protection + authentication + + + hbase.hregion.majorcompaction.jitter + 0.50 + + A multiplier applied to hbase.hregion.majorcompaction to cause compaction to occur + a given amount of time either side of hbase.hregion.majorcompaction. The smaller the number, + the closer the compactions will happen to the hbase.hregion.majorcompaction + interval. + + + + hbase.bucketcache.ioengine + + + Where to store the contents of the bucketcache. One of: onheap, + offheap, or file. If a file, set it to file:PATH_TO_FILE. + + + + hbase.bucketcache.size + + The size of the buckets for the bucketcache if you only use a single size. + + + hbase.bucketcache.percentage.in.combinedcache + + Value to be set between 0.0 and 1.0 + + + hbase.regionserver.wal.codec + RegionServer WAL Codec + org.apache.hadoop.hbase.regionserver.wal.WALCellCodec + + + hbase.region.server.rpc.scheduler.factory.class + + + + hbase.rpc.controllerfactory.class + + + + hbase.coprocessor.regionserver.classes + + + + hbase.hstore.compaction.max + 10 + + The maximum number of StoreFiles which will be selected for a single minor + compaction, regardless of the number of eligible StoreFiles. Effectively, the value of + hbase.hstore.compaction.max controls the length of time it takes a single compaction to + complete. Setting it larger means that more StoreFiles are included in a compaction. For most + cases, the default value is appropriate. + + Maximum Files for Compaction + + + hbase.regionserver.global.memstore.size + 0.4 + + Percentage of RegionServer memory to allocate to write buffers. + Each column family within each region is allocated a smaller pool (the memstore) within this shared write pool. + If this buffer is full, updates are blocked and data is flushed from memstores until a global low watermark + (hbase.regionserver.global.memstore.size.lower.limit) is reached. + + % of RegionServer Allocated to Write Buffers + + + hbase.regionserver.port + 16020 + The port the HBase RegionServer binds to. + + + hbase.master.ui.readonly + false + + + zookeeper.recovery.retry + 6 + + + hbase.regionserver.executor.openregion.threads + 20 + The number of threads region server uses to open regions + + + hbase.master.namespace.init.timeout + 2400000 + + The number of milliseconds master waits for hbase:namespace table to be initialized + + + + hbase.master.wait.on.regionservers.timeout + 30000 + + The number of milliseconds master waits for region servers to report in + + + diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase.conf.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase.conf.xml new file mode 100644 index 00000000..21925ff3 --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase.conf.xml @@ -0,0 +1,64 @@ + + + + + + hbase_user_nofile_limit + 128000 + Max open files limit setting for HBase user. + + + hbase_user_nproc_limit + 65536 + Max number of processes limit setting for HBase user. + + + content + hbase.conf template + This is the freemarker template for HBase file + + + + longtext + + + \ No newline at end of file diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/regionservers.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/regionservers.xml new file mode 100644 index 00000000..31876e45 --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/regionservers.xml @@ -0,0 +1,57 @@ + + + + + + content + hbase regionservers template + This is the freemarker template for hbase file + +<#list regionserver_hosts as host> +${host} + + + +]]> + + + longtext + + + \ No newline at end of file diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/metainfo.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/metainfo.xml new file mode 100644 index 00000000..3c03ab67 --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/metainfo.xml @@ -0,0 +1,85 @@ + + + + + + hbase + HBase + Apache HBase is the Hadoop database, a distributed, scalable, big data store. + 2.4.17-1 + hbase + + + + hbase_master + HMaster + server + 1+ + + HBase Master UI + hbase.master.info.port + 16010 + hbase.master.info.port + 16010 + + + + hbase_regionserver + HRegionServer + server + 1+ + + HBase RegionServer UI + hbase.regionserver.info.port + 16030 + hbase.regionserver.info.port + 16030 + + + + hbase_client + HBase Client + client + 1+ + + + + + + + x86_64 + aarch64 + + + + hbase-2.4.17-1.tar.gz + SHA-256:f74face0d18f75adc8dd084bae343e75b0fd70fea45c4eef907a2216b32d8792 + + + + + + + zookeeper + hadoop + + + + diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/order.json b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/order.json new file mode 100644 index 00000000..c293a7bb --- /dev/null +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/order.json @@ -0,0 +1,13 @@ +{ + "HBASE_REGIONSERVER-START": [ + "HBASE_MASTER-START" + ], + "HBASE_MASTER-STOP": [ + "HBASE_REGIONSERVER-STOP" + ], + "HBASE_MASTER-START": [ + "NAMENODE-START", + "DATANODE-START", + "ZOOKEEPER_SERVER-START" + ] +} \ No newline at end of file diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/zookeeper/order.json b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/zookeeper/order.json index 0da47175..65339933 100644 --- a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/zookeeper/order.json +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/zookeeper/order.json @@ -1,5 +1,6 @@ { "ZOOKEEPER_SERVER-STOP": [ - "KAFKA_BROKER-STOP" + "KAFKA_BROKER-STOP", + "HBASE_MASTER-STOP" ] } \ No newline at end of file diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScript.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScript.java new file mode 100644 index 00000000..c8a37d02 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScript.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.apache.bigtop.manager.common.shell.ShellResult; +import org.apache.bigtop.manager.stack.core.spi.param.Params; +import org.apache.bigtop.manager.stack.core.spi.script.AbstractClientScript; +import org.apache.bigtop.manager.stack.core.spi.script.Script; + +import com.google.auto.service.AutoService; +import lombok.extern.slf4j.Slf4j; + +import java.util.Properties; + +@Slf4j +@AutoService(Script.class) +public class HBaseClientScript extends AbstractClientScript { + + @Override + public ShellResult add(Params params) { + Properties properties = new Properties(); + properties.setProperty(PROPERTY_KEY_SKIP_LEVELS, "1"); + + return super.add(params, properties); + } + + @Override + public ShellResult configure(Params params) { + return HBaseSetup.configure(params); + } + + @Override + public String getComponentName() { + return "hbase_client"; + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParams.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParams.java new file mode 100644 index 00000000..630cdd01 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParams.java @@ -0,0 +1,115 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.apache.bigtop.manager.common.message.entity.payload.CommandPayload; +import org.apache.bigtop.manager.common.utils.Environments; +import org.apache.bigtop.manager.stack.bigtop.param.BigtopParams; +import org.apache.bigtop.manager.stack.core.annotations.GlobalParams; +import org.apache.bigtop.manager.stack.core.spi.param.Params; +import org.apache.bigtop.manager.stack.core.utils.LocalSettings; + +import com.google.auto.service.AutoService; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; +import java.util.Map; + +@Getter +@Slf4j +@AutoService(Params.class) +@NoArgsConstructor +public class HBaseParams extends BigtopParams { + + private String hbaseLogDir = "/var/log/hbase"; + private String hbasePidDir = "/var/run/hbase"; + + private String hbaseRootDir; + private String hbaseMasterPidFile; + private String hbaseRegionServerPidFile; + + private String hbaseEnvContent; + private String hbaseLog4jContent; + + public HBaseParams(CommandPayload commandPayload) { + super(commandPayload); + globalParamsMap.put("java_home", Environments.getJavaHome()); + globalParamsMap.put("hbase_home", serviceHome()); + globalParamsMap.put("hbase_conf_dir", confDir()); + globalParamsMap.put("security_enabled", false); + globalParamsMap.put("hbase_user", user()); + globalParamsMap.put("hbase_group", group()); + globalParamsMap.put("regionserver_hosts", LocalSettings.hosts("hbase_regionserver")); + + hbaseMasterPidFile = hbasePidDir + "/hbase-" + user() + "-master.pid"; + hbaseRegionServerPidFile = hbasePidDir + "/hbase-" + user() + "-regionserver.pid"; + } + + public String hbaseLimits() { + Map hbaseConf = LocalSettings.configurations(getServiceName(), "hbase.conf"); + return (String) hbaseConf.get("content"); + } + + public String regionservers() { + Map hdfsConf = LocalSettings.configurations(getServiceName(), "regionservers"); + return (String) hdfsConf.get("content"); + } + + @GlobalParams + public Map hbaseSite() { + Map configurations = LocalSettings.configurations(getServiceName(), "hbase-site"); + List zookeeperQuorum = LocalSettings.hosts("zookeeper_server"); + Map zooCfg = LocalSettings.configurations("zookeeper", "zoo.cfg"); + + // Auto generate properties for hbase-site.xml + configurations.put("hbase.zookeeper.property.clientPort", zooCfg.get("clientPort")); + configurations.put("hbase.zookeeper.quorum", String.join(",", zookeeperQuorum)); + + hbaseRootDir = (String) configurations.get("hbase.rootdir"); + return configurations; + } + + @GlobalParams + public Map hbaseEnv() { + Map hbaseEnv = LocalSettings.configurations(getServiceName(), "hbase-env"); + hbasePidDir = (String) hbaseEnv.get("hbase_pid_dir"); + hbaseLogDir = (String) hbaseEnv.get("hbase_log_dir"); + hbaseEnvContent = (String) hbaseEnv.get("content"); + return hbaseEnv; + } + + @GlobalParams + public Map hbaseLog4j() { + Map configurations = LocalSettings.configurations(getServiceName(), "hbase-log4j"); + hbaseLog4jContent = (String) configurations.get("content"); + return configurations; + } + + @GlobalParams + public Map hbasePolicy() { + return LocalSettings.configurations(getServiceName(), "hbase-policy"); + } + + @Override + public String getServiceName() { + return "hbase"; + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseSetup.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseSetup.java new file mode 100644 index 00000000..e3bc0b7d --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseSetup.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.apache.bigtop.manager.common.constants.Constants; +import org.apache.bigtop.manager.common.shell.ShellResult; +import org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop.HadoopParams; +import org.apache.bigtop.manager.stack.core.enums.ConfigType; +import org.apache.bigtop.manager.stack.core.spi.param.Params; +import org.apache.bigtop.manager.stack.core.utils.linux.LinuxFileUtils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.text.MessageFormat; + +import static org.apache.bigtop.manager.common.constants.Constants.PERMISSION_755; + +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class HBaseSetup { + + public static ShellResult configure(Params params) { + log.info("Configuring HBase"); + HBaseParams hbaseParams = (HBaseParams) params; + + String confDir = hbaseParams.confDir(); + String hbaseUser = hbaseParams.user(); + String hbaseGroup = hbaseParams.group(); + + LinuxFileUtils.createDirectories(hbaseParams.getHbaseLogDir(), hbaseUser, hbaseGroup, PERMISSION_755, true); + LinuxFileUtils.createDirectories(hbaseParams.getHbasePidDir(), hbaseUser, hbaseGroup, PERMISSION_755, true); + LinuxFileUtils.createDirectories(hbaseParams.getHbaseRootDir(), hbaseUser, hbaseGroup, PERMISSION_755, true); + + LinuxFileUtils.toFileByTemplate( + hbaseParams.hbaseLimits(), + MessageFormat.format("{0}/hbase.conf", HadoopParams.LIMITS_CONF_DIR), + Constants.ROOT_USER, + Constants.ROOT_USER, + Constants.PERMISSION_644, + hbaseParams.getGlobalParamsMap()); + + LinuxFileUtils.toFileByTemplate( + hbaseParams.getHbaseEnvContent(), + MessageFormat.format("{0}/hbase-env.sh", confDir), + hbaseUser, + hbaseGroup, + Constants.PERMISSION_644, + hbaseParams.getGlobalParamsMap()); + + LinuxFileUtils.toFile( + ConfigType.XML, + MessageFormat.format("{0}/hbase-site.xml", confDir), + hbaseUser, + hbaseGroup, + Constants.PERMISSION_644, + hbaseParams.hbaseSite()); + + LinuxFileUtils.toFile( + ConfigType.XML, + MessageFormat.format("{0}/hbase-policy.xml", confDir), + hbaseUser, + hbaseGroup, + Constants.PERMISSION_644, + hbaseParams.hbasePolicy()); + + LinuxFileUtils.toFileByTemplate( + hbaseParams.getHbaseLog4jContent(), + MessageFormat.format("{0}/log4j.properties", confDir), + hbaseUser, + hbaseGroup, + Constants.PERMISSION_644, + hbaseParams.getGlobalParamsMap()); + + LinuxFileUtils.toFileByTemplate( + hbaseParams.regionservers(), + MessageFormat.format("{0}/regionservers", confDir), + hbaseUser, + hbaseGroup, + Constants.PERMISSION_644, + hbaseParams.getGlobalParamsMap()); + + log.info("Successfully configured HBase"); + return ShellResult.success(); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScript.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScript.java new file mode 100644 index 00000000..0954ca93 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScript.java @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.apache.bigtop.manager.common.shell.ShellResult; +import org.apache.bigtop.manager.stack.core.exception.StackException; +import org.apache.bigtop.manager.stack.core.spi.param.Params; +import org.apache.bigtop.manager.stack.core.spi.script.AbstractServerScript; +import org.apache.bigtop.manager.stack.core.spi.script.Script; +import org.apache.bigtop.manager.stack.core.utils.linux.LinuxOSUtils; + +import com.google.auto.service.AutoService; +import lombok.extern.slf4j.Slf4j; + +import java.io.IOException; +import java.text.MessageFormat; +import java.util.Properties; + +@Slf4j +@AutoService(Script.class) +public class HMasterScript extends AbstractServerScript { + + @Override + public ShellResult add(Params params) { + Properties properties = new Properties(); + properties.setProperty(PROPERTY_KEY_SKIP_LEVELS, "1"); + + return super.add(params, properties); + } + + @Override + public ShellResult configure(Params params) { + return HBaseSetup.configure(params); + } + + @Override + public ShellResult start(Params params) { + configure(params); + HBaseParams hbaseParams = (HBaseParams) params; + + String cmd = MessageFormat.format( + "{0}/bin/hbase-daemon.sh --config {1} start master", hbaseParams.serviceHome(), hbaseParams.confDir()); + try { + return LinuxOSUtils.sudoExecCmd(cmd, hbaseParams.user()); + } catch (IOException e) { + throw new StackException(e); + } + } + + @Override + public ShellResult stop(Params params) { + HBaseParams hbaseParams = (HBaseParams) params; + String cmd = MessageFormat.format( + "{0}/bin/hbase-daemon.sh --config {1} stop master", hbaseParams.serviceHome(), hbaseParams.confDir()); + try { + return LinuxOSUtils.sudoExecCmd(cmd, hbaseParams.user()); + } catch (IOException e) { + throw new StackException(e); + } + } + + @Override + public ShellResult status(Params params) { + HBaseParams hbaseParams = (HBaseParams) params; + return LinuxOSUtils.checkProcess(hbaseParams.getHbaseMasterPidFile()); + } + + @Override + public String getComponentName() { + return "hbase_master"; + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScript.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScript.java new file mode 100644 index 00000000..c8e5e918 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScript.java @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.apache.bigtop.manager.common.shell.ShellResult; +import org.apache.bigtop.manager.stack.core.exception.StackException; +import org.apache.bigtop.manager.stack.core.spi.param.Params; +import org.apache.bigtop.manager.stack.core.spi.script.AbstractServerScript; +import org.apache.bigtop.manager.stack.core.spi.script.Script; +import org.apache.bigtop.manager.stack.core.utils.linux.LinuxOSUtils; + +import com.google.auto.service.AutoService; +import lombok.extern.slf4j.Slf4j; + +import java.io.IOException; +import java.text.MessageFormat; +import java.util.Properties; + +@Slf4j +@AutoService(Script.class) +public class HRegionServerScript extends AbstractServerScript { + + @Override + public ShellResult add(Params params) { + Properties properties = new Properties(); + properties.setProperty(PROPERTY_KEY_SKIP_LEVELS, "1"); + + return super.add(params, properties); + } + + @Override + public ShellResult configure(Params params) { + return HBaseSetup.configure(params); + } + + @Override + public ShellResult start(Params params) { + configure(params); + HBaseParams hbaseParams = (HBaseParams) params; + + String cmd = MessageFormat.format( + "{0}/bin/hbase-daemon.sh --config {1} start regionserver", + hbaseParams.serviceHome(), hbaseParams.confDir()); + try { + return LinuxOSUtils.sudoExecCmd(cmd, hbaseParams.user()); + } catch (IOException e) { + throw new StackException(e); + } + } + + @Override + public ShellResult stop(Params params) { + HBaseParams hbaseParams = (HBaseParams) params; + String cmd = MessageFormat.format( + "{0}/bin/hbase-daemon.sh --config {1} stop regionserver", + hbaseParams.serviceHome(), hbaseParams.confDir()); + try { + return LinuxOSUtils.sudoExecCmd(cmd, hbaseParams.user()); + } catch (IOException e) { + throw new StackException(e); + } + } + + @Override + public ShellResult status(Params params) { + HBaseParams hbaseParams = (HBaseParams) params; + return LinuxOSUtils.checkProcess(hbaseParams.getHbaseRegionServerPidFile()); + } + + @Override + public String getComponentName() { + return "hbase_regionserver"; + } +} From 0fd7b6d93d8f9b48c4c971362a00d3b06220af88 Mon Sep 17 00:00:00 2001 From: Zhiguo Wu Date: Fri, 13 Dec 2024 14:56:09 +0800 Subject: [PATCH 2/2] typo --- .../bigtop/3.3.0/services/hbase/configuration/hbase-site.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml index 70afdfbd..6914ccc4 100644 --- a/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml +++ b/bigtop-manager-server/src/main/resources/stacks/bigtop/3.3.0/services/hbase/configuration/hbase-site.xml @@ -123,7 +123,7 @@ hbase.hregion.memstore.flush.size 134217728 - The size of an individual memstore. Each column familiy within each region is allocated its own memstore. + The size of an individual memstore. Each column family within each region is allocated its own memstore. Memstore Flush Size