|
楼主 |
发表于 2013-11-16 20:51:11
|
显示全部楼层
本帖最后由 luzhuomi 于 2013-11-21 14:07 编辑
2013/11/21 更新:以下配置应该能是cb1稳定续航。
以下是我安装HBase 的脚本。java 用的是 oracle 的 jdk1.8.0 for armhf
# 注 192.168.1.105 是我入手的cb2
MASTER="192.168.1.8"
# space 分隔
SLAVES="192.168.1.11 192.168.1.214 192.168.1.105"
wget http://mirror.nus.edu.sg/apache/hbase/stable/hbase-0.94.7.tar.gz
tar zxvf hbase-0.94.7.tar.gz
sudo mv hbase-0.94.7 /opt/hbase-0.94.7
cp /opt/hbase-0.94.7/conf/hbase-env.sh /opt/hbase-0.94.7/conf/hbase-env.sh.orig
sed -i "s/# export JAVA_HOME=.*/export\ JAVA_HOME=\/opt\/jdk.1.8.0/g" /opt/hbase-0.94.7/conf/hbase-env.sh
sed -i "s/# export HBASE_CLASSPATH=.*/export\ HBASE_CLASSPATH=\/opt\/hbase-
0.94.7\/hbase-0\.94\.7\.jar/g" /opt/hbase-0.94.7/conf/hbase-env.sh
sudo mkdir -p /mnt/zookeeper
sudo chown -R linaro:linaro /mnt/zookeeper
cp /opt/hbase-0.94.7/conf/hbase-site.xml /opt/hbase-0.94.7/conf/hbase-site.xml.orig
echo -e "<?xml version=\"1.0\"?>
<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://${MASTER}:9000/hbase</value>
<description>The directory shared by RegionServers.
</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
<description>The mode the cluster will be in. Possible values are
false: standalone and pseudo-distributed setups with managed Zookeeper
true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
</description>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
<description>Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/mnt/zookeeper</value>
<description>Property from ZooKeeper's config zoo.cfg.
The directory where the snapshot is stored.
</description>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>192.168.1.8,192.168.1.11,192.168.1.214,192.168.1.105</value>
</property>
<property>
<name>hbase.hregion.majorcompaction</name>
<value>0</value>
</property>
<property>
<name>hbase.hregion.max.filesize</name>
<value>107374182400</value>
</property>
<property>
<name>zookeeper.session.timeout</name>
<value>1800000</value>
</property>
</configuration>
" > /opt/hbase-0.94.7/conf/hbase-site.xml
cp /opt/hbase-0.94.7/conf/regionservers /opt/hbase-0.94.7/conf/regionservers.orig
cat /dev/null > /opt/hbase-0.94.7/conf/regionservers
for ip in ${SLAVES};do echo -e "${ip}" >> /opt/hbase-0.94.7/conf/regionservers ; done
echo "export HADOOP_CLASSPATH=\${HADOOP_CLASSPATH}:/opt/hbase-0.94.7/hbase-0.94.7.jar:/opt/hbase-0.94.7/lib/zookeeper-3.4.5.jar:/opt/hbase-0.94.7/lib/protobuf-java-2.4.0a.jar:/opt/hbase-0.94.7/lib/guava-11.0.2.jar" >> /opt/hadoop-1.1.2/conf/hadoop-env.sh
#注 各cb的时钟必须同步,要不然regionserver 会启动失败。
#注2: 各cb必须有至少1G swap
sudo dd if=/dev/zero of=/mnt/swapfile bs=1m count=1024
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
cb2的过热死机还会出现。但应该是别的问题。
|
|