我试图初始化我的Docker arangodb,但不断得到连接错误:我已尝试将服务器端点更改为http+tcp://.....但错误仍然存在,这是什么原因?
docker-compose.yml:
version: '3.3'
services:
db:
container_name: arangodb
build: .
environment:
- ARANGO_DB_NAME="mydba"
- ARANGO_DB_USER="user"
- ARANGO_DB_PASSWORD="123"
ports:
- '2010:8529'
expose:
- '2010'
volumes:
- ./arango-dump:/docker-entrypoint-initdb.d
停靠文件:
FROM arangodb
## Environment variables
ENV ARANGO_ROOT_PASSWORD=123
垃圾01-Create.sh:
#!/bin/bash
/usr/bin/arangosh \
--server.endpoint=unix:///tmp/arangodb-tmp.sock \
--server.password ${ARANGO_ROOT_PASSWORD} \
--javascript.execute-string "db._createDatabase(${ARANGO_DB_NAME}, [{username: ${ARANGO_DB_USER}, password: ${ARANGO_DB_PASSWORD}}]);"
错误:
arangodb | /entrypoint.sh: running /docker-entrypoint-initdb.d/01-Create.sh
arangodb | 2020-03-25T03:49:52Z [255] ERROR [979b9] JavaScript exception in file '/usr/share/arangodb3/js/client/modules/@arangodb/arango-database.js' at 1017,40: ArangoError 2001: not connected\n! var requestResult = this._connection.POST('/_api/database', data);\n! ^\nstacktrace: ArangoError: not connected\n at Proxy.ArangoDatabase._createDatabase (/usr/share/arangodb3/js/client/modules/@arangodb/arango-database.js:1017:40)\n at (command-line):1:4\n
arangodb exited with code 1
非常感谢
1条答案
按热度按时间k2arahey1#
将端口
8999
用于服务器终结点这对我在3. 6. 2上有效。
在您的情况下,不需要
Dockerfile
,也不需要docker-compose.yml
中的expose
。