dgraph 图数据库docker-compose安装试用
2017-12-22 17:41
597 查看
备注:
使用docker-compose进行安装
1. docker-compose.yml
2. 启动
3. 管理
使用docker-compose进行安装
1. docker-compose.yml
version: "3" services: zero: image: dgraph/dgraph:latest volumes: - /tmp/data:/dgraph ports: - 5080:5080 - 6080:6080 restart: on-failure command: dgraph zero --port_offset -2000 --my=zero:5080 server: image: dgraph/dgraph:latest volumes: - /tmp/data:/dgraph ports: - 8080:8080 - 9080:9080 restart: on-failure command: dgraph server --my=server:7080 --memory_mb=2048 --zero=zero:5080 ratel: image: dgraph/dgraph:latest volumes: - /tmp/data:/dgraph ports: - 8081:8081 command: dgraph-ratel
2. 启动
docker-compose up -d
3. 管理
浏览器打开http://ip:8081 按照提示输入连接的server http://ip:8080[/code]
4. 使用a. 添加数据 curl localhost:8080/mutate -H "X-Dgraph-CommitNow: true" -XPOST -d $' { set { _:luke <name> "Luke Skywalker" . _:leia <name> "Princess Leia" . _:han <name> "Han Solo" . _:lucas <name> "George Lucas" . _:irvin <name> "Irvin Kernshner" . _:richard <name> "Richard Marquand" . _:sw1 <name> "Star Wars: Episode IV - A New Hope" . _:sw1 <release_date> "1977-05-25" . _:sw1 <revenue> "775000000" . _:sw1 <running_time> "121" . _:sw1 <starring> _:luke . _:sw1 <starring> _:leia . _:sw1 <starring> _:han . _:sw1 <director> _:lucas . _:sw2 <name> "Star Wars: Episode V - The Empire Strikes Back" . _:sw2 <release_date> "1980-05-21" . _:sw2 <revenue> "534000000" . _:sw2 <running_time> "124" . _:sw2 <starring> _:luke . _:sw2 <starring> _:leia . _:sw2 <starring> _:han . _:sw2 <director> _:irvin . _:sw3 <name> "Star Wars: Episode VI - Return of the Jedi" . _:sw3 <release_date> "1983-05-25" . _:sw3 <revenue> "572000000" . _:sw3 <running_time> "131" . _:sw3 <starring> _:luke . _:sw3 <starring> _:leia . _:sw3 <starring> _:han . _:sw3 <director> _:richard . _:st1 <name> "Star Trek: The Motion Picture" . _:st1 <release_date> "1979-12-07" . _:st1 <revenue> "139000000" . _:st1 <running_time> "132" . } } ' | python -m json.tool | less b. 查询(query) curl localhost:8080/query -XPOST -d $' { me(func:allofterms(name, "Star Wars")) @filter(ge(release_date, "1980")) { name release_date revenue running_time director { name } starring { name } } } ' | python -m json.tool | less
4. 参考资料https://docs.dgraph.io/get-started/#step-1-install-dgraph
相关文章推荐
- orientdb 图数据库docker 安装试用
- Centos下安装docker-compose
- 14. 试用vSphere 6(三):安装vCenter 6(独立数据库)之:域控服务器安装与配置
- [置顶] docker-compose教程(安装,使用, 快速入门)
- docker-compose 工具安装
- Ubuntu15.10安装docker和docker-compose教程
- docker-compose 安装redis sentinel,共享主机网络模式
- centos 7安装docker,docker-compose,docker镜像加速
- 在Win10上安装试用Docker
- ubuntu下安装docker-compose
- 安装docker-compose
- Linux 安装Docker Compose
- 在CentOS7上安装docker compose
- 【翻译】使用Docker Compose一键安装安装Mesos
- 15. 试用vSphere 6(三):安装vCenter 6(独立数据库)之:数据库服务器安装与配置
- 安装docker、machine、compose、virtualbox|kvm
- Centos7 安装docker-compose
- CentOS6.x 安装 Docker 和 Docker Compose
- ubuntu下安装docker-compose
- 安装Docker-compose