Docker中的BigChainDB会在连接被拒绝的情况下立即崩溃吗?

时间:2017-03-01 18:47:23

标签: docker bigchaindb

我按照https://docs.bigchaindb.com/projects/server/en/latest/appendices/run-with-docker.html

上的说明操作Win10 x64

因为我在Windows中运行(而且没有$HOME),这就是我正在运行的实际命令:

docker run --rm -v "C:/bigchaindb_docker:/data" -ti bigchaindb/bigchaindb -y configure rethinkdb
docker run -v "C:/bigchaindb_docker:/data" -d --name bigchaindb -p "58080:8080" -p "59984:9984" bigchaindb/bigchaindb start

第一个命令似乎执行得很好。我在.bigchaindb文件夹中看到了C:/bigchaindb_docker文件。第二个命令将启动一个容器,但大约6秒后容器退出代码1.我运行docker start <container> && docker attach <container>并且能够获得此转储:

INFO:bigchaindb.commands.bigchain:BigchainDB Version 0.10.0.dev
INFO:bigchaindb.config_utils:Configuration loaded from `/data/.bigchaindb`
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 271, in __init__
    self._socket = socket.create_connection((self.host, self.port), timeout)
  File "/usr/lib/python3.5/socket.py", line 711, in create_connection
    raise err
  File "/usr/lib/python3.5/socket.py", line 702, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/bigchaindb", line 11, in <module>
    load_entry_point('BigchainDB', 'console_scripts', 'bigchaindb')()
  File "/usr/src/app/bigchaindb/commands/bigchain.py", line 401, in main
    utils.start(create_parser(), sys.argv[1:], globals())
  File "/usr/src/app/bigchaindb/commands/utils.py", line 96, in start
    return func(args)
  File "/usr/src/app/bigchaindb/commands/bigchain.py", line 201, in run_start
    _run_init()
  File "/usr/src/app/bigchaindb/commands/bigchain.py", line 142, in _run_init
    schema.init_database(connection=b.connection)
  File "/usr/src/app/bigchaindb/backend/schema.py", line 99, in init_database
    create_database(connection, dbname)
  File "/usr/lib/python3.5/functools.py", line 743, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/usr/src/app/bigchaindb/backend/rethinkdb/schema.py", line 17, in create_database
    if connection.run(r.db_list().contains(dbname)):
  File "/usr/src/app/bigchaindb/backend/rethinkdb/connection.py", line 49, in run
    self._connect()
  File "/usr/src/app/bigchaindb/backend/rethinkdb/connection.py", line 73, in _connect
    self.conn = r.connect(host=self.host, port=self.port, db=self.dbname)
  File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 661, in connect
    return conn.reconnect(timeout=timeout)
  File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 572, in reconnect
    return self._instance.connect(timeout)
  File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 430, in connect
    self._socket = SocketWrapper(self, timeout)
  File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 337, in __init__
    (self.host, self.port, str(ex)))
rethinkdb.errors.ReqlDriverError: Could not connect to localhost:28015. Error: [Errno 111] Connection refused

我正在研究使用BigChainDB而我对此并不了解。我猜它正在尝试连接到rethinkdb并且它没有运行。我不知道从哪里开始修复它,我也从未使用过rethinkdb。有没有人遇到过这个问题?

1 个答案:

答案 0 :(得分:3)

从您提供的日志的第一行看起来您正在运行主分支:

INFO:bigchaindb.commands.bigchain:BigchainDB Version 0.10.0.dev

过去,BigchainDB(docker)图像的最新标记将指向最新的主分支。最近发生了变化,现在它指向最新版本,与Python包索引(PyPI)上的内容相匹配。

因此,如果您再次提取图像,则应更新到最新版本,该版本在撰写时为0.9.5。那就是:

docker pull bigchaindb/bigchaindb

或等效地:

docker pull bigchaindb/bigchaindb:latest

或明确提取标记0.9.5

docker pull bigchaindb/bigchaindb:0.9.5

如果您使用版本0.9.5,并尝试发布的两个命令,它应该可以正常工作。

如果您希望使用最新的主分支,则需要运行RethinkDB,因为它不再嵌入Docker镜像中。详细说明可在Run the backend database部分下的BigchainDB文档的主版本中找到。