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-7.0.15 docker离线镜像安装包
docker上的redis离线镜像redis.tar, 用于在docker上离线安装redis
redis:7.0.8 docker镜像
redis docker离线镜像,内网环境不能在线下载,只能离线安装
mysql 以及redis docker yml 文件
redis.conf,redis-6.0.6.tar版本,用于redis在docker运行的配置
bitnami-docker-redis:Bitnami Redis Docker映像
arm32架构docker redis镜像。~~~~~~~~~~~~~~~~~~~~~~~~~
【ARM架构】Redis-6.2.6版本 Docker镜像
redis-3.2.8.tar的docker镜像,docker为17.12版本,下载后使用docker加载镜像即可
自己打包的redis镜像,仅仅3.7M,使用 docker load -i redis_5.0.0-image.tar.gz 进行加载,docker run -tid --name redis redis:5.0.0 进行运行。
Redis 开发环境集群安装,基于Linux,要先安装docker。
docker、docker-compose 一键安装redis集群 (一台虚拟机上安装的伪集群,学习使用,可以修改文件配置相关参数,非原创,亲测可用) 第一步 /usr/local/下依次建docker、redis目录“/usr/local/docker/redis” 第二步 ...
在这个场景中,我们有一个针对 Redis 3.2 版本的自定义配置文件 `redis.conf`,该文件是为在 Docker 环境下调试 Redis 实例而设计的。下面将详细解释配置文件中的关键设置和它们在 Docker 容器中的作用。 1. **端口...
redis-6.2.16 arm版本 docker镜像文件
1.先运行 createFile.py 输入宿主机IP地址,输入redis密码 2.按照控制台输出执行docker-compose up -d 启动命令 3.启动成功后执行加入集群命令即可
这里我们将详细探讨如何利用Docker Compose部署Redis的主从哨兵配置和集群高可用性解决方案。 首先,Docker Compose是一个强大的工具,可以让我们通过YAML文件定义和运行多容器的Docker应用。在这个场景下,我们...
docker-redis Redis Docker 容器
docker离线安装redis镜像