部署配置

Davinci部署只需要简单的几步配置即可,中间涉及到数据库初始化的问题,也已经给出了命令。不用担心,现在就开始吧。

Server端

  • 上传davinci zip包到系统某个目录下 并解压,例如. /app/davinci。解压之后的目录结构如下图所示:部署配置 - 图1

主要的配置项包括:mysqldb(请确保连接地址的正确性,初始化数据库时也会用到!!!)、httpServer(ps:如需接入ldap或者cache,可继续加入ldap、cache的相关配置)

  1. unzip davinci-assembly_2.11-0.1.0-SNAPSHOT-dist.zip
  2. cd conf
  3. mv application.conf.example application.conf
  4. vim application.conf

数据库配置项

  1. mysqldb {
  2. profile = "slick.jdbc.MySQLProfile$"
  3. db {
  4. url = "jdbc:mysql://localhost:3306/db?useSSL=false"
  5. user = ""
  6. password = ""
  7. profile = com.mysql.jdbc.Driver
  8. keepAliveConnection = true
  9. numThreads = 5
  10. }
  11. }

httpServer配置项

  1. httpServer {
  2. host = "localhost"
  3. port = 8080
  4. }

ldap配置项

  1. ldap {
  2. isEnable = false
  3. url = ""
  4. dc = ""
  5. user = ""
  6. pwd = ""
  7. read.timeout = "5000"
  8. connect {
  9. timeout = "5000"
  10. pool = true
  11. }
  12. }

cache配置项

  1. cache {
  2. isEnable = true
  3. url: "127.0.0.1:6379"
  4. auth:""
  5. expire:300
  6. mode:"stand-alone"
  7. }

配置log的存放位置(可配置为绝对路径)

  1. vi conf/log4j.properties
  • 配置DAVINCI_HOME
  1. vi /etc/profile
  2. export DAVINCI_HOME=/app/davinci
  3. source /etc/profile
  • 上传mysql-connector-java-{version}.jar到 $DAVINCI_HOME/lib

  • 初始化数据库(只在首次启动时需要进行初始化)

  1. cd /app/davinci/bin
  2. vi initdb.sh

修改port、ip、user、password与application.conf里mysqldb的配置一致即可

  1. sh initdb.sh

配置并且初始化完成后就可以启动davinci server了。