2009-11-14 09:11:53 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# ZOOKEEPER_QUORUM set in the environment by the caller
|
|
|
|
HBASE_HOME=`ls -d /usr/local/hbase-*`
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# HBase configuration (Zookeeper)
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
cat > $HBASE_HOME/conf/hbase-site.xml <<EOF
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
|
|
|
|
<configuration>
|
|
|
|
<property>
|
|
|
|
<name>hbase.zookeeper.quorum</name>
|
|
|
|
<value>$ZOOKEEPER_QUORUM</value>
|
|
|
|
</property>
|
|
|
|
<property>
|
|
|
|
<name>zookeeper.session.timeout</name>
|
|
|
|
<value>60000</value>
|
|
|
|
</property>
|
|
|
|
<property>
|
|
|
|
<name>hbase.zookeeper.property.dataDir</name>
|
|
|
|
<value>/mnt/hbase/zk</value>
|
|
|
|
</property>
|
|
|
|
<property>
|
|
|
|
<name>hbase.zookeeper.property.maxClientCnxns</name>
|
|
|
|
<value>100</value>
|
|
|
|
</property>
|
|
|
|
</configuration>
|
|
|
|
EOF
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Start services
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# up open file descriptor limits
|
|
|
|
echo "root soft nofile 32768" >> /etc/security/limits.conf
|
|
|
|
echo "root hard nofile 32768" >> /etc/security/limits.conf
|
|
|
|
|
|
|
|
# up epoll limits
|
|
|
|
# ok if this fails, only valid for kernels 2.6.27+
|
2009-11-24 21:25:30 -05:00
|
|
|
sysctl -w fs.epoll.max_user_instance=32768 > /dev/null 2>&1
|
2009-11-14 09:11:53 -05:00
|
|
|
|
|
|
|
mkdir -p /mnt/hbase/logs
|
|
|
|
mkdir -p /mnt/hbase/zk
|
|
|
|
|
|
|
|
[ ! -f /etc/hosts ] && echo "127.0.0.1 localhost" > /etc/hosts
|
|
|
|
|
|
|
|
"$HBASE_HOME"/bin/hbase-daemon.sh start zookeeper
|