Tag: redis

Docker撰写:无法连接到Redis

我在这里https://docs.docker.com/get-started/part5/#recap-optional下面的Docker Compose教程 version: "3" services: web: image: example/get-started:part-1 deploy: replicas: 10 resources: limits: cpus: "0.1" memory: 50M restart_policy: condition: on-failure ports: – "80:80" networks: – webnet visualizer: image: dockersamples/visualizer:stable ports: – "8080:8080" volumes: – "/var/run/docker.sock:/var/run/docker.sock" deploy: placement: constraints: [node.role == manager] networks: – webnet redis: image: redis ports: – "6379:6379" volumes: – ./data:/data deploy: placement: […]

Spring Boot和Redis容器之间的通信

我使用基于Spring Boot框架的REST API实现了简单的独立Web应用程序。 我的应用程序使用Redis来caching一些数据。 现在我想dockerize webapp和Rediscaching提供简单的运行程序,而不会在工作环境中强制Redis安装。 我尝试了很多方法,但我仍然努力与RedisConnectionFailureException: Cannot get Jedis connection和根本原因ConnectException: Connection refused 。 pom.xml中: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.6.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>1.3.5</version> <configuration> <repository>${project.artifactId}</repository> </configuration> </plugin> </plugins> </build> 泊坞窗,compose.yml: version: '3' services: web: build: . ports: – […]

Redis的python不能在Docker中创build本地服务器

所以我有这样的设置,在一个Docker容器中,我需要运行一个Python库testing套件(为我公司devise),在我的Redis Connectortesting套件中,创build一个locaclhost:6379 redis服务器被拒绝。 redis.exceptions.ConnectionError:错误111连接到本地主机:6379。 拒绝连接。 test_redis.py在具有nose的开放环境中传递,但在持续集成(在Docker中)失败。 Docker是否阻塞所有的localhost服务,或者我使用了错误的方法? build立 Ubuntu 17.04 Docker版本1.12.6,build 78d1802 Dockerfile: FROM continuumio/miniconda3:4.3.14 MAINTAINER … <…@fifty-five.com> WORKDIR /app RUN which conda && which python && which pip && apt update && apt install -y build-essential libblas-dev liblapack-dev libatlas-base-dev gfortran RUN conda install -y numpy && conda install -y scikit-learn && conda install -y […]

如何debuggingREDIS,APACHE发出一个Docker容器?

这是场景: 该容器来自使用以下Dockerfile创build的映像: FROM php:5-apache RUN apachectl -M RUN a2enmod rewrite RUN a2enmod expires RUN service apache2 restart RUN apachectl -M RUN php -m RUN apt-get update RUN php -m RUN apt-get install -y php5-redis RUN apt-get install -y redis-server #RUN redis-server RUN cp /etc/php5/mods-available/redis.ini /usr/local/etc/php/conf.d && ln -s /usr/lib/php5/20131226/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/redis.so RUN php -m COPY src/ […]

无法从Docker容器内连接到Redis(Redis :: CannotConnectError)

我有一个Jenkinspipe道,它为Docker容器内的Sinatra应用程序运行所有testing。 这是Pipeline的样子: #!/usr/bin/env groovy pipeline { agent { docker { image 'ruby' args '-u root -v /root/.ssh:/root/.ssh' } } stages { stage('Build') { steps { echo 'Building…' sh 'bundle install' } } stage('Test') { steps { echo 'Testing…' sh 'rspec spec' } } stage('Deploy') { steps { echo 'Deploy…' sh 'cap staging deploy' } } […]

在OpenShift上创buildREDIS集群

我正在使用这个镜像,并在OpenShift上创build了两个REDIS部署。 部署名称是redis-node01和redis-node02 。 我也创build了最小的REDIS集群configuration文件,如下所述。 它看起来像这样,它在REDIS启动时加载: port 7000 cluster-enabled yes cluster-config-file nodes.conf cluster-node-timeout 5000 appendonly yes 现在我打开一个REDIS容器的terminal,并发出cluster meet命令,如下所述。 我得到这个错误: (error) ERR Invalid node address specified: redis-node02:6379 我想REDIS不能联系那个地址上的另一个实例吗? 如何解决这个问题?

用ecs部署laravel网站后如何保持用户会话

我正在使用ECS来部署我的laravel网站,没有负载均衡器,只有一个ec2实例,会话由elasticCache redis和phpredis来提供。 每次我用ecs-cli部署我的应用程序后,所有用户都将从我的网站注销。 我已经安装了phpredis,并在laravelconfiguration文件中设置持久性。 感谢您的build议。 对不起,英语不好。

OpenShift上的REDIS集群

我已经为Docker使用了官方 REDIS镜像,并将其部署在OpenShift上。 我部署了6个REDIS实例,并使用REDIS集群教程将它们configuration为以群集模式运行。 我已经在不同的端口上运行了每个实例,并使用服务公开了这些端口。 我也暴露了REDIS的pipe理端口。 我已经将hostNetwork的REDIS实例部署为true。 我现在将这些实例连接到一个集群中。 对于在同一个OpenShift节点上运行的实例,我可以使用运行它的节点IP或使用在服务和REDIS实例端口中定义的clusterIP来发出CLUSTER MEET命令。 两者都很好。 在同一个OpenShift节点上运行的实例在群集中连接,但无法获取正在不同节点上运行的实例以便彼此连接。 示例服务YAML: spec: ports: – name: 6371-tcp protocol: TCP port: 6371 targetPort: 6371 nodePort: 31790 – name: 16371-tcp protocol: TCP port: 16371 targetPort: 16371 nodePort: 31989 selector: deploymentconfig: redis-cache-node01 clusterIP: 172.30.63.9 type: NodePort sessionAffinity: None

Docker中的Rabbitmq IP地址和Redis IP地址

在Docker之外,redis和rabbitmq的ip地址在我的django应用程序中的ubuntu 16.04环境中设置为'localhost'。 但是,我正在尝试将我的Web服务迁移到docker中。 我使用Docker的官方存储库redis和rabbitmq。 在我的Django settings.py ,我必须声明redis和rabbitmq的IP地址,以便在我的应用程序中连接到它们。 我没有任何线索如何确定他们在Docker内的IP地址。 在docker-compose.yml中,configuration如下: version: '2' services: # RabbitMQ rabbit: hostname: my-rabbit image: rabbitmq:3 ports: – "5672:5672" # we forward this port because it's useful for debugging – "15672:15672" # here, we can access rabbitmq management plugin #Redis redis: image: redis:latest #Data Processing WS web: build: . command: python manage.py […]

我可以使用Redis容器作为群集吗?

我使用docker-compose为我的Dev Envconfiguration容器,并且我有3个容器(nginx,php,redis) version: '3' services: php: .. nginx: .. redis: image: redis ports: – 6379:6379 我正在使用Predis来连接到PHP容器的redis,我的问题是:我想在集群模式下工作,当我做这样的事情 $parameters = ['redis']; $options = ['cluster' => 'redis']; $client = new Predis\Client($parameters, $options); 不pipe用