顯示具有 PostgreSQL 標籤的文章。 顯示所有文章
顯示具有 PostgreSQL 標籤的文章。 顯示所有文章

2020年7月18日 星期六

locate: 無法執行 stat()「/var/lib/mlocate/mlocate.db」: 沒有此一檔案或目錄

需要先執行updatedb


[root@db ~]# locate postgresql.conf
locate: 無法執行 stat()「/var/lib/mlocate/mlocate.db」: 沒有此一檔案或目錄
[root@db ~]# updatedb
[root@db ~]# locate postgresql.conf
/etc/postgresql-setup/upgrade/postgresql.conf
/usr/lib/tmpfiles.d/postgresql.conf
/usr/share/pgsql/postgresql.conf.sample
/var/lib/pcp/pmdas/postgresql/pmdapostgresql.conf
/var/lib/pgsql/data/postgresql.conf
[root@db ~]#
[root@db ~]# locate pg_hba.conf
/usr/share/pgsql/pg_hba.conf.sample
/var/lib/pgsql/data/pg_hba.conf
[root@db ~]#

 
LAB環境: CentOS-8.2.2004

2020年7月5日 星期日

AD server和DB透過DNS SRV達成高可用性

※本文章只是網路找到的解決方案,尚未實測或導入 ※

https://serverfault.com/questions/374154/how-to-make-ad-highly-available-for-applications-that-use-it-as-an-ldap-service

The correct way to do this is to use the DNS SRV records to look up the domain controller names and ports, as well as ascertain which servers to use in what order. Unfortunately, not many LDAP applications seem to support SRV record lookups.
The SRV record for Active Directory domain controllers is _ldap._tcp.domain.tld. This will return a list of hosts and ports, as well as a priority and weight for each (these values can be set using Group Policy) that together indicate which server to use.


也意外發現資料庫也開始支援DNS SRV的方式達成高可用性
MySQL 8.0.19
https://mp.weixin.qq.com/s/G3dW_GPDd1l1MJ86c7iFTA
我还在想这事儿就应该由 MySQL Connector 来实现访问链路的 Failover 和 Loadbalance, 现在有了 DNS SRV 的支持,router 不必和应用端绑定部署,也可以省了 VIP 和负载均衡,MySQL InnoDB Cluster 方案更加完善,配合 consul 等服务发现组件,更容易适配 service mesh 架构。

PostgreSQL 12.0
https://mp.weixin.qq.com/s/hGeGiqm3D52aQJsS61QoGg

2016年4月17日 星期日

2016年4月16日 星期六

各種資料庫List All Tables

How to List All Tables and Describe Tables in Oracle, MySQL, DB2 and PostgreSQL
http://onewebsql.com/blog/list-all-tables

2012年7月21日 星期六

2012年7月17日 星期二

CentOS 6.2設定postgresql 筆記


[root@localhost ~]# /etc/init.d/postgresql start

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
                                                           [FAILED]

[root@localhost ~]# service postgresql initdb
Initializing database:                                     [  OK  ]

設定參數檔
[root@localhost data]# vi /var/lib/pgsql/data/postgresql.conf

設定登入權限檔
[root@localhost data]# vi /var/lib/pgsql/data/pg_hba.conf

設定完再啟動
[root@localhost ~]# /etc/init.d/postgresql start
Starting postgresql service:                               [  OK  ]


p.s.設定開機啟動
chkconfig postgresql on

Converting from other Databases to PostgreSQL

http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL

2012年6月30日 星期六