首页 > 其他分享 >hbase安装与配置信息

hbase安装与配置信息

时间:2024-10-07 20:23:01浏览次数:7  
标签:配置 hadoop XX export hbase 安装 HBASE OPTS

Hadoop的core-site.xml文件

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 3 
 4 
 5 
 6 <configuration>
 7 <!-- 设置默认使用的文件系统 Hadoop支持file、HDFS、GFS、ali|Amazon云等文件系统 -->
 8 <property>   控制hadoop与hbase的端口号相同
 9     <name>fs.defaultFS</name>
10     <value>hdfs://node1:9000</value>
11 </property>
12 
13 <!-- 设置Hadoop本地保存数据路径 -->
14 <property>
15     <name>hadoop.tmp.dir</name>
16     <value>/export/data/hadoop-3.3.0</value>
17 </property>
18 
19 <!-- 设置HDFS web UI用户身份 -->
20 <property>
21     <name>hadoop.http.staticuser.user</name>
22     <value>root</value>
23 </property>
24 
25 <!-- 整合hive 用户代理设置 -->
26 <property>
27     <name>hadoop.proxyuser.root.hosts</name>
28     <value>*</value>
29 </property>
30 
31 <property>
32     <name>hadoop.proxyuser.root.groups</name>
33     <value>*</value>
34 </property>
35 <property>
36      <name>hadoop.proxyuser.root.hosts</name>
37      <value>*</value>
38 </property>
39 <property>
40      <name>hadoop.proxyuser.root.groups</name>
41      <value>*</value>
42 </property>
43 <!-- 文件系统垃圾桶保存时间 单位:分 -->
44 <property>
45     <name>fs.trash.interval</name>
46     <value>1440</value>
47 </property>
48 </configuration>

hbase的hbase-site.xml

 1 <?xml version="1.0"?>
 2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 3 <configuration>
设置 HBase 的集群模式为单机模式(false 表示伪分布式运行,适合测试环境)。 4 <property> 5 <name>hbase.cluster.distributed</name> 6 <value>false</value> 7 </property> 8 <property> 9 <name>hbase.tmp.dir</name> 10 <value>./tmp</value> 11 </property>
//取消安全模式 12 <property> 13 <name>hbase.unsafe.stream.capability.enforce</name> 14 <value>false</value> 15 </property> 16
//控制hbase的端口号(与hadoop相同) 17 <property> 18 <name>hbase.rootdir</name> 19 <value>hdfs://node1:9000/hbase</value> 20 </property>

设置 HBase 运行在分布式模式下(true 表示分布式集群运行,适合生产环境) 21 <property> 22 <name>hbase.cluster.distributed</name> 23 <value>true</value> 24 </property>
//指明zookeeper的端口号
25 <property> 26 <name>hbase.zookeeper.property.clientPort</name> 27 <value>2181</value> 28 </property> 29 30 </configuration>

hbase的hbase-env.sh

//jdk版本位置 
1 export JAVA_HOME=/export/server/jdk1.8.0_241
//设置 HBase 的类路径,使其包含 Hadoop 配置文件的路径 /usr/local/hadoop/conf,以便 HBase 在分布式模式下能够找到 Hadoop 的相关配置。 2 export HBASE_CLASSPATH=/usr/local/hadoop/conf
//设置hbase使用自身带的zookeeper 3 export HBASE_MANAGES_ZK=true
//设置hbase不使用hadoop的依赖和类库 4 export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP=true 5 6 7 8 9 10 11 12 #!/usr/bin/env bash 13 # 14 #/** 15 # * Licensed to the Apache Software Foundation (ASF) under one 16 # * or more contributor license agreements. See the NOTICE file 17 # * distributed with this work for additional information 18 # * regarding copyright ownership. The ASF licenses this file 19 # * to you under the Apache License, Version 2.0 (the 20 # * "License"); you may not use this file except in compliance 21 # * with the License. You may obtain a copy of the License at 22 # * 23 # * http://www.apache.org/licenses/LICENSE-2.0 24 # * 25 # * Unless required by applicable law or agreed to in writing, software 26 # * distributed under the License is distributed on an "AS IS" BASIS, 27 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 28 # * See the License for the specific language governing permissions and 29 # * limitations under the License. 30 # */ 31 32 # Set environment variables here. 33 34 # This script sets variables multiple times over the course of starting an hbase process, 35 # so try to keep things idempotent unless you want to take an even deeper look 36 # into the startup scripts (bin/hbase, etc.) 37 38 # The java implementation to use. Java 1.8+ required. 39 # export JAVA_HOME=/usr/java/jdk1.8.0/ 40 41 # Extra Java CLASSPATH elements. Optional. 42 # export HBASE_CLASSPATH= 43 44 # The maximum amount of heap to use. Default is left to JVM default. 45 # export HBASE_HEAPSIZE=1G 46 47 # Uncomment below if you intend to use off heap cache. For example, to allocate 8G of 48 # offheap, set the value to "8G". 49 # export HBASE_OFFHEAPSIZE=1G 50 51 # Extra Java runtime options. 52 # Default settings are applied according to the detected JVM version. Override these default 53 # settings by specifying a value here. For more details on possible settings, 54 # see http://hbase.apache.org/book.html#_jvm_tuning 55 # export HBASE_OPTS 56 57 # Uncomment one of the below three options to enable java garbage collection logging for the server-side processes. 58 59 # This enables basic gc logging to the .out file. 60 # export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" 61 62 # This enables basic gc logging to its own file. 63 # If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . 64 # export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH>" 65 66 # This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+. 67 # If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . 68 # export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M" 69 70 # Uncomment one of the below three options to enable java garbage collection logging for the client processes. 71 72 # This enables basic gc logging to the .out file. 73 # export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" 74 75 # This enables basic gc logging to its own file. 76 # If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . 77 # export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH>" 78 79 # This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+. 80 # If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR . 81 # export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M" 82 83 # See the package documentation for org.apache.hadoop.hbase.io.hfile for other configurations 84 # needed setting up off-heap block caching. 85 86 # Uncomment and adjust to enable JMX exporting 87 # See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access. 88 # More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html 89 # NOTE: HBase provides an alternative JMX implementation to fix the random ports issue, please see JMX 90 # section in HBase Reference Guide for instructions. 91 92 # export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" 93 # export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10101" 94 # export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10102" 95 # export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103" 96 # export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104" 97 # export HBASE_REST_OPTS="$HBASE_REST_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10105" 98 99 # File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default. 100 # export HBASE_REGIONSERVERS=${HBASE_HOME}/conf/regionservers 101 102 # Uncomment and adjust to keep all the Region Server pages mapped to be memory resident 103 #HBASE_REGIONSERVER_MLOCK=true 104 #HBASE_REGIONSERVER_UID="hbase" 105 106 # File naming hosts on which backup HMaster will run. $HBASE_HOME/conf/backup-masters by default. 107 # export HBASE_BACKUP_MASTERS=${HBASE_HOME}/conf/backup-masters 108 109 # Extra ssh options. Empty by default. 110 # export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR" 111 112 # Where log files are stored. $HBASE_HOME/logs by default. 113 # export HBASE_LOG_DIR=${HBASE_HOME}/logs 114 115 # Enable remote JDWP debugging of major HBase processes. Meant for Core Developers 116 # export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8070" 117 # export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8071" 118 # export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8072" 119 # export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8073" 120 # export HBASE_REST_OPTS="$HBASE_REST_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8074" 121 122 # A string representing this instance of hbase. $USER by default. 123 # export HBASE_IDENT_STRING=$USER 124 125 # The scheduling priority for daemon processes. See 'man nice'. 126 # export HBASE_NICENESS=10 127 128 # The directory where pid files are stored. /tmp by default. 129 # export HBASE_PID_DIR=/var/hadoop/pids 130 131 # Seconds to sleep between slave commands. Unset by default. This 132 # can be useful in large clusters, where, e.g., slave rsyncs can 133 # otherwise arrive faster than the master can service them. 134 # export HBASE_SLAVE_SLEEP=0.1 135 136 # Tell HBase whether it should manage it's own instance of ZooKeeper or not. 137 # export HBASE_MANAGES_ZK=true 138 139 # The default log rolling policy is RFA, where the log file is rolled as per the size defined for the 140 # RFA appender. Please refer to the log4j.properties file to see more details on this appender. 141 # In case one needs to do log rolling on a date change, one should set the environment property 142 # HBASE_ROOT_LOGGER to "<DESIRED_LOG LEVEL>,DRFA". 143 # For example: 144 # HBASE_ROOT_LOGGER=INFO,DRFA 145 # The reason for changing default to RFA is to avoid the boundary case of filling out disk space as 146 # DRFA doesn't put any cap on the log size. Please refer to HBase-5655 for more context. 147 148 # Tell HBase whether it should include Hadoop's lib when start up, 149 # the default value is false,means that includes Hadoop's lib. 150 # export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP="true" 151 152 # Override text processing tools for use by these launch scripts. 153 # export GREP="${GREP-grep}" 154 # export SED="${SED-sed}"

常用指令总结

①开始hadoop    start-all.sh

 结束     stop-all.sh

②开始hbase   cd /usr/local/hbase   //切换到hbase对应目录

      bin/start-hbase.sh

    结束  bin/stop-hbase.sh

③查看端口     jps

④结束某个端口     kill -s 9 端口号

⑤进入hbase数据库   cd /usr/local/hbase

          hbase shell

⑥退出hbase   shift+z

⑦退出某个insert界面  (shift+z)×2

 

附上学习教程

Hadoop之Hbase安装和配置_hadoop之hbase的安装与配置-CSDN博客

标签:配置,hadoop,XX,export,hbase,安装,HBASE,OPTS
From: https://www.cnblogs.com/lian369/p/18450563

相关文章

  • Photoshop2024下载安装包(附安装教程)
    Photoshop2024安装包:Photoshop2024安装包百度网盘下载PS2024安装教程:1、右击【PS2024.zip】,选择【解压到PS2024】2、右击【Set-up.exe】,选择【以管理员身份运行】3、点击右下角灰色的小文件夹图标,选择【更改位置】4、选择安装路径后,点击【确定】,然后点击【继......
  • 在浏览器上访问媒体资源配置【文件上传】
    1.根urls.py文件中fromdjango.contribimportadminfromdjango.urlsimportpath,include,re_pathfromdjango.views.staticimportservefromdjango.confimportsettingsurlpatterns=[#path('admin/',admin.site.urls),path('api/shipp......
  • Centos linux6 中/etc/rc.d/rc.sysinit配置文件的作用
    系统初始化脚本功能设置主机名设置欢迎信息激活udev和selinux挂载/etc/fstab文件中定义的文件系统检测根文件系统,并以读写方式重新挂载根文件系统设置系统时钟激活swap设备根据/etc/sysctl.conf文件设置内核参数激活lvm及softwareraid设备加载额外设备的驱动程序清理操作......
  • php网站怎么连接数据库配置文件
    在PHP网站中连接数据库通常需要一个配置文件来存储数据库连接信息。以下是创建和使用数据库配置文件的详细步骤:1.创建数据库配置文件创建配置文件:在项目的根目录或适当的位置创建一个配置文件,例如 config.php。编写配置信息:在 config.php 文件中编写数据库连接......
  • php连接数据库mysql配置
    使用PHP连接MySQL数据库通常涉及以下几个步骤:创建配置文件、引入配置文件、创建数据库连接、执行SQL查询以及关闭连接。下面是一个详细的示例:1.创建数据库配置文件(config.php)创建配置文件:在项目的根目录或适当的位置创建一个配置文件,例如 config.php。编写配......
  • 大模型配置学习
    为什么在import里有一个GPT2,然后,在代码里面又有一个frompretrainedgpt2在import部分引入了GPT2Model后,在代码中使用GPT2Model.from_pretrained("gpt2")来加载预训练的模型。这样做的原因是,import只是引入了GPT2Model这个类,它提供了GPT-2的模型定义。而from_pretrai......
  • 网站连接数据库配置文件
    网站连接数据库的配置文件通常包含数据库连接所需的各项参数。这些参数包括数据库类型、主机地址、端口号、数据库名称、用户名和密码等。下面是一些常见的数据库配置文件示例:MySQL配置文件示例假设你使用的是PHP语言,以下是一个典型的MySQL数据库配置文件(db_config.php)......
  • 织梦CMS数据库连接配置指南
    织梦CMS(DedeCMS)的数据库连接配置是确保系统正常运行的重要步骤。以下是详细的配置指南,帮助你正确配置织梦CMS的数据库连接。步骤1:备份现有配置文件在修改任何配置文件之前,最好先备份现有的配置文件,以防万一。备份配置文件复制织梦CMS安装目录下的 include/config.inc.ph......
  • [亲测]君临九州+单机安装教程+无需虚拟机+GM后台
    今天给大家带来一款单机游戏的架设:君临九州,版本号:1.0.12.30。另外:本人承接各种游戏架设(单机+联网)本人为了学习和研究软件内含的设计思想和原理,带了架设教程仅供娱乐。教程是本人亲自搭建成功的,绝对是完整可运行的,踩过的坑都给你们填上了。如果你是小白也没问题,跟着教程走也是可......
  • 安装socks5的一次尝试
    1.下载并自动配置socks5sudowgethttps://ap-guangzhou-1257892306.cos.ap-guangzhou.myqcloud.com/asi/httpsocks5.sh&&shhttpsocks5.sh执行下载脚本wget—no-check-certificatehttps://raw.github.com/Lozy/danted/master/install.sh-Oinstall.sh执行安装脚本c......