1.zookeeper启动报错
错误日志
启动zookeeper报错信息如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
解决方法
此问题产生的主要原因是因为zookeeper集群未关闭防火墙。
执行下面命令后仍然报上面的错误:
systemctl start iptables.service
经过仔细查找后发现,CentOS 7.0默认使用的是firewall作为防火墙,需要执行如下命令关闭防火墙:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
关闭各个节点防火墙后,重启zookeeper进程,就可以解决上述问题了。
2.RegionServer进程挂掉
错误日志
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
解决方法
/etc/security/limits.conf
/etc/security/limits.d/90-nproc.conf
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
3.增加thrift server的线程数
日志信息
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
解决方法
增加thriftServer线程数
hbase-daemon.sh start thrift --threadpool -m 200 -w 500
在hbase_home目录下的logs目录中可以看到启动日志信息如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
4. zookeeper使用内存大的问题
日志信息
jps 查看 QuorumPeerMain 进程IP
jmap -heap PID 查看进程使用内存情况,具体情况如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
解决方法
方法一:
Heap Configuration配置中我们可以看到,配置的heap内存很大,现在我们修改zkServer.sh脚本减小MaxHeapSize,具体步骤如下:
* 打开zookeeper安装目录下bin文件夹中的zkServer.sh
* 在 zkServer.sh文件的49行处加入 JVMPARAM="-Xms1000M -Xmx1000M -Xmn512M"
* 然后修改zkServer.sh 109~110行出的内容。
修改前如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
修改后如下(将在49上添加的JVMPARAM参数项添加在JVMFLAGS后面):
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
方法二:
打开 zookeeper/bin/zkEnv.sh 文件,在zkEvn.sh中49~52行处有如下内容:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
该文件已经明确说明有独立JVM内存的设置文件,路径是zookeeper/conf/java.env
安装的时候这个路径下没有有java.env文件,需要自己新建一个:
* vim java.env
* java.env文件内容如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
5. habase启动错误及解决方案汇总
错误类型1:
错误内容如下: [Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
解决办法:
每个机器都系统时间首先相同,版本一致。再有就是hbase-default.xml 这个文件把所有节点都配进去。
错误类型2:
在XP eclipse中 做J2ee程序连接到 远程 Hbase 。出现异常:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
解决方法:
1、 配置hosts
由于Hbase是通过hostname解析IP地址的(DNS),Zookeeper只会返回Hbase的域名,需要客户端通过DNS或本地hosts文件进行解析。
若为Linux,在/etc/hosts文件中添加Hbase Master节点的域名及IP地址映射
若为Windows,修改C:\Windows\system32\etc\hosts文件,添加Hbase Master节点的域名及IP地址映射。
2、做完这部继续运行
还有错误,看控制台信息,报:protobuf-java-2.4.0a.jar 该包未找到。去hbase server上将该包下载下来,加入 classpath ,运行,Debug中还有上述异常,但在最后可以查询出hbase中的值。
3、将Log4J配置文件改为 INFO级别。继续运行。异常信息没有。
4、将 protobuf-java.jar 删除,继续运行该项目,也不抱异常了。查询一切正常。
错误类型3:
把代码拷贝到Hadoop的lib下面,然后在命令行中运行,遇到的一个问题如下:
[XML] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
1. 关闭IP6 , 修改/etc/hosts 注视以"::1 "开头的
2. 校准HBase集群Zookeeper集群机器的时间,误差30秒以内
重启机器.ok
错误日志
启动zookeeper报错信息如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
解决方法
此问题产生的主要原因是因为zookeeper集群未关闭防火墙。
执行下面命令后仍然报上面的错误:
systemctl start iptables.service
经过仔细查找后发现,CentOS 7.0默认使用的是firewall作为防火墙,需要执行如下命令关闭防火墙:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
关闭各个节点防火墙后,重启zookeeper进程,就可以解决上述问题了。
2.RegionServer进程挂掉
错误日志
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
解决方法
/etc/security/limits.conf
/etc/security/limits.d/90-nproc.conf
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
3.增加thrift server的线程数
日志信息
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
解决方法
增加thriftServer线程数
hbase-daemon.sh start thrift --threadpool -m 200 -w 500
在hbase_home目录下的logs目录中可以看到启动日志信息如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
4. zookeeper使用内存大的问题
日志信息
jps 查看 QuorumPeerMain 进程IP
jmap -heap PID 查看进程使用内存情况,具体情况如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
解决方法
方法一:
Heap Configuration配置中我们可以看到,配置的heap内存很大,现在我们修改zkServer.sh脚本减小MaxHeapSize,具体步骤如下:
* 打开zookeeper安装目录下bin文件夹中的zkServer.sh
* 在 zkServer.sh文件的49行处加入 JVMPARAM="-Xms1000M -Xmx1000M -Xmn512M"
* 然后修改zkServer.sh 109~110行出的内容。
修改前如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
修改后如下(将在49上添加的JVMPARAM参数项添加在JVMFLAGS后面):
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
- 重启zookeeper进程
- jmap -heap PID 查看修改后进程使用内存情况:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
方法二:
打开 zookeeper/bin/zkEnv.sh 文件,在zkEvn.sh中49~52行处有如下内容:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
该文件已经明确说明有独立JVM内存的设置文件,路径是zookeeper/conf/java.env
安装的时候这个路径下没有有java.env文件,需要自己新建一个:
* vim java.env
* java.env文件内容如下:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
- 重启zookeeper进程
- jmap -heap PID 查看修改后进程使用内存情况:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
5. habase启动错误及解决方案汇总
错误类型1:
错误内容如下: [Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
解决办法:
每个机器都系统时间首先相同,版本一致。再有就是hbase-default.xml 这个文件把所有节点都配进去。
错误类型2:
在XP eclipse中 做J2ee程序连接到 远程 Hbase 。出现异常:
[Bash shell] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
解决方法:
1、 配置hosts
由于Hbase是通过hostname解析IP地址的(DNS),Zookeeper只会返回Hbase的域名,需要客户端通过DNS或本地hosts文件进行解析。
若为Linux,在/etc/hosts文件中添加Hbase Master节点的域名及IP地址映射
若为Windows,修改C:\Windows\system32\etc\hosts文件,添加Hbase Master节点的域名及IP地址映射。
2、做完这部继续运行
还有错误,看控制台信息,报:protobuf-java-2.4.0a.jar 该包未找到。去hbase server上将该包下载下来,加入 classpath ,运行,Debug中还有上述异常,但在最后可以查询出hbase中的值。
3、将Log4J配置文件改为 INFO级别。继续运行。异常信息没有。
4、将 protobuf-java.jar 删除,继续运行该项目,也不抱异常了。查询一切正常。
错误类型3:
把代码拷贝到Hadoop的lib下面,然后在命令行中运行,遇到的一个问题如下:
- 12/09/29 12:29:36 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
- 12/09/29 12:29:36 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181
- 12/09/29 12:29:36 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
- 12/09/29 12:29:36 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 6479@fansyPC
- 12/09/29 12:29:36 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
- java.net.ConnectException: 拒绝连接
- at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
- at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692)
- at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:286)
- at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1035)
- 12/09/29 12:29:36 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
配置如下:
[XML] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码
[color=white !important]
[color=white !important]?
解决方案:
要Ubuntu的系统有点不同的,所以改了下:
/etc/security/limits.conf :
要Ubuntu的系统有点不同的,所以改了下:
/etc/security/limits.conf :
添加这两句:
1.hadoop - nofile 32768
2.hadoop soft/hard nproc 32000
/etc/pam.d/common-session:
2.hadoop soft/hard nproc 32000
/etc/pam.d/common-session:
session required pam_limits.so
hbase.zookeeper.quorum
配置不能和slave节点机在一个上面?所以我就又改了这个值 ,全部改为 fansyPC了,同时根据官方文档上面说要用hbase/lib下面的hadoop-core-1.0.2.jar 去代替haoop/下面的hadoop-core-1.0.2.jar这个文件,最后把hbase/lib下面的JAR包都放在了hadoop/lib下面(重复的跳过),然后就Ok了。
错误类型4:
Master上的HMaster服务老是自动死掉, 看错误日志只是提示连接失败Session 0x0 for server null
解决方法:
1. 关闭IP6 , 修改/etc/hosts 注视以"::1 "开头的
2. 校准HBase集群Zookeeper集群机器的时间,误差30秒以内
重启机器.ok