Large data visualization insights Davinci installation and configuration Raiders

Davinci can be used independently as a public cloud / private cloud can be integrated as a plug-in to visualize the tripartite system. Users simply visualized UI simple configuration can serve a variety of data visualization applications, and support for advanced interactive / industry analysis / pattern exploration / social intelligence visualization capabilities.

First, prepare the environment

  • JDK 1.8 (or later)
  • MySql5.5 (or later)
  • Mail Server
  • PhantomJs (please refer to installation: phantomjs.org)
  • Redis (optional)

Second, configuration deployment

1) initialize the directory, the downloaded Davinci package (Release package, Source packets, not) extract to a directory system, such as: ~ / app / davinci

cd ~/app/davinci
unzip davinci-assembly_3.0.1-0.3.0-SNAPSHOT-dist.zip

After extracting the directory structure as shown below:

Large data visualization insights Davinci installation and configuration Raiders

2) configure the environment variables, the above-described directory configuration to extract the environment variable DAVINCI3_HOME

export DAVINCI3_HOME=~/app/davinci/davinci-assembly_3.0.1-0.3.0-SNAPSHOT-dist

3) initialize the database, modify the information in the database to be initdb.sh bin directory for the database to be initialized, such as davinci0.3

mysql -P 3306 -h localhost -u root -proot davinci0.3 < $DAVINCI3_HOME/bin/davinci.sql

Run the script to initialize the database (Note: Due to Davinci0.3 system contained in the database stored procedure, be sure to execute permissions given when creating a database). **

sh bin/initdb.sh

4) initial configuration, Davinci0.3 configuration includes: server, datasource, mail, phantomjs, cache configuration, etc.

Enter config directory, rename the beginning of the application.yml.example after application.yml to configure.

cd config
mv application.yml.example application.yml

Note: Since version 0.3 ymal as the application configuration file format, make sure that there is at least between the colon and the value of each configuration item after a key space

server configuration

server:
  protocol: http
  address: 127.0.0.1
  port: 8080

  access:
    address: 192.168.1.1
    port: 80

As shown in the example configuration server, server.access.address and server.access.port represent real address and access port, the default is not turned on, the default value and server.address server.port.

As you deploy virtual host Davinci, start port is 8080, the IP address of the host access real 192.168.1.1, you will host the 8080 virtual port mapping to port 80, you need to open access configuration items, otherwise it will not work properly Davinci Some features, such as activating an account, download, share and so on.

datasource configuration

Configuration of datasource herein Davinci system data source, configured as follows:

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/davinci0.3?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
    username: root
    password: root
    driver-class-name: com.mysql.jdbc.Driver
    initial-size: 2
    min-idle: 1
    max-wait: 60000
    max-active: 10

The last step is to initialize the configuration database to address the url, the url parameters do not make any changes, and then modify the correct user and password database access, ie username and password.

initial-size, min-idle, max-wait, max-active connection pool parameters, refer to specific attributes property list configuration DruidDataSource

mail configuration

Note: version 0.3 uses a registered user activates way to maintain, so the mail configuration is essential in this release, and mail configuration higher error rate, be sure to pay attention

spring:
  mail:
    host: smtp.****.com
    port: 25
    username: example@***.com
    password: example_password
    nickname: Davinci

    properties:
      smtp:
        starttls:
          enable: true
          required: true
        auth: true
      mail:
        smtp:
          ssl:
            enable: false

mail configuration is not complicated, the above is a complete mail configured, username is the email address, password mail service password needs to be noted that the common free email (such as 163 mailboxes, QQ-mail, gmail, etc.) where the client should fill in a separate password, You can go to the corresponding email account settings page to open the SMTP service, and the client application authorization code (or a separate password, a different name for each mailbox providers).

The following table is a common free-mail service address and SMTP port:

Large data visualization insights Davinci installation and configuration Raiders

phantomjs Configuration

phantomjs is used to periodically send the report shots, only you need to configure executable phantomjs installed to address, such as:

phantomjs_home: /usr/local/bin/phantomjs

cache configuration (optional)

as used herein redis cache caching service, configured as follows:

spring:
    redis:
      isEnable: false
      host: 10.143.131.119
      port: 6379

    #  cluster:
    #       nodes:

      password:
      database: 0
      timeout: 1000
      jedis:
        pool:
          max-active: 8
          max-wait: 1
          max-idle: 8
          min-idle: 0

If you want to open the cache service, please isEnable set to true, and you want to set configuration (single mode open the host and port, the cluster approach open cluster configuration items, the two can only choose one).

Other configurations

Log configuration file config / logback.xml, such as the current log configuration does not meet your requirements, custom configuration log mode.

Third, the data source configuration

Davinci0.3 理论上支持所有有 JDBC 的数据源,我们默认支持的数据源有:

数据源名称 驱动类
mysql com.mysql.jdbc.Driver
oracle oracle.jdbc.driver.OracleDriver
sqlserver com.microsoft.sqlserver.jdbc.SQLServerDriver
h2 org.h2.Driver
phoenix org.apache.phoenix.jdbc.PhoenixDriver
mongodb mongodb.jdbc.MongoDriver
elasticSearch – presto com.facebook.presto.jdbc.PrestoDriver
moonbox moonbox.jdbc.MbDriver
cassandra com.github.adejanovski.cassandra.jdbc.CassandraDriver
clickhouse ru.yandex.clickhouse.ClickHouseDriver
kylin org.apache.kylin.jdbc.Driver
vertica com.vertica.jdbc.Driver
hana com.sap.db.jdbc.Driver
impala com.cloudera.impala.jdbc41.Driver

值得注意的是,Davinci 内部只提供了 MySql 的驱动包,也就是说,如果你要使用其他数据源,还需将对应驱动jar 包手动拷贝到lib目录并重新启动 Davinci 服务;Davinci 连接 ElasticSearch 目前使用 NLPchina提供的elasticsearch-sql,系统内部默认 ElasticSearch 版本为5.3.2,对应的 elasticsearch-sql 版本是5.3.2.0。

同理,如果你的 ElasticSearch 不是5.3.2,首先需要你手动下载 NLPchina 提供的对应版本的 jar,然后替换掉目前lib下的 jar,包括elasticsearch-xxx.jar、transport-xxx.jar、x-pack-api-xxx.jar、 x-pack-transport-xxx.jar、elasticsearch-sql-XXX.jar(xxx表示你的 ElasticSearch 版本号,XXX表示NLPchina 对应 elasticsearch-sql 版本号)。

另外值得注意的是,如果你的数据源不在以上列表中,也可以通过自定义配置注入数据源,否则没必要开启,除非你知道在做什么:

1)打开自定义数据源配置文件

mv datasource_driver.yml.example datasource_driver.yml

2)如下配置你的数据源,这里以 postgresql 为例

postgresql:
   name: postgresql
   desc: postgresql
   driver: org.postgresql.Driver
   keyword_prefix:
   keyword_suffix:
   alias_prefix: \"
   alias_suffix: \"

注意

  • keyword_prefix和keyword_suffix表示关键字前缀和后缀,假设使用 mysql 数据库,并将desc关键字作为字段使用,那么你的查询语句应该是:select desc from table 这里的 ‘`’ 就是前后缀,它们必须成对被配置,可以都为空。

  • alias_prefix和alias_suffix表示别名前后缀,仍以 mysql 为例,假设你的 sql 语句如下:select column as '列' from table
    。这里为 ‘column’ 起了别名为‘列’,那么‘’’将作为前后缀配置,前后缀必须成对被配置,可以都为空。

  • 对于以上别名配置,你可以使用''将字符包起来,也可以使用转移符\,二者只能出现一种。

3)手动将相应的驱动 jar 包拷贝到lib目录下。

4)重启 Davinci 服务。

开源地址https://github.com/edp963/davinci

Reference documents -Davinci User Manual : https://edp963.github.io/davinci/

Guess you like

Origin blog.51cto.com/14159827/2427615