简体   繁体   English

如何在Arch Linux无头服务器上安装ArangoDB Docker?

[英]How to install ArangoDB Docker on an Arch Linux headless server?

I would like to install ArangoDB for Docker on an Arch Linux machine I access via ssh. 我想在我通过ssh访问的Arch Linux机器上安装ArangoDB for Docker。 The ArangoDB Docker download is found here: ArangoDB Docker下载可在此处找到:

Docker - ArangoDB Docker - ArangoDB

This ArangoDb will not be part of a cluster, and there is no active failover. 此ArangoDb不会成为群集的一部分,并且没有活动的故障转移。 The ArangoDB configuration and the database will need to be persistent. ArangoDB配置和数据库需要是持久的。

I will need to access it using the arango command line tools (arangosh, arangoimp, etc.) via ssh. 我需要通过ssh使用arango命令行工具(arangosh,arangoimp等)访问它。 And we'll need http access to the Arango WebUI from the local area network on port 8529 (ArangoDB's default). 我们需要通过端口8529(ArangoDB默认)从局域网对Arango WebUI进行http访问。

I have done these steps: 我已经完成了以下步骤:

sudo pacman -Syu docker
sudo systemctl enable docker
sudo systemctl start docker
sudo docker info

Docker is installed correctly. Docker已正确安装。

Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.09.0-ce
Storage Driver: btrfs
Build Version: Btrfs v4.19 
Library Version: 102
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.19.11-arch1-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 62.82GiB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

I installed the hello-world docker container: 我安装了hello-world docker容器:

sudo docker run -i -t hello-world

Hello from Docker! 来自Docker的你好! This message shows that your installation appears to be working correctly. 此消息表明您的安装似乎正常工作。

Next I ran this command: 接下来我运行了这个命令:

docker run -e ARANGO_NO_AUTH -d --name arangodb-instance arangodb

That produced the expected identifier. 这产生了预期的标识符。 However, it does not appear that any containers are running. 但是,似乎没有任何容器正在运行。

sudo docker info
Containers: 4
 Running: 0
 Paused: 0
 Stopped: 4
Images: 2

ArangoDB is not accessible at http://localhost:8529 无法通过http:// localhost:8529访问ArangoDB

running 赛跑

docker run -e ARANGO_NO_AUTH -d --name arangodb-instance arangodb

will produce identifier, but arangod will exit with error, run 将生成标识符,但arangod将退出并出错

docker ps -a

there you'll see your container with STATUS 在那里你会看到你的容器与STATUS

Exited (1) 5 seconds ago

run

docker logs arangodb-instance

and you'll see why it exited 你会明白为什么它会退出

automatically choosing storage engine
error: database is uninitialized and password option is not specified
You need to specify one of ARANGO_ROOT_PASSWORD, ARANGO_NO_AUTH and ARANGO_RANDOM_ROOT_PASSWORD

so 所以

to start arango with no password, you need to state 要开始没有密码的arango,你需要说明

-e ARANGO_NO_AUTH=1

you forgot =1 , -e are KEY=VALUE 你忘了=1-eKEY=VALUE

to access arango remotely, you need to expose port 要远程访问arango,您需要公开端口

-p 8529:8529

to persist data, you need to map them to your host path or volume (volume is best practice) 要保留数据,您需要将它们映射到主机路径或卷(卷是最佳做法)

-v arangodb3:/var/lib/arangodb3

so 所以

for persisting in volume, run 为了坚持数量,运行

docker volume create arangodb3

and then 接着

docker run -d \
-e ARANGO_NO_AUTH=1 \
-p 8529:8529 \
-v arangodb3:/var/lib/arangodb3 \
--name arangodb-instance \
arangodb/arangodb:3.4.0

before you'll run those, you'll need to remove existing container with same name 在运行它们之前,您需要删除具有相同名称的现有容器

docker stop arangodb-instance
docker rm arangodb-instance

to run arangosh, etc run 运行arangosh等运行

docker exec -it arangodb-instance arangosh

notice, that arangodb/arangodb:3.4.0 instead of arangodb/arangodb when executing docker run , it's best practice, avoid to run containers without specified version, it will pull arangodb/arangodb:latest which can cause, that your staging or prod can pull newer version than you have on dev, which could be a problem if newer version is minor or major 通知书的, arangodb/arangodb:3.4.0 ,而不是arangodb/arangodb当执行docker run ,这是最好的做法,避免因无指定版本上运行的容器,它会拉arangodb/arangodb:latest这可能会导致,您分期或督促能拉新版本比开发版本更新,如果较新版本是次要版本或主要版本,则可能会出现问题

also never run arangodb with ARANGO_NO_AUTH=1 in production or on publicly accesible server 在生产中或公共可访问的服务器上也永远不会运行ARANGO_NO_AUTH ARANGO_NO_AUTH=1

more details related to Docker are at https://hub.docker.com/_/arangodb/ 有关Docker的更多详细信息, 访问https://hub.docker.com/_/arangodb/

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM