Gitlab 突然不能查看文件内容,服务器上查看状态gitlab-ctl status
发现postgresql未正常启动,查看日志文件:/var/log/gitlab/postgresql/current
异常信息:2017-04-24_09:32:42.77395 The PostgreSQL documentation contains more information about shared memory configuration.
2017-04-24_09:32:43.78631 FATAL: could not create shared memory segment: Cannot allocate memory
2017-04-24_09:32:43.78633 DETAIL: Failed system call was shmget(key=5432001, size=2123759616, 03600).
2017-04-24_09:32:43.78633 HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter. You can either reduce the request size or reconfigure the kernel with larger SHMALL. To reduce the request size (currently 2123759616 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
初步判断应该是共享内存不够;调整postgresql配置文件/var/opt/gitlab/postgresql/data/postgresql.conf
修改:shared_buffers 为合适的大小shared_buffers = 1024 # min 128kB
重启:gitlab-ctl start