~ubuntu-branches/ubuntu/precise/hbase/precise

« back to all changes in this revision

Viewing changes to src/contrib/ec2/bin/hbase-ec2-init-zookeeper-remote.sh

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Koch
  • Date: 2010-05-06 14:20:42 UTC
  • Revision ID: james.westby@ubuntu.com-20100506142042-r3hlvgxdcpb8tynl
Tags: upstream-0.20.4+dfsg1
ImportĀ upstreamĀ versionĀ 0.20.4+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
 
 
3
#
 
4
# Copyright 2010 The Apache Software Foundation
 
5
#
 
6
# Licensed to the Apache Software Foundation (ASF) under one
 
7
# or more contributor license agreements.  See the NOTICE file
 
8
# distributed with this work for additional information
 
9
# regarding copyright ownership.  The ASF licenses this file
 
10
# to you under the Apache License, Version 2.0 (the
 
11
# "License"); you may not use this file except in compliance
 
12
# with the License.  You may obtain a copy of the License at
 
13
#
 
14
#     http://www.apache.org/licenses/LICENSE-2.0
 
15
#
 
16
# Unless required by applicable law or agreed to in writing, software
 
17
# distributed under the License is distributed on an "AS IS" BASIS,
 
18
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
19
# See the License for the specific language governing permissions and
 
20
# limitations under the License.
 
21
#
 
22
 
 
23
HBASE_HOME=`ls -d /usr/local/hbase-*`
 
24
 
 
25
# HBase configuration (Zookeeper)
 
26
cat > $HBASE_HOME/conf/hbase-site.xml <<EOF
 
27
<?xml version="1.0"?>
 
28
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 
29
<configuration>
 
30
<property>
 
31
  <name>hbase.zookeeper.quorum</name>
 
32
  <value>$ZOOKEEPER_QUORUM</value>
 
33
</property>
 
34
<property>
 
35
  <name>zookeeper.session.timeout</name>
 
36
  <value>60000</value>
 
37
</property>
 
38
<property>
 
39
  <name>hbase.zookeeper.property.dataDir</name>
 
40
  <value>/mnt/hbase/zk</value>
 
41
</property>
 
42
<property>
 
43
  <name>hbase.zookeeper.property.maxClientCnxns</name>
 
44
  <value>100</value>
 
45
</property>
 
46
</configuration>
 
47
EOF
 
48
 
 
49
# Start services
 
50
 
 
51
# up open file descriptor limits
 
52
echo "root soft nofile 32768" >> /etc/security/limits.conf
 
53
echo "root hard nofile 32768" >> /etc/security/limits.conf
 
54
 
 
55
# up epoll limits
 
56
# ok if this fails, only valid for kernels 2.6.27+
 
57
sysctl -w fs.epoll.max_user_instance=32768 > /dev/null 2>&1
 
58
 
 
59
mkdir -p /mnt/hbase/logs
 
60
mkdir -p /mnt/hbase/zk
 
61
 
 
62
[ ! -f /etc/hosts ] &&  echo "127.0.0.1 localhost" > /etc/hosts
 
63
 
 
64
"$HBASE_HOME"/bin/hbase-daemon.sh start zookeeper