V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
maleclub
V2EX  ›  Linux

Linux 跑 Docker,卡壳,求解。

  •  
  •   maleclub · Dec 26, 2018 · 3347 views
    This topic created in 2683 days ago, the information mentioned may be changed or developed.

    用 Docker 跑 postgrestSQL,无法顺利创建启动服务。

    $ sudo docker run --name TestByAnna -d -p 55555:5432 -v /volume1/testforsql:/var/lib/postgresql/data -e POSTGRES_DB=TestByAnna -e POSTGRES_USER=anna -e POSTGRES_PASSWORD='PASSWORDbyme' postgres:latest

    日志输出如下,求指点。万分感谢。

    The files belonging to this database system will be owned by user "postgres".
    This user must also own the server process.
    
    initdb: directory "/var/lib/postgresql/data" exists but is not empty
    If you want to create a new database system, either remove or empty
    the directory "/var/lib/postgresql/data" or run initdb
    with an argument other than "/var/lib/postgresql/data".
    The database cluster will be initialized with locale "en_US.utf8".
    The default database encoding has accordingly been set to "UTF8".
    The default text search configuration will be set to "english".
    
    Data page checksums are disabled.
    
    The files belonging to this database system will be owned by user "postgres".
    This user must also own the server process.
    
    The database cluster will be initialized with locale "en_US.utf8".
    The default database encoding has accordingly been set to "UTF8".
    The default text search configuration will be set to "english".
    
    Data page checksums are disabled.
    
    initdb: directory "/var/lib/postgresql/data" exists but is not empty
    If you want to create a new database system, either remove or empty
    the directory "/var/lib/postgresql/data" or run initdb
    with an argument other than "/var/lib/postgresql/data".
    
    5 replies    2018-12-27 11:48:29 +08:00
    fullpowers
        1
    fullpowers  
       Dec 26, 2018 via Android
    把 /volume1/testforsql 清空试试
    yghack
        2
    yghack  
       Dec 26, 2018 via iPhone
    挂个空目录上去吧,提示已经说的很明确了,目录非空,无法初始化
    maleclub
        3
    maleclub  
    OP
       Dec 26, 2018
    @fullpowers 好的,感谢你的帮助,已经解决。。
    maleclub
        4
    maleclub  
    OP
       Dec 26, 2018
    @yghack 果然是这样,感谢
    julyclyde
        5
    julyclyde  
       Dec 27, 2018
    这不是没事找事么
    不用 docker,改用正规安装,就没这问题了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2572 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 06:10 · PVG 14:10 · LAX 23:10 · JFK 02:10
    ♥ Do have faith in what you're doing.