orientdb docker-compose 运行

orientdb 很早就跑过,但是现在在跑,发现配置有些变动,原有studio 直接就可以访问的,新版本的居然还需要自己添加
server 的配置,所以为了方便使用docker-compose 运行,写了一个简单的文档

环境准备

  • docker-compose 文件
version: "3"
services:
   db:
     image: orientdb:2.2.37
     environment:
     - "ORIENTDB_ROOT_PASSWORD=dalongdemo"
     tty: true
     volumes: 
     - "./config:/orientdb/config"
     - "./databases:/orientdb/databases"
     - "./backup:/orientdb/backup"
     - "./db:/db"
     ports: 
     - "2424:2424"
     - "2480:2480"
  • server 配置文件

    config/orientdb-server-config.xml 目录,添加了http 协议的支持,以及对于studio 的配置,注意用户密码的配置,实际可能需要修改

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orient-server>
    <network>
        <protocols>
            <protocol implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" name="binary"/>
            <protocol implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb" name="http"/>
        </protocols>
        <listeners>
            <listener protocol="binary" socket="default" port-range="2424-2430" ip-address="0.0.0.0"/>
            <listener protocol="http" ip-address="0.0.0.0" port-range="2480-2490" socket="default">
                <commands>
                    <command implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent" pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg GET|*.json GET|*.woff GET|*.ttf GET|*.svgz" stateful="false">
                        <parameters>
                            <entry value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" name="http.cache:*.htm *.html"/>
                            <entry value="Cache-Control: max-age=120" name="http.cache:default"/>
                        </parameters>
                    </command>
                    <command implementation="com.orientechnologies.orient.graph.server.command.OServerCommandGetGephi" pattern="GET|gephi/*" stateful="false"/>
                </commands>
                <parameters>
                    <parameter name="network.http.additionalResponseHeaders" value="Access-Control-Allow-Origin: *;Access-Control-Allow-Credentials: true" />
                    <parameter value="utf-8" name="network.http.charset"/>
                </parameters>
            </listener>
        </listeners>
    </network>
    <storages/>
    <users>
        <user resources="*" password="{PBKDF2WithHmacSHA256}1F6763F962A356A29160C9F28FAB727AEF5A1EBCAF9A9721:339276E284B1BACAA6DCF8EC95C3D64CF42712FBE431D230:65536" name="root"/>
        <user resources="connect,server.listDatabases,server.dblist" password="{PBKDF2WithHmacSHA256}7414C4E97F069FA122B46718318E183566D4E368CDB772FC:31A6BB41FCE5CE448325EC332632850A8B0F90871212D498:65536" name="guest"/>
    </users>
    <security>
        <users/>
        <resources/>
    </security>
    <isAfterFirstTime>true</isAfterFirstTime>
</orient-server>

运行&&测试

  • 启动
docker-compose up -d

说明

具体orientdb 的操作可以参考官方文档

参考资料

https://orientdb.com/
https://github.com/rongfengliang/orientdb-docker-compose

posted on 2019-04-18 15:53  荣锋亮  阅读(841)  评论(0编辑  收藏  举报

导航