Add hbase installation

This commit is contained in:
2024-01-30 15:01:53 +05:30
parent 2a255e3317
commit 21375eb31f
5 changed files with 56 additions and 4 deletions

View File

@@ -70,5 +70,18 @@ RUN echo "export PIG_HOME=/pig" >> ~/.bashrc
RUN echo "export PATH=\$PATH:/pig/bin" >> ~/.bashrc
RUN echo "export PIG_CLASSPATH=\$HADOOP_HOME/etc/hadoop" >> ~/.bashrc
# Install hbase
RUN wget http://apache.mirror.gtcomm.net/hbase/stable/hbase-2.5.7-bin.tar.gz
RUN tar -xzvf hbase-2.5.7-bin.tar.gz
RUN mv hbase-2.5.7 /usr/local/hbase
RUN echo "export HBASE_HOME=/usr/local/hbase" >> ~/.bashrc
RUN echo "export PATH=\$PATH:\$HBASE_HOME/bin" >> ~/.bashrc
RUN echo "export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP=\"true\"" >> /usr/local/hbase/conf/hbase-env.sh
RUN echo "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/" >> /usr/local/hbase/conf/hbase-env.sh
COPY hbase-site.xml ~/hbase-site.xml
RUN mkdir -p /hadoop/zookeeper
RUN chown -R $USER:$USER /hadoop/
# Expose necessary ports
EXPOSE 9870 8088 9000

View File

@@ -1,12 +1,19 @@
# Hadoop on Docker
Use this to get a quick version of Hadoop to run on Docker.
1. Install Docker
1. Install Docker on your host PC
<br>
2. Clone this repository
2. Clone your platform specific branch of this repository
```bash
git clone https://github.com/silicoflare/docker-hadoop
# Windows
git clone -b windows --single-branch https://github.com/silicoflare/docker-hadoop
# Mac
git clone -b mac --single-branch https://github.com/silicoflare/docker-hadoop
# Linux
git clone -b linux --single-branch https://github.com/silicoflare/docker-hadoop
```
<br>
@@ -27,7 +34,7 @@ docker build -t hadoop .
6. Create a new container using the newly created image
```bash
docker run -it -p 9870:3000 --name anyname hadoop bash
docker run -it -p 9870:9870 --name anyname hadoop bash
```
<br>

28
hbase-site.xml Normal file
View File

@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>./tmp</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/hadoop/zookeeper</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>

2
init
View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
service ssh restart
stop-hbase.sh
stop-all.sh
hdfs namenode -format
start-all.sh
start-hbase.sh
jps

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env bash
service ssh restart
stop-hbase.sh
stop-all.sh
start-all.sh
start-hbase.sh
jps