Is it possible to access the Hbase installed inside the docker container, which can be accessed using the java client on Mac OSX?

I created a docker container that has HBase installed offline. I used -net = host mode to start the docker container. I see the UI for master and regionserver, but when I try to connect to HBase from my java program after establishing a connection with zookeeper, it says that this server is on the list of failed servers: boot2docker: 60020. I use mac OSX and boot2docker. Please give this suggestion. Here is my docker file.

FROM centos:6
# Install required libraries.
RUN yum install -y tar
# Install java.
RUN curl -LO \
'http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-x64.rpm'\
-H 'Cookie: oraclelicense=accept-securebackup-cookie'
RUN rpm -i jdk-7u71-linux-x64.rpm
RUN rm -f jdk-7u71-linux-x64.rpm
# Export JAVA_HOME.
ENV JAVA_HOME /usr
# Copy hbase code to docker container.
COPY hbase-*.tar.gz /
RUN tar -xzvf hbase-*.tar.gz
RUN rm hbase-*.tar.gz
RUN mv hbase-* hbase
# Copy hbase-site.xml.
ADD hbase-config-files/hbase-site.xml /hbase/conf/hbase-site.xml
# Start Hbase.
CMD ["./hbase/bin/hbase", "master", "start"]`

To run this container, I used docker run --net = host -t docker_image

+4
source share

Source: https://habr.com/ru/post/1599691/


All Articles