🎉好消息!IvorySQL 库回归啦~

🎉好消息!IvorySQL 库回归啦~

严少安 Lv.6
ivorysql.png

IvorySQL 3.1 发版

先让我们来回一下时间线:

  • PostgreSQL 16

    • 2023-09-14, PostgreSQL 16.0 Released
    • 2023-11-09, PostgreSQL 16.1 Released
  • IvorySQL 3

    • 2023-11-17, IvorySQL 3.0 Released
    • 2024-01-26, IvorySQL 3.1 Released

再来看下 IvorySQL 3.2 的发版说明:

  1. 版本介绍

    [发行日期:2024年1月26日]

    IvorySQL 3.1 基于 PostgreSQL 16.1 ,包含来自 PostgreSQL 16.1 的各种修复。有关 PostgreSQL 16.1 中更详细的更新和错误修复,请参阅官方 PostgreSQL 16.1 发行说明 。

  2. 已知问题

    暂无

  3. 增强功能

    暂无

  4. 问题修复

    暂无

  5. 源代码

    IvorySQL主要包含2个代码仓库,数据库IvorySQL代码仓、IvorySQL网站仓:

  6. 贡献人员

    以下个人作为补丁作者、提交者、审阅者、测试者或问题报告者为本版本做出了贡献。

    • Grant Zhou
    • 矫顺田
    • 牛世继
    • 梁翔宇
    • 高雪玉
    • Cary Huang
    • David Zhang
    • 谭洋
    • 王杰
    • 穆帅楠
    • 张洪源
    • 王守波
    • 任娇
    • 刘政
    • 肖哲凯
    • 金华建
    • 王丽
    • 尚雷
    • 冯磊
    • 宋金周
    • Leo X.M. Zeng
    • 严少安
    • M.Imran Zaheer
    • Yunhe Xu
    • 王皓
    • 董小姐
    • 韩伟博

IvorySQL 3.1 编译安装

之前介绍过 IvorySQL 2.x/3.0 的编译安装,3.1 和 3.0 的步骤基本一致。

只是,这次的编译环境是在 Rocky Linux 9.3 上运行的 Rocky Linux 9.3 容器中。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[mysql@shawnyan ~]$ cat /etc/redhat-release
Rocky Linux release 9.3 (Blue Onyx)
[mysql@shawnyan ~]$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
shawnyan.cn/rl9-builder latest 9e887e48ed6c 4 hours ago 297 MB
shawnyan.cn/rl9-systemd latest be8b85ec9c17 4 hours ago 205 MB
docker.io/library/rockylinux 9.3 b72d2d915008 2 months ago 181 MB
[mysql@shawnyan ~]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b1547a08c6a1 shawnyan.cn/rl9-builder:latest /usr/lib/systemd/... 3 hours ago Up 3 hours shawnyan
[mysql@shawnyan ~]$ podman exec -it shawnyan bash
[root@shawnyan /]#
[root@shawnyan /]# cat /etc/redhat-release
Rocky Linux release 9.3 (Blue Onyx)
[root@shawnyan /]# uname -a
Linux shawnyan 5.14.0-362.13.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 13 14:07:45 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@shawnyan /]# gcc --version
gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

编译步骤也很简单,下面是主要步骤:

1
2
3
4
5
6
export IVORY_VERSION=3.1
wget https://github.com/IvorySQL/IvorySQL/archive/refs/tags/IvorySQL_$IVORY_VERSION.tar.gz
tar zxf IvorySQL_$IVORY_VERSION.tar.gz
cd IvorySQL-IvorySQL_$IVORY_VERSION
./configure --prefix=/opt/ivorysql-$IVORY_VERSION --with-extra-version="-ShawnYan"
make && make install

编译完成后,进行数据目录初始化:

1
initdb

输出结果如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[root@shawnyan /]# cd /data/ivorysql-3.1/
[root@shawnyan ivorysql-3.1]# ls -al
total 68
drwx------ 19 ivorysql ivorysql 4096 Feb 2 07:35 .
drwxr-xr-x 4 ivorysql ivorysql 46 Feb 2 07:40 ..
-rw------- 1 ivorysql ivorysql 3 Feb 2 07:17 PG_VERSION
drwx------ 6 ivorysql ivorysql 46 Feb 2 07:17 base
drwx------ 2 ivorysql ivorysql 4096 Feb 2 07:29 global
-rw------- 1 ivorysql ivorysql 718 Feb 2 07:17 ivorysql.conf
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_commit_ts
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_dynshmem
-rw------- 1 ivorysql ivorysql 5779 Feb 2 07:19 pg_hba.conf
-rw------- 1 ivorysql ivorysql 2640 Feb 2 07:17 pg_ident.conf
drwx------ 4 ivorysql ivorysql 68 Feb 2 07:35 pg_logical
drwx------ 4 ivorysql ivorysql 36 Feb 2 07:17 pg_multixact
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_notify
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_replslot
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_serial
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_snapshots
drwx------ 2 ivorysql ivorysql 25 Feb 2 07:35 pg_stat
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_stat_tmp
drwx------ 2 ivorysql ivorysql 18 Feb 2 07:17 pg_subtrans
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_tblspc
drwx------ 2 ivorysql ivorysql 6 Feb 2 07:17 pg_twophase
drwx------ 3 ivorysql ivorysql 92 Feb 2 07:23 pg_wal
drwx------ 2 ivorysql ivorysql 18 Feb 2 07:17 pg_xact
-rw------- 1 ivorysql ivorysql 88 Feb 2 07:17 postgresql.auto.conf
-rw------- 1 ivorysql ivorysql 29841 Feb 2 07:18 postgresql.conf
-rw------- 1 ivorysql ivorysql 31 Feb 2 07:23 postmaster.opts
[root@shawnyan ivorysql-3.1]#

启动数据库:

1
2
3
4
5
6
7
8
9
10
11
12
[ivorysql@shawnyan ~]$ pg_ctl start
waiting for server to start....2024-02-02 07:23:37.656 UTC [11422] LOG: starting PostgreSQL 16.1-ShawnYan (IvorySQL 3.1) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2), 64-bit
2024-02-02 07:23:37.656 UTC [11422] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-02-02 07:23:37.656 UTC [11422] LOG: listening on IPv6 address "::", port 5432
2024-02-02 07:23:37.661 UTC [11422] LOG: listening on IPv6 address "::1", port 1521
2024-02-02 07:23:37.661 UTC [11422] LOG: listening on IPv4 address "127.0.0.1", port 1521
2024-02-02 07:23:37.661 UTC [11422] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2024-02-02 07:23:37.665 UTC [11422] LOG: listening on Unix socket "/tmp/.s.PGSQL.1521"
2024-02-02 07:23:37.676 UTC [11425] LOG: database system was shut down at 2024-02-02 07:23:30 UTC
2024-02-02 07:23:37.681 UTC [11422] LOG: database system is ready to accept connections
done
server started

连接 IvorySQL 数据库:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[ivorysql@shawnyan ~]$ psql
psql (16.1-ShawnYan)
Type "help" for help.

ivorysql=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+---------+---------+------------+-----------+-----------------------
ivorysql | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | |
postgres | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | |
template0 | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | | =c/ivorysql +
| | | | | | | | ivorysql=CTc/ivorysql
template1 | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | | =c/ivorysql +
| | | | | | | | ivorysql=CTc/ivorysql
(4 rows)

ivorysql=# select version();
version
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 16.1-ShawnYan (IvorySQL 3.1) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2), 64-bit
(1 row)

ivorysql=#

惊喜的是,在 IvorySQL 3.0 中,已经被移除的 ivorysql 库又重新加回来了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[ivorysql@shawnyan ivorysql-3.0]$ psql
2024-02-02 07:42:30.310 UTC [20979] FATAL: database "ivorysql" does not exist
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "ivorysql" does not exist
[ivorysql@shawnyan ivorysql-3.0]$ createdb ivorysql
[ivorysql@shawnyan ivorysql-3.0]$ psql
psql (16.0-ShawnYan)
Type "help" for help.

ivorysql=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+---------+---------+------------+-----------+-----------------------
ivorysql | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | |
postgres | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | |
template0 | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | | =c/ivorysql +
| | | | | | | | ivorysql=CTc/ivorysql
template1 | ivorysql | UTF8 | libc | C.UTF-8 | C.UTF-8 | | | =c/ivorysql +
| | | | | | | | ivorysql=CTc/ivorysql
(4 rows)

ivorysql=#

到此,IvorySQL 3.1 已安装完成,并顺利启动。

另外,需要注意的是,由于 IvorySQL 3 支持双端口策略,所以可以在 postgresql.conf 文件中配置 pg 模式的监听地址,以及在 ivorysql.conf 文件中配置 ora 模式的监听地址,默认为 localhost,这里改为 * 监听所有地址。

1
2
3
4
[root@shawnyan ivorysql-3.1]# grep listen_addr postgresql.conf
listen_addresses = '*'
[root@shawnyan ivorysql-3.1]# grep listen_addr ivorysql.conf
ivorysql.listen_addresses = '*'
1
2
3
4
5
6
7
[ivorysql@shawnyan ~]$ ss -antpl
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 200 0.0.0.0:5432 0.0.0.0:* users:(("postgres",pid=21040,fd=6))
LISTEN 0 200 0.0.0.0:1521 0.0.0.0:* users:(("postgres",pid=21040,fd=8))
LISTEN 0 200 [::]:5432 [::]:* users:(("postgres",pid=21040,fd=7))
LISTEN 0 200 [::]:1521 [::]:* users:(("postgres",pid=21040,fd=9))
[ivorysql@shawnyan ~]$

OK, 简单做个小结,IvorySQL 3.1 是 IvorySQL 3.x 系列在 2024 年发布的第一个版本,支持 pg/ora 双模式双端口,合并了若干 PostgreSQL 16.1 中修复的问题,并将 IvorySQL 3.0 中移除的 ivorysql 库重新加回。

相关阅读

logo.jpg
  • Title: 🎉好消息!IvorySQL 库回归啦~
  • Author: 严少安
  • Created at: 2024-02-02 19:24:42
  • Updated at: 2024-02-11 12:00:01
  • Link: https://shawnyan.cn/2024/ivorysql/ivorysql-3.1-released/
  • License: This work is licensed under CC BY-NC-SA 4.0.
 Comments