Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services aws代码构建/使用本地redis(ubuntu图像)_Amazon Web Services_Redis_Aws Codebuild - Fatal编程技术网

Amazon web services aws代码构建/使用本地redis(ubuntu图像)

Amazon web services aws代码构建/使用本地redis(ubuntu图像),amazon-web-services,redis,aws-codebuild,Amazon Web Services,Redis,Aws Codebuild,进入代码构建;目前正在寻找在本地ubuntu映像上使用redis 使用以下脚本: version: 0.2 phases: install: commands: - apt update - apt install -y redis-server wget pre_build: commands: - wget https://raw.githubusercontent.com/Hronom/wait-for-redis/master

进入代码构建;目前正在寻找在本地ubuntu映像上使用redis
使用以下脚本:

version: 0.2
phases:
  install:
    commands:
      - apt update
      - apt install -y redis-server wget 
  pre_build:
    commands:
      - wget https://raw.githubusercontent.com/Hronom/wait-for-redis/master/wait-for-redis.sh
      - chmod +x ./wait-for-redis.sh
      - service redis-server start
      - ./wait-for-redis.sh localhost:6379
  build:
    commands:
      - redis-cli info
      - redis-cli info server
现在看来,docker compose并不是最终需要的,我们将首先考虑以这种方式使用它——期待一个标准的ubuntu行为

我们使用类似的方法安装postgres,它确实可以正常启动,并且完全可用

在这里,我们无法正确启动redis,继续重试(不断出现错误
无法在本地主机上连接到redis:6379:连接被拒绝

对于ec2 linux映像(基于yum),我们没有这样的问题


在ubuntu环境下启动redis的正确方法是什么?

也遇到了同样的问题

当我将
cat/var/log/redis/*.log
添加到buildspec时,我发现redis无法绑定:

Creating Server TCP listening socket ::1:6379: bind: Cannot assign requested address
进一步的研究表明这是一个已知的问题:

。。。可以通过将以下行添加到buildspec(在使用redis之前)来修复:


我试图重新创建,但得到“无法连接到本地主机上的Redis:6379:连接被拒绝”?我猜你也有同样的错误?@Marcin yep这就是我写
时的意思…等待redis不断重试…
,这也是我得到的错误
- sed -i '/^bind/s/bind.*/bind 127.0.0.1/' /etc/redis/redis.conf
- service redis-server restart