您的位置:首页 > 运维架构 > Docker

教你在Docker上不到2分钟建立一个多模型数据库!

2017-06-09 00:00 861 查看
ArangoDB is an interesting young database, which compares three popular data models: documents, graphs, and key-value stores. Some other features like database-side scripting endpoints are very interesting too. Give it a try! Let’s kickstart the setup and deploy a ready ArangoDB setup on DigitalOcean with docker.

Mediums forecast of reading this article is 2 minutes. You can setup ArangoDB within this time too! In fact, you only have to click about 5 times and execute 3 commands.

1. Create DigitalOcean Droplet with Docker

Register/Log-in to DigitalOcean and create a new droplet with docker preinstalled:

“Create Droplet” -> “One-click Apps” -> “Docker 17.03.0-ce on 16.04“
The versions might differ.

Choose your preferred settings (size, region etc.) and add an SSH key to access the droplet afterwards.

2. Install & start ArangoDB

Just connect to your droplet (use your droplets IP and the SSH key)..

ssh -i /path/to/your/ssh-key root@12.345.67.89

.. and execute one single command (choose your custom password instead of ha2WF4qdHc):

docker run -e ARANGO_ROOT_PASSWORD=ha2WF4qdHc -p 8529:8529 -d arangodb/arangodb

The command does certain things:

It downloads the newest ArangoDB docker image (because it is not yet available on the droplet).

It installs the ArangeDB docker image, creates a root user with the given password and starts the container.

It makes sure that the ArangoDB port 8529 is accessible from outside the docker container.

3. Open it for the world

Now, wo just have to open the port of the droplet to access the database from the “open” internet:

ufw allow 8529


Ready to create great apps with ArangoDB!

The database endpoint is ready for queries!

You can create databases, users, permissions and many more from the built-in ArangoDB interface. Just use the IP of your droplet and the default ArangoDB-Port 8529.

http://12.345.67.89:8529/

Have fun! Find ArangoDB on Github.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息