简体   繁体   English

PostgreSQL 服务器无法在 ArchLinux 上启动:致命:无法创建锁文件 »/run/postgresql/.s.PGSQL.5432.lock«

[英]PostgreSQL server fails to start on ArchLinux: FATAL: could not create lockfile »/run/postgresql/.s.PGSQL.5432.lock«

I am quite new in Arch and a total beginner in PostgreSQL, so this may be a very basic question.我是 Arch 的新手,也是 PostgreSQL 的初学者,所以这可能是一个非常基本的问题。

I installed postgresql 11.5-4 from extra and pgadmin 4 from AUR, both seem to be running well.我安装了来自 extra 的 postgresql 11.5-4 和来自 AUR 的 pgadmin 4,两者似乎都运行良好。 I created a test DB with the following command:我使用以下命令创建了一个测试数据库:

initdb -D /home/lg/test-db

I got the answer:我得到了答案:

You can start the db-server using:
pg_ctl -D /home/lg/test-db -l logdatei start

I tried that and got:我试过了,得到:

pg_ctl -D /home/lg/test-db -l logdatei start
waiting for serer to start.... stopped 
pg_ctl: could not start the server
check the log.

The log only says that the lockfile »/run/postgresql/.s.PGSQL.5432.lock« could not be created, because the folder could not be found.日志只说无法创建锁文件»/run/postgresql/.s.PGSQL.5432.lock«,因为找不到文件夹。 Under /run is no folder called "postgresql". /run 下没有名为“postgresql”的文件夹。 I suppose postgresql can not create this folder, because it does not have the permission.我想 postgresql 不能创建这个文件夹,因为它没有权限。 Several posts online posts suggest to change the user/owner of the db to sudo, however.但是,一些在线帖子建议将数据库的用户/所有者更改为 sudo。 Postgresql prevents this, however.但是,Postgresql 阻止了这种情况。 When I try any command as sudo, postgresql tells me that this command can't be run as root.当我以 sudo 身份尝试任何命令时,postgresql 告诉我该命令不能以 root 身份运行。 There must be some very basic error in my thinking here, but I have not worked it out for 3 hours.我这里的想法一定有一些非常基本的错误,但我已经3个小时没有解决了。

你必须删除/run/postgresqlunix_socket_directoriespostgresql.conf启动服务器之前。

Probably You have /var/run symlinked to /run and run is on tmpfs.可能你有 /var/run 符号链接到 /run 并且 run 在 tmpfs 上。 You should add something like d /run/postgresql 0755 postgres postgres - into /usr/lib/tmpfiles.d/postgresql.conf您应该将d /run/postgresql 0755 postgres postgres -到 /usr/lib/tmpfiles.d/postgresql.conf

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Postgresql 致命:无法创建锁定文件“/var/run/postgresql/.s.PGSQL.5432.lock”:权限被拒绝 - Postgresql FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied 无法连接到服务器:“/var/run/postgresql/.s.PGSQL.5432”? - could not connect to server: “/var/run/postgresql/.s.PGSQL.5432”? PostgreSQL:无法连接到服务器:域套接字“/var/run/postgresql/.s.PGSQL.5432” - PostgreSQL: could not connect to server: domain socket "/var/run/postgresql/.s.PGSQL.5432" 连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败:致命:角色“rootuser”不存在 - connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "rootuser" does not exist psql:错误:连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败:致命:用户“postgres”的对等身份验证失败(Ubuntu) - psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres" (Ubuntu) 无法使用postgresql连接到服务器,因为该服务器在本地运行并运行PGSQL.5432 - could not connect to server with postgresql is the server running locally and PGSQL.5432 服务器是否在本地运行并接受Unix域套接字“/var/run/postgresql/.s.PGSQL.5432”上的连接 - Is the server running locally and accepting connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432” 服务器是否在本地运行并接受 Unix 域套接字“/var/run/postgresql/.s.PGSQL.5432”上的连接? - Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? PG::ConnectionBad:连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败:没有这样的文件或目录 - PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory 连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败:没有这样的文件或目录 - connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM