由于工作需要将redis认证方式改为了允许远程连接,并作了requirepass设置,postgresql认证方式也改为了允许远程连接并且需要通过密码。
引起的问题
提交的动态无法写入,表现在gitlab上就是提交的动态无法在首页显示,postgresql中也没有提交记录
解决办法
- 修改gitlab数据库配置 /home/git/gitlab/config/database.yml
production:
adapter: postgresql
encoding: unicode
database: gitlabhq_production
pool: 10
username: 用户名
password: 密码
host: localhost
port: 5432
- 修改resque.yml 配置,主要是连接redis配置
development: redis://:密码@localhost:6379/数据库(可选)
test: redis://:密码@localhost:6379/数据库(可选)
production: redis://:密码@localhost:6379/数据库(可选)
- 修改gitlab-shell中redis配置, 连接redis配置 /home/git/gitlab-shell/config.yml
redis:
bin: /usr/bin/redis-cli
host: localhost
port: 6379
password: 密码
db: 数据库
namespace: resque:gitlab
- 修改gitlab程序 /home/git/gitlab-shell/lib/gitlab_config.rb 58行
//加上密码和数据库参数
%W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -a #{redis['password']} -n #{redis['db']})