eagle后端数据库改为postgres

eagle默认的是mysql数据库;修改为pg,然后测试

把eagle需要用到的表从mysql语法转换成postgres语法的建表语句,并在postgres中建好这些表

1、修改配置文件

conf/eagle.conf
注意driverClass是org开头,开始写成com报错

##change to postgres testing
 jdbc {
    adapter = "postgresql"
    username = "postgres"
    password = "postgres"
    database = "eagle"
    driverClass = "org.postgresql.Driver"
    connectionUrl = "jdbc:postgresql://db:5432/eagle"
    connectionProps = "encoding=UTF-8"
    connectionMax = 8
  }
}

##change to postgresql testing
metadata {
  store = org.apache.eagle.metadata.store.jdbc.JDBCMetadataStore
  jdbc {
    username = "postgres"
    password = "123456"
    driverClassName = org.postgresql.Driver
    database = "eagle"
    connection = "jdbc:postgresql://db:5432/eagle"
  }
}

2、添加postgres的driver


首先解压driver的jar文件
然后把postgresql文件夹拖到eagle-topology-0.5.0-SNAPSHOT-assembly.jar 包中
最后把eagle-topology-0.5.0-SNAPSHOT-assembly.jar包替换掉,重启eagle

3、测试新建Site和Application

4、重启eagle,看到之前建立的Site和Application都还在,而且postgres数据库表中有相应的数据,说明修改成功

猜你喜欢

转载自blog.csdn.net/zwahut/article/details/90603086