我想在ubuntu 18.04上安装gitlab,但:-(!。
sudo apt-get install -y curl openssh-server ca-certificates
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" apt-get install gitlab-ee
任何解决方案吗?
结果:
Recipe: postgresql::enable * directory[/var/opt/gitlab/postgresql] action create - create new directory /var/opt/gitlab/postgresql - change mode from '' to '0755' - change owner from '' to 'gitlab-psql' * directory[/var/opt/gitlab/postgresql] action create (up to date) * directory[/var/opt/gitlab/postgresql/data] action create - create new directory /var/opt/gitlab/postgresql/data - change mode from '' to '0700' - change owner from '' to 'gitlab-psql' * directory[/var/log/gitlab/postgresql] action create - create new directory /var/log/gitlab/postgresql - change mode from '' to '0700' - change owner from '' to 'gitlab-psql' * link[/var/opt/gitlab/postgresql/data] action create (skipped due to not_if) * file[/var/opt/gitlab/postgresql/.profile] action create - create new file /var/opt/gitlab/postgresql/.profile - update content in file /var/opt/gitlab/postgresql/.profile from none to 3b0387 --- /var/opt/gitlab/postgresql/.profile 2019-12-13 02:51:57.452326848 +0100 +++ /var/opt/gitlab/postgresql/.chef-.profile20191213-11373-1qqmckf.profile 2019-12-13 02:51:57.448326813 +0100 @@ -1 +1,2 @@ +PATH=/opt/gitlab/embedded/bin:/opt/gitlab/bin:$PATH - change mode from '' to '0600' - change owner from '' to 'gitlab-psql' * gitlab_sysctl[kernel.shmmax] action create * directory[create /etc/sysctl.d for kernel.shmmax] action create (up to date) * file[create /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf kernel.shmmax] action create - create new file /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf - update content in file /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf from none to 75a195 --- /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf 2019-12-13 02:51:57.464326950 +0100 +++ /opt/gitlab/embedded/etc/.chef-90-omnibus-gitlab-kernel20191213-11373-zkx5md.shmmax.conf 2019-12-13 02:51:57.464326950 +0100 @@ -1 +1,2 @@ +kernel.shmmax = 17179869184 * execute[load sysctl conf kernel.shmmax] action run [execute] * Applying /etc/sysctl.d/10-console-messages.conf ... kernel.printk = 4 4 1 7 * Applying /etc/sysctl.d/10-ipv6-privacy.conf ... net.ipv6.conf.all.use_tempaddr = 2 net.ipv6.conf.default.use_tempaddr = 2 * Applying /etc/sysctl.d/10-kernel-hardening.conf ... kernel.kptr_restrict = 1 * Applying /etc/sysctl.d/10-link-restrictions.conf ... fs.protected_hardlinks = 1 fs.protected_symlinks = 1 * Applying /etc/sysctl.d/10-magic-sysrq.conf ... kernel.sysrq = 176 * Applying /etc/sysctl.d/10-network-security.conf ... net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 net.ipv4.tcp_syncookies = 1 * Applying /etc/sysctl.d/10-ptrace.conf ... kernel.yama.ptrace_scope = 1 * Applying /etc/sysctl.d/10-zeropage.conf ... vm.mmap_min_addr = 65536 * Applying /usr/lib/sysctl.d/50-default.conf ... net.ipv4.conf.all.promote_secondaries = 1 net.core.default_qdisc = fq_codel * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ... sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ... sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ... kernel.shmmax = 17179869184 * Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ... sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory * Applying /etc/sysctl.d/99-sysctl.conf ... * Applying /etc/sysctl.conf ... ================================================================================ Error executing action `run` on resource 'execute[load sysctl conf kernel.shmmax]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Expected process to exit with [0], but received '255' ---- Begin output of sysctl -e --system ---- STDOUT: * Applying /etc/sysctl.d/10-console-messages.conf ... kernel.printk = 4 4 1 7 * Applying /etc/sysctl.d/10-ipv6-privacy.conf ... net.ipv6.conf.all.use_tempaddr = 2 net.ipv6.conf.default.use_tempaddr = 2 * Applying /etc/sysctl.d/10-kernel-hardening.conf ... kernel.kptr_restrict = 1 * Applying /etc/sysctl.d/10-link-restrictions.conf ... fs.protected_hardlinks = 1 fs.protected_symlinks = 1 * Applying /etc/sysctl.d/10-magic-sysrq.conf ... kernel.sysrq = 176 * Applying /etc/sysctl.d/10-network-security.conf ... net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 net.ipv4.tcp_syncookies = 1 * Applying /etc/sysctl.d/10-ptrace.conf ... kernel.yama.ptrace_scope = 1 * Applying /etc/sysctl.d/10-zeropage.conf ... vm.mmap_min_addr = 65536 * Applying /usr/lib/sysctl.d/50-default.conf ... net.ipv4.conf.all.promote_secondaries = 1 net.core.default_qdisc = fq_codel * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ... * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ... * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ... kernel.shmmax = 17179869184 * Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ... * Applying /etc/sysctl.d/99-sysctl.conf ... * Applying /etc/sysctl.conf ... STDERR: sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory ---- End output of sysctl -e --system ---- Ran sysctl -e --system returned 255 Resource Declaration: --------------------- # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb 46: execute "load sysctl conf #{new_resource.name}" do 47: command "sysctl -e --system" 48: action :nothing 49: end 50: end Compiled Resource: ------------------ # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb:46:in `block in class_from_file' execute("load sysctl conf kernel.shmmax") do action [:nothing] default_guard_interpreter :execute command "sysctl -e --system" backup 5 declared_type :execute cookbook_name "postgresql" domain nil user nil end System Info: ------------ chef_version=14.13.11 platform=ubuntu platform_version=18.04 ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] program_name=/opt/gitlab/embedded/bin/chef-client executable=/opt/gitlab/embedded/bin/chef-client ================================================================================ Error executing action `create` on resource 'gitlab_sysctl[kernel.shmmax]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ execute[load sysctl conf kernel.shmmax] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '255' ---- Begin output of sysctl -e --system ---- STDOUT: * Applying /etc/sysctl.d/10-console-messages.conf ... kernel.printk = 4 4 1 7 * Applying /etc/sysctl.d/10-ipv6-privacy.conf ... net.ipv6.conf.all.use_tempaddr = 2 net.ipv6.conf.default.use_tempaddr = 2 * Applying /etc/sysctl.d/10-kernel-hardening.conf ... kernel.kptr_restrict = 1 * Applying /etc/sysctl.d/10-link-restrictions.conf ... fs.protected_hardlinks = 1 fs.protected_symlinks = 1 * Applying /etc/sysctl.d/10-magic-sysrq.conf ... kernel.sysrq = 176 * Applying /etc/sysctl.d/10-network-security.conf ... net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 net.ipv4.tcp_syncookies = 1 * Applying /etc/sysctl.d/10-ptrace.conf ... kernel.yama.ptrace_scope = 1 * Applying /etc/sysctl.d/10-zeropage.conf ... vm.mmap_min_addr = 65536 * Applying /usr/lib/sysctl.d/50-default.conf ... net.ipv4.conf.all.promote_secondaries = 1 net.core.default_qdisc = fq_codel * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ... * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ... * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ... kernel.shmmax = 17179869184 * Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ... * Applying /etc/sysctl.d/99-sysctl.conf ... * Applying /etc/sysctl.conf ... STDERR: sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory ---- End output of sysctl -e --system ---- Ran sysctl -e --system returned 255 Resource Declaration: --------------------- # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb 67: gitlab_sysctl "kernel.shmmax" do 68: value node['postgresql']['shmmax'] 69: end 70: Compiled Resource: ------------------ # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb:67:in `from_file' gitlab_sysctl("kernel.shmmax") do action [:create] updated true updated_by_last_action true default_guard_interpreter :default declared_type :gitlab_sysctl cookbook_name "postgresql" recipe_name "enable" value 17179869184 end System Info: ------------ chef_version=14.13.11 platform=ubuntu platform_version=18.04 ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] program_name=/opt/gitlab/embedded/bin/chef-client executable=/opt/gitlab/embedded/bin/chef-client Recipe: gitlab::gitlab-rails * execute[clear the gitlab-rails cache] action run - execute /opt/gitlab/bin/gitlab-rake cache:clear Recipe: * service[gitaly] action restart - restart service service[gitaly] Recipe: gitaly::enable * runit_service[gitaly] action hup - send hup to runit_service[gitaly] Running handlers: There was an error running gitlab-ctl reconfigure: gitlab_sysctl[kernel.shmmax] (postgresql::enable line 67) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[load sysctl conf kernel.shmmax] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '255' ---- Begin output of sysctl -e --system ---- STDOUT: * Applying /etc/sysctl.d/10-console-messages.conf ... kernel.printk = 4 4 1 7 * Applying /etc/sysctl.d/10-ipv6-privacy.conf ... net.ipv6.conf.all.use_tempaddr = 2 net.ipv6.conf.default.use_tempaddr = 2 * Applying /etc/sysctl.d/10-kernel-hardening.conf ... kernel.kptr_restrict = 1 * Applying /etc/sysctl.d/10-link-restrictions.conf ... fs.protected_hardlinks = 1 fs.protected_symlinks = 1 * Applying /etc/sysctl.d/10-magic-sysrq.conf ... kernel.sysrq = 176 * Applying /etc/sysctl.d/10-network-security.conf ... net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 net.ipv4.tcp_syncookies = 1 * Applying /etc/sysctl.d/10-ptrace.conf ... kernel.yama.ptrace_scope = 1 * Applying /etc/sysctl.d/10-zeropage.conf ... vm.mmap_min_addr = 65536 * Applying /usr/lib/sysctl.d/50-default.conf ... net.ipv4.conf.all.promote_secondaries = 1 net.core.default_qdisc = fq_codel * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ... * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ... * Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ... kernel.shmmax = 17179869184 * Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ... * Applying /etc/sysctl.d/99-sysctl.conf ... * Applying /etc/sysctl.conf ... STDERR: sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory ---- End output of sysctl -e --system ---- Ran sysctl -e --system returned 255 Running handlers complete Chef Client failed. 167 resources updated in 53 seconds dpkg: error processing package gitlab-ee (--configure): installed gitlab-ee package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: gitlab-ee E: Sub-process /usr/bin/dpkg returned an error code (1)
答案 0 :(得分:0)
“ Error executing action
创建on resource 'gitlab_sysctl[kernel.shmmax
”通常指出/sys
是只读的。
在主机上的
/etc/sysctl.conf
中设置这些值,然后在主机上运行cat /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -e -p -
。
然后在lxc容器中再次运行reconfigure,它应该检测到内核已经在使用必要的设置运行,并且没有进行任何更改。注意:可以在这里找到这些值:
root@gitlab:~# cat /opt/gitlab/embedded/etc/90-omnibus-gitlab-*
kernel.sem = 250 32000 32 262
kernel.shmall = 4194304
kernel.shmmax = 17179869184
net.core.somaxconn = 1024
我最近尝试在
vagrant/lxc
容器(debian / jessie64盒)中设置开发环境,并且不得不以proc
模式(使用{{1} })设置值。
答案 1 :(得分:0)
我找到了一个临时解决方案。 (工作方式??? xD)
我编辑文件
sudo nano /opt/gitlab/embedded/cookbooks/package/resources/gitlab_sysctl.rb
部分
加载设置
至:
# Load the settings right away #execute "load sysctl conf #{new_resource.name}" do # command "sysctl -e --system" # action :nothing #end execute "sysctl" do command "/sbin/sysctl -e -p /etc/sysctl.conf" action :nothing end enter code here end
sudo gitlab-ctl reconfigure