开发者社区 > PolarDB开源 > PolarDB 分布式版 > 正文

polardb-pg初始化权限问题

我使用polardb-pg latest版本时,使用如下命令进行初始化:
docker run -it --rm --env POLARDB_PORT=5432 --env POLARDB_USER=postgres --env POLARDB_PASSWORD=123 -v G:/localDB/polardb:/var/polardb bb9216921591 echo 'done'

报错如下:
2024-10-16 14:22:17.985 CST [73] [73] FATAL: data directory "/var/polardb/primary_datadir" has invalid permissions
2024-10-16 14:22:17.985 CST [73] [73] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
2024-10-16 14:22:17.985 CST [73] [73] BACKTRACE:
/home/postgres/tmp_basedir_polardb_pg_1100_bld/bin/postgres(+0x41a43e) [0x55f22065a43e]
/home/postgres/tmp_basedir_polardb_pg_1100_bld/bin/postgres(AuxiliaryProcessMain+0x34f) [0x55f22077fbff]
/home/postgres/tmp_basedir_polardb_pg_1100_bld/bin/postgres(main+0x1a7) [0x55f220688667]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7feae0125d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7feae0125e40]
/home/postgres/tmp_basedir_polardb_pg_1100_bld/bin/postgres(_start+0x25) [0x55f2206986d5]
child process exited with exit code 1
initdb: removing contents of data directory "/var/polardb/primary_datadir"
use localfs mode
pg_twophase in local data dir does not exist
2024-10-16 06:22:18.283 GMT [91] [91] LOG: skipping missing configuration file "/var/polardb/primary_datadir/polar_dma.conf"
2024-10-16 06:22:18.284 GMT [91] [91] LOG: skipping missing configuration file "/var/polardb/primary_datadir/postgresql.auto.conf"
pg_ctl: directory "/var/polardb/primary_datadir" is not a database cluster directory
psql: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

我认为是权限问题,但是我另一台电脑似乎是正常的,想问问这种是什么问题?

展开
收起
游客fwvnmjvruabau 2024-10-16 14:24:12 71 0
1 条回答
写回答
取消 提交回答
  • docker run -it --rm \
        --env POLARDB_PORT=5432 \
        --env POLARDB_USER=polar \
        --env POLARDB_PASSWORD=XXXXXXX \
        -v ./:/var/polardb \
        registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_local_instance:15 \
        echo 'done'
    

    我是直接拷贝指令初始化,但是报错...

    pg_ctl: directory "/var/polardb/primary_datadir" does not exis
    

    我换了另外的指令依旧如此...
    不添加挂路径可以正常启动,容器里面也有

    /var/polardb/primary_datadir
    

    有点懵了,我是有什么没搞对的吗?

    但是我把挂载路径改成

    -v ./:/var
    

    对了,这...

    2024-11-14 11:29:12
    赞同 169 展开评论 打赏

PolarDB 分布式版 (PolarDB for Xscale,简称“PolarDB-X”) 是阿里云自主设计研发的高性能云原生分布式数据库产品,为用户提供高吞吐、大存储、低延时、易扩展和超高可用的云时代数据库服务。

相关电子书

更多
云栖大会:开源 PolarDB 架构演进、关键技术与社区建设 立即下载
2023云栖大会:和客户一起玩转PolarDB新特性 立即下载
2023云栖大会:PolarDB for AI 立即下载