安装过程(隐去 ip )
929 curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
931 sudo EXTERNAL_URL="http://113.xxx.xxx.xxx:xxx" yum -y install gitlab-ce
执行后,按照文档,应该已经可以运行了,但是无法访问。
执行 gitlab-ctl status,显示如下内容:
down: postgresql: 1s, normally up, want up; run: log: (pid 22114) 48669s
run: redis: (pid 22115) 48669s; run: log: (pid 22113) 48669s
执行 gitlab-ctl reconfigure,报错如下:
[0m
================================================================================ [0m
[31mError executing action `run` on resource 'bash[migrate gitlab-rails database]' [0m
================================================================================ [0m
[0mMixlib::ShellOut::ShellCommandFailed [0m
------------------------------------ [0m
Expected process to exit with [0], but received '1'
[0m---- Begin output of "bash" "/tmp/chef-script20171029-6188-16jte6z" ----
[0mSTDOUT: rake aborted!
[0mPG::ConnectionBad: could not connect to server: No such file or directory
[0m Is the server running locally and accepting
[0m connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
[0m/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49:in `block (3 levels) in <top (required)>'
[0m/opt/gitlab/embedded/bin/bundle:23:in `load'
[0m/opt/gitlab/embedded/bin/bundle:23:in `<main>'
[0mTasks: TOP => gitlab:db:configure
[0m(See full trace by running task with --trace)
[0mSTDERR:
[0m---- End output of "bash" "/tmp/chef-script20171029-6188-16jte6z" ----
[0mRan "bash" "/tmp/chef-script20171029-6188-16jte6z" returned 1 [0m
[0mResource Declaration: [0m
--------------------- [0m
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb
[0m
[0m 51: bash "migrate gitlab-rails database" do
[0m 52: code <<-EOH
[0m 53: set -e
[0m 54: log_file="#{node['gitlab']['gitlab-rails']['log_directory']}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"
[0m 55: umask 077
[0m 56: /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
[0m 57: STATUS=${PIPESTATUS[0]}
[0m 58: echo $STATUS > #{db_migrate_status_file}
[0m 59: exit $STATUS
[0m 60: EOH
[0m 61: environment env_variables unless env_variables.empty?
[0m 62: notifies :run, 'execute[enable pg_trgm extension]', :before if omnibus_helper.service_enabled?('postgresql')
[0m 63: notifies :run, "execute[clear the gitlab-rails cache]", :immediately
[0m 64: dependent_services.each do |svc|
[0m 65: notifies :restart, svc, :immediately
[0m 66: end
[0m 67: not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
[0m 68: only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
[0m 69: end
[0m
[0mCompiled Resource: [0m
------------------ [0m
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:51:in `from_file'
[0m
[0mbash("migrate gitlab-rails database") do
[0m action [:run]
[0m updated true
[0m retries 0
[0m retry_delay 2
[0m default_guard_interpreter :default
[0m command "migrate gitlab-rails database"
[0m backup 5
[0m returns 0
[0m code " set -e\n log_file=\"/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log\"\n umask 077\n /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}\n STATUS=${PIPESTATUS[0]}\n echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-5a695c4\n exit $STATUS\n"
[0m interpreter "bash"
[0m declared_type :bash
[0m cookbook_name "gitlab"
[0m recipe_name "database_migrations"
[0m not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-5a695c4) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-5a695c4 | grep -Fx 0)"
[0m only_if { #code block }
[0mend
[0m
[0mPlatform: [0m
--------- [0m
x86_64-linux [0m
[0m
看样子是 postgresql 出的问题,网上查到了一些 kill 掉 postgresql 再重启的方案,尝试了一下,也没有作用。而且 ps aux | grep postgresql 也看不出有 postgresql 的进程:
ps aux | grep postgresql
niyuzhe 8160 0.0 0.0 103268 884 pts/1 S+ 10:34 0:00 grep postgresql
root 22112 0.0 0.0 3940 412 ? Ss Oct28 0:22 runsv postgresql
root 22114 0.0 0.0 4084 572 ? S Oct28 0:03 svlogd -tt /var/log/gitlab/postgresql
请问大家这是怎么回事,对 gitlab 的部署结构不太了解,没思路做进一步分析了
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.