我已经通过位于此处的 puppet 模块安装了 gitlab 6 :
我根据此处的示例创建了以下木偶清单:
root@gitlab2:/etc/puppet# cat /etc/puppet/manifests/site.pp
stage { 'first': before => Stage['main'] }
stage { 'last': require => Stage['main'] }
class { 'apt': stage => first; }
class { 'redis': stage => main; }
class { 'nginx': stage => main; }
class {
'ruby':
stage => main,
version => $ruby_version,
rubygems_update => false;
}
class {
'ruby::dev':
stage => main,
require => Class['ruby']
}
if $::lsbdistcodename == 'quantal' {
package {
['build-essential','libssl-dev','libgdbm-dev','libreadline-dev',
'libncurses5-dev','libffi-dev','libcurl4-openssl-dev']:
ensure => installed;
}
$ruby_version = '4.9'
exec {
'ruby-version':
command => '/usr/bin/update-alternatives --set ruby /usr/bin/ruby1.9.1',
user => root,
logoutput => 'on_failure';
'gem-version':
command => '/usr/bin/update-alternatives --set gem /usr/bin/gem1.9.1',
user => root,
logoutput => 'on_failure';
}
} else {
$ruby_version = '1:1.9.3'
}
class { 'mysql::server': stage => main;}
mysql::db { 'gitlabdb':
ensure => 'present',
user => 'gitlab',
password => 'foo',
host => 'localhost',
grant => ['all'],
}
class {
'gitlab':
git_email => 'git@someserver.net',
git_comment => 'GitLab',
gitlab_branch => '6-0-stable',
gitlabshell_branch => 'v1.4.0',
gitlab_dbtype => 'mysql',
gitlab_dbname => 'gitlabdb',
gitlab_dbuser => 'gitlab',
gitlab_dbpwd => 'foo',
gitlab_dbhost => 'localhost',
gitlab_dbport => '3306',
ldap_enabled => false,
ldap_host => 'foo',
ldap_base => 'dc=foo,dc=foo',
ldap_uid => 'uid',
ldap_port => '636',
ldap_method => 'ssl',
ldap_bind_dn => 'foo',
ldap_bind_password => 'foo',
}
我安装了以下木偶模块
root@gitlab2:/etc/puppet# puppet module list
/etc/puppet/modules
├── fsalum-redis (v0.0.6)
├── gitlab (???)
├── nginx (???)
├── puppetlabs-apt (v1.2.0)
├── puppetlabs-gcc (v0.1.0)
├── puppetlabs-mysql (v0.9.0)
├── puppetlabs-ruby (v0.0.2)
└── puppetlabs-stdlib (v4.1.0)
gitlab 模块来自这里:
root@gitlab2:/etc/puppet/modules/gitlab# git remote -v
origin https://github.com/sbadia/puppet-gitlab.git (fetch)
origin https://github.com/sbadia/puppet-gitlab.git (push)
root@gitlab2:/etc/puppet/modules/gitlab# git branch
* master
我不得不使用 guilherme 的 nginx 模块而不是 jfryman/puppet-nginx 模块,因为问题 #22尚未被拉入 puppet forge 模块。
root@gitlab2:/etc/puppet/modules/nginx# git remote -v
origin https://github.com/guilherme/puppet-nginx.git (fetch)
origin https://github.com/guilherme/puppet-nginx.git (push)
我已经安装了 puppet 模块而没有错误,但是当我导航到服务器 (10.2.192.28) 时仍然收到 502 Bad Gateway 错误
根据日志,nginx 无法连接到套接字。果然socket文件不存在。
tail /var/log/nginx/gitlab_error.log
2013/09/07 01:26:59 [crit] 1042#0: *3 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 10.1.11.12, server: gitlab2.ac, request: "GET / HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/", host: "10.2.192.28"
2013/09/07 01:32:00 [crit] 1042#0: *6 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 10.1.11.12, server: gitlab2.ac, request: "GET / HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/", host: "10.2.192.28"
据谷歌称,当 gitlab 进程未运行时,可能会发生这种情况。
为什么 gitlab 进程不会继续运行?
root@gitlab2:/var/log/nginx# service gitlab start && service gitlab status
GitLab service started
GitLab service is not running.
我已经尝试过这里提供的建议:
root@gitlab2:~# sudo -u git -H touch /home/git/gitlab/config/puma.rb
任何想法如何解决为什么 gitlab 进程死亡?
任何想法如何解决 502 错误?
我安装 gitlab 的方式有什么明显的错误吗?
在 Ubuntu 12.10 Openstack VM 上运行,端口 22 和 80 向内部网络开放。