redis 增加ruby环境

This commit is contained in:
yangyu 2019-01-01 22:14:50 +08:00
parent c094ebb79f
commit 1c422052da
8 changed files with 187 additions and 7 deletions

36
hbase/2.1.0/Dockerfile Normal file
View File

@ -0,0 +1,36 @@
FROM ccr.ccs.tencentyun.com/yy-dk/hadoop:2.8.4
MAINTAINER Yang <yangyufans@qq.com>
ENV HIVE_VERSION 2.3.3
ENV HADOOP_VERSION 2.8.4
ENV HIVE_NAME apache-hive-2.3.3-bin
RUN cd / && wget http://mirror.bit.edu.cn/apache/hive/hive-$HIVE_VERSION/$HIVE_NAME.tar.gz \
&& tar -zvxf $HIVE_NAME.tar.gz -C /usr/local/ \
&& rm -rf $HIVE_NAME.tar.gz \
&& mv /usr/local/$HIVE_NAME /usr/local/hive-$HIVE_VERSION
ENV HIVE_HOME "/usr/local/hive-$HIVE_VERSION"
ENV PATH "$PATH:$HIVE_HOME/bin"
RUN echo "export HIVE_HOME=/usr/local/hive-$HIVE_VERSION" >> /etc/profile && \
echo 'export PATH=$PATH:$HIVE_HOME/bin' >> /etc/profile && \
source /etc/profile
RUN cp $HIVE_HOME/conf/hive-env.sh.template $HIVE_HOME/conf/hive-env.sh && \
echo "HADOOP_HOME=$HADOOP_HOME" >> $HIVE_HOME/conf/hive-env.sh && \
echo "HADOOP_VERSION=$HADOOP_VERSION" >> $HIVE_HOME/conf/hive-env.sh && \
cp $HIVE_HOME/conf/hive-log4j2.properties.template $HIVE_HOME/conf/hive-log4j2.properties && \
sed -i 's/${sys:java.io.tmpdir}/\/logs/g' $HIVE_HOME/conf/hive-log4j2.properties && \
sed -i 's/${sys:user.name}/hive/g' $HIVE_HOME/conf/hive-log4j2.properties
COPY conf/* $HIVE_HOME/conf/
COPY start.sh /
RUN chmod 777 /start.sh
EXPOSE 22 8020 8088 8042 9870
CMD ["/start.sh"]

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=/data/metastore_db;create=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
</property>
<property>
<name>hive.metastore.local</name>
<value>true</value>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
</property>
</configuration>

9
hbase/2.1.0/start.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
\cp /conf/hadoop/* $HADOOP_HOME/etc/hadoop
\cp /conf/hive/* $HIVE_HOME/conf
echo "127.0.0.1 localhost" > /etc/hosts
/usr/sbin/sshd -D

68
hbase/README.md Normal file
View File

@ -0,0 +1,68 @@
# hbase docker 服务搭建
## 创建镜像
镜像构建源码请[参考](http://git.yangyufans.com/pub/docker/tree/master/hbase)
## 版本说明
3.0.0-3.1.0对应hive和hadoop相应版本
- 3.0.0 为hive版本
- 3.1.0 为hadoop版本
```bash
docker build -t ccr.ccs.tencentyun.com/yy-dk/hive:3.0.0 .
```
## 从远程拉取镜像
```bash
docker pull ccr.ccs.tencentyun.com/yy-dk/hive:3.0.0
```
## 创建镜像
```bash
docker run -d \
--privileged=true \
-p 12580:22 \
-p 9870:9870 \
-p 50070:50070 \
-p 8020:8020 \
-p 8088:8088 \
-p 8042:8042 \
-v $PWD/conf:/conf \
-v $PWD/data:/data \
-v $PWD/logs:/logs \
--name hive \
ccr.ccs.tencentyun.com/yy-dk/hive:3.0.0
```
> conf:配置文件,若自己修改完配置文件放在本目录,会自动覆盖
> data:数据目录
> logs:日志文件目录
## 进入容器
```bash
ssh -p 12580 root@localhost
```
- 密码123456
## 格式化namenode
```bash
hdfs namenode -format
```
## 启动
```bash
start-all.sh
```
## 初始化元数据
```bash
schematool -dbType derby -initSchema
```
## 启动hive
```bash
hive
```

View File

@ -4,7 +4,26 @@ MAINTAINER Yang <yangyufans@qq.com>
ENV REDIS_VERSION=4.0.10 ENV REDIS_VERSION=4.0.10
RUN yum install -y wget gcc make RUN yum install -y wget gcc make which zlib-devel openssl-devel
RUN cd / && wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0.tar.gz \
&& tar -zvxf ruby-2.6.0.tar.gz \
&& rm -rf ruby-2.6.0.tar.gz \
&& cd /ruby-2.6.0 \
&& ./configure \
&& make && make install
RUN cd /ruby-2.6.0/ext/zlib \
&& ruby extconf.rb \
&& sed -i 's/$(top_srcdir)/..\/..\//' Makefile \
&& make && make install
RUN cd /ruby-2.6.0/ext/openssl \
&& ruby extconf.rb --with-openssl-include=/usr/local/openssl/include/ --with-openssl-lib=/usr/local/openssl/lib \
&& sed -i 's/$(top_srcdir)/..\/..\//' Makefile \
&& make && make install
RUN gem install redis
RUN cd / && wget http://download.redis.io/releases/redis-$REDIS_VERSION.tar.gz \ RUN cd / && wget http://download.redis.io/releases/redis-$REDIS_VERSION.tar.gz \
&& tar -zxvf redis-$REDIS_VERSION.tar.gz \ && tar -zxvf redis-$REDIS_VERSION.tar.gz \
@ -13,8 +32,7 @@ RUN cd / && wget http://download.redis.io/releases/redis-$REDIS_VERSION.tar.gz \
&& make MALLOC=libc \ && make MALLOC=libc \
&& make install \ && make install \
&& cp /redis-$REDIS_VERSION/redis.conf /usr/local/bin/ \ && cp /redis-$REDIS_VERSION/redis.conf /usr/local/bin/ \
&& cd / \ && cd /
&& rm -rf redis-$REDIS_VERSION
RUN mkdir /redis /redis/conf /redis/logs RUN mkdir /redis /redis/conf /redis/logs
@ -29,6 +47,6 @@ COPY start.sh /
RUN chmod 777 /start.sh RUN chmod 777 /start.sh
EXPOSE 6379 EXPOSE 6379 16379
ENTRYPOINT ["/start.sh"] ENTRYPOINT ["/start.sh"]

View File

@ -2,10 +2,11 @@
if [ ! -e /redis/conf/redis.conf ]; then if [ ! -e /redis/conf/redis.conf ]; then
cp /usr/local/bin/redis.conf /redis/conf cp /usr/local/bin/redis.conf /redis/conf
if [ -n "$PASSWORD" ]; then
echo "requirepass $PASSWORD" >> /redis/conf/redis.conf
fi
fi fi
if [ -n "$PASSWORD" ]; then
echo "requirepass $PASSWORD" >> /redis/conf/redis.conf
fi
redis-server /redis/conf/redis.conf redis-server /redis/conf/redis.conf

11
zentao/11/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM ccr.ccs.tencentyun.com/yy-dk/centos-sshd:7.0
MAINTAINER Yang <yangyufans@qq.com>
ENV HADOOP_VERSION hadoop-2.6.0-cdh5.9.3
RUN yum install -y wget which
RUN cd / && wget http://oss.yangyufans.com/jdk/jdk-7u80-linux-x64.tar.gz \
&& tar -zvxf jdk-7u80-linux-x64.tar.gz -C /usr/local \
&& rm -rf jdk-7u80-linux-x64.tar.gz

1
zentao/README.md Normal file
View File

@ -0,0 +1 @@
# 禅道docker