Redis Docker and Raspberry Pi
1 Build and Install on Container Server
Download the latest source
> git clone https://github.com/antirez/redis.git
> cd redis/
Build
> make
Install
>make PREFIX=/home/carl/tool/redis-2016-08-26 install
If not the latest, let install with one stable version
> wget http://download.redis.io/releases/redis-3.2.3.tar.gz
Unzip and Build and Install
> cd redis-3.2.3/
> make
> make PREFIX=/home/carl/tool/redis-3.2.3 install
Link the file to my tool directory, add to PATH
PATH="/opt/redis/bin:$PATH"
Check version
> redis-cli --version
redis-cli 3.2.3
2 Docker the Application and AUTH Config
conf/redis.conf Configuration file
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#bind 127.0.0.1
bind 0.0.0.0
requirepass PASSWORD
Docker file show us the installation in details.
FROM resin/rpi-raspbian:jessie
MAINTAINER Carl Luo <luohuazju@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
RUN echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi\n\
deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi\n\
" > /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get install -y apt-utils
RUN apt-get -y dist-upgrade
RUN apt-get install -y build-essential gcc make
#install the software
ADD install/redis-3.2.3.tar.gz /install/
WORKDIR /install/redis-3.2.3
RUN make
RUN make PREFIX=/tool/redis-3.2.3 install
#configure the server
ADD conf/redis.conf /etc/
#start the application
EXPOSE 6379
RUN mkdir -p /app/
ADD start.sh /app/
WORKDIR /app/
CMD [ "./start.sh" ]
The Makefile is as follow:
IMAGE=sillycat/public
TAG=raspberrypi-redis
NAME=raspberrypi-redis
prepare:
wget http://download.redis.io/releases/redis-3.2.3.tar.gz -P install/
docker-context:
build: docker-context
docker build -t $(IMAGE):$(TAG) .
run:
docker run -d -p 6379:6379 --name $(NAME) $(IMAGE):$(TAG)
debug:
docker run -ti -p 6379:6379 --name $(NAME) $(IMAGE):$(TAG) /bin/bash
clean:
docker stop ${NAME}
docker rm ${NAME}
logs:
docker logs ${NAME}
publish:
docker push ${IMAGE}:${TAG}
fetch:
docker pull ${IMAGE}:${TAG}
Command to start at the side door per job level.
> #!/bin/sh -ex
#start the service
cd /tool/redis-3.2.3/bin
./redis-server /etc/redis.conf
Command to connect from command line.
Verify the installation
> redis-cli -h localhost -p 6379 -a kaishi117A ping
PONG
References:
http://sillycat.iteye.com/blog/2320436
http://andreas-kongelstad.tumblr.com/post/51622770030/part-2-installing-redis-on-raspberry-pi
http://redis.io/topics/cluster-tutorial
https://github.com/antirez/redis
Old Blog
http://sillycat.iteye.com/blog/1549504
http://sillycat.iteye.com/blog/1553507 Data type example
http://sillycat.iteye.com/blog/1553508 Data type example
http://sillycat.iteye.com/blog/1553509 Java example in projects
http://sillycat.iteye.com/blog/2028180 sentinel
http://sillycat.iteye.com/blog/2059166 redis cluster
http://sillycat.iteye.com/blog/2219342 monitor and data type example
分享到:
相关推荐
docker redis镜像 用于在docker中导入redis的镜像 执行docker load -i redis.tar 即可完成导入操作
redis docker离线镜像,内网环境不能在线下载,只能离线安装
mysql 以及redis docker yml 文件
redis.conf,redis-6.0.6.tar版本,用于redis在docker运行的配置
bitnami-docker-redis:Bitnami Redis Docker映像
Redis 开发环境集群安装,基于Linux,要先安装docker。
arm32架构docker redis镜像。~~~~~~~~~~~~~~~~~~~~~~~~~
docker、docker-compose 一键安装redis集群 (一台虚拟机上安装的伪集群,学习使用,可以修改文件配置相关参数,非原创,亲测可用) 第一步 /usr/local/下依次建docker、redis目录“/usr/local/docker/redis” 第二步 ...
1.先运行 createFile.py 输入宿主机IP地址,输入redis密码 2.按照控制台输出执行docker-compose up -d 启动命令 3.启动成功后执行加入集群命令即可
docker-redis Redis Docker 容器
docker-compose 形式部署 redis 1主2从3哨兵 redis 多节点高可用 redis 主从哨兵 redis 集群高可用 redis 哨兵 redis 高可用
自定义的 redis.conf 文件用于调试docker下的redis 3.2 版本,并将端口绑定注销
如果您需要部署一个Redis集群,Docker可以帮助您更轻松地完成此任务。以下是关于使用Docker部署Redis集群节点的一些资源: - [Redis Docker官方镜像文档](https://hub.docker.com/_/redis):官方文档,包含了Redis ...
文章【redis】docker安装redis 配置文件redis.conf,放入挂载的目录下。
Redis集群Docker化部署文档,1、基础集群构建,2、制作redis节点镜像3、运行redis集群
docker-redis-cluster Redis 集群 Docker 映像。 此图像用于测试环境。 请勿将其用于生产。用法启动集群。 它将启动 6 个 Redis 服务器,监听7000~7005端口和一个主管以确保所有服务器都启动。 在所有服务器启动后,...
在运行Docker+Redis最新版后,运行redis-cli需要的redis.config文件
dcoker-redis Redis Docker容器
django-celery-redis-docker 使用Redis在Docker上测试Django和Celery 如何运行项目? 克隆此存储库。 使用Python 3创建virtualenv。 启用virtualenv。 安装依赖项。 运行迁移。 git clone ...
redis-3.2.8.tar的docker镜像,docker为17.12版本,下载后使用docker加载镜像即可