1
votes

I would like to install ArangoDB for Docker on an Arch Linux machine I access via ssh. The ArangoDB Docker download is found here:

Docker - ArangoDB

This ArangoDb will not be part of a cluster, and there is no active failover. The ArangoDB configuration and the database will need to be persistent.

I will need to access it using the arango command line tools (arangosh, arangoimp, etc.) via ssh. And we'll need http access to the Arango WebUI from the local area network on port 8529 (ArangoDB's default).

I have done these steps:

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

Docker is installed correctly.

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:

sudo docker run -i -t hello-world

Hello from 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

1

1 Answers

3
votes

running

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

will produce identifier, but arangod will exit with error, run

docker ps -a

there you'll see your container with 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

-e ARANGO_NO_AUTH=1

you forgot =1, -e are KEY=VALUE

to access arango remotely, you need to expose port

-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

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

also never run arangodb with ARANGO_NO_AUTH=1 in production or on publicly accesible server

more details related to Docker are at https://hub.docker.com/_/arangodb/