首页 > 解决方案 > Postgres db 的配置步骤

问题描述

我想构建并运行以下应用程序https://github.com/sdeleuze/geospatial-messenger

我对后端和数据库的经验很少,所以我需要一些指导来完成以下安装步骤:

在 application.yml 上自定义数据库配置。

应用程序.yml

logging:
  level:
    org.springframework.web.servlet: INFO
spring:
  datasource:
    platform: "postgis"
    driver-class-name: "org.postgis.DriverWrapper"
    url: "jdbc:postgresql_postGIS://localhost/geospatial-messenger"
    username: "postgres"
  mvc:
      async:
        request-timeout: 1000000

请概述我应该对我的数据库执行的步骤以根据文件对其进行配置。

我在 Ubuntu 18.04 上有 PostgreSQL 10

标签: postgresqlspring-boot

解决方案


After installation of PostgreSQL10, please follow the below steps :
1.  Login to root user, run this command su – postgres
2.  Locate the pg_hba.conf file by running select Query: select current_setting('hba_file');
3.  Modify the pg_hba.conf file
4.  Example : vim /prod/pgsql_10/pg_hba.conf command.
5.  Press insert key where you want to modify and save it using esc + :wq
Example: host   all    all   10.10.11.183/32   md5 
trust – without password authentication
md5 – with password authentication
6.  After modification, we should restart the postgres service using this command
systemctl restart postgresql-10.service
7.  Also modify the postgresql.conf file as same as pg_hba.conf file.
locate postgresql.conf
vim /prod/pgsql_10/postgresql.conf
8.  After modification, we should restart the postgres service using this command
systemctl restart postgresql-10.service
9.  To login postgres, run this command psql -U esb(user) postgres(DB)

推荐阅读