DB wal file disabled --_Query

2024-11-13 Thread jayakumar s
Hi Team,

We have disabled walfile ion database level. While I do manual switch wal
file generating in wal file location.

Here is my question if we disable it. Walfile won't generate am i correct?

Kindly clarify my doubts.

postgres=# select name,setting from pg_settings where name like 'archive%';
  name   |  setting
-+
 archive_command | (disabled)
 archive_mode| off
 archive_timeout | 0
(3 rows)

postgres=#

postgres=# SELECT pg_switch_wal();
 pg_switch_wal
---
 D/9D00
(1 row)

[postgres@x pg_wal]$ ls -lrt
total 81920
drwx--. 2 postgres postgres6 Oct 13  2020 archive_status
-rw---. 1 postgres postgres 16777216 Nov 13 20:47
0001000D009F
-rw---. 1 postgres postgres 16777216 Nov 13 20:50
0001000D00A0
-rw---. 1 postgres postgres 16777216 Nov 13 20:51
0001000D00A1
-rw---. 1 postgres postgres 16777216 Nov 13 21:02
0001000D009D
-rw---. 1 postgres postgres 16777216 Nov 13 21:02
0001000D009E
[postgres@# pg_wal]$


Re: DB Switchover using repmgr--Error

2024-11-26 Thread jayakumar s
Hi Paul,

Thanks for your help. I have fixed that issue. Now I am getting one more
issue. Can you help to fix the below error?

[postgres@post1 bin]$ /usr/pgsql-16/bin/repmgr -f
/var/lib/pgsql/repmgr.conf cluster show
WARNING: node "standby" not found in "pg_stat_replication"
 ID | Name| Role| Status| Upstream  | Location | Priority |
Timeline | Connection string
+-+-+---+---+--+--+--+-
 1  | primary | primary | * running |   | default  | 100  | 8
 | host=192.168.29.193 user=repmgr dbname=repmgr connect_timeout=2
 2  | standby | standby |   running | ! primary | default  | 100  | 8
 | host=192.168.29.9 user=repmgr dbname=repmgr connect_timeout=2

WARNING: following issues were detected
  - node "standby" (ID: 2) is not attached to its upstream node "primary"
(ID: 1)

[postgres@post1 bin]$

On Tue, Nov 26, 2024 at 3:41 PM Paul Foerster 
wrote:

> Hi,
>
> > [postgres@post1 bin]$ ./repmgr -f /var/lib/pgsql/repmgr.conf primary
> register
> > ERROR: following errors were found in the configuration file:
> >   syntax error in file "/var/lib/pgsql/repmgr.conf" line 3, near token
> "data_directory"
> >   syntax error in file "/var/lib/pgsql/repmgr.conf" line 6, near token
> "log_file"
> > [postgres@post1 bin]$
> >
> > Conf file:
> >
> > [postgres@post1 data]$ cat /var/lib/pgsql/repmgr.conf
> > node_id=1
> > node_name=primary
> > conninfo='host=192.168.29.193 user=repmgr dbname=repmgr
> connect_timeout=2' data_directory='/application/pgsql/data'
> failover=automatic
> > promote_command='/usr/pgsql-16/bin/repmgr standby promote -f
> /var/lib/pgsql/repmgr.conf --log-to-file'
> > follow_command='/usr/pgsql-16/bin/repmgr standby follow -f
> /var/lib/pgsql/repmgr.conf --log-to-file --upstream-node-id=%n'
> > pg_bindir='/usr/pgsql-16/bin' log_file='/usr/pgsql-16/repmgr.log'
> > [postgres@post1 data]$
>
> I'm not a repmgr guru but at first glance I would say that your config
> lacks two line breaks. It should probably look like this:
>
> node_id=1
> node_name=primary
> conninfo='host=192.168.29.193 user=repmgr dbname=repmgr connect_timeout=2'
> data_directory='/application/pgsql/data'
> failover=automatic
> promote_command='/usr/pgsql-16/bin/repmgr standby promote -f
> /var/lib/pgsql/repmgr.conf --log-to-file'
> follow_command='/usr/pgsql-16/bin/repmgr standby follow -f
> /var/lib/pgsql/repmgr.conf --log-to-file --upstream-node-id=%n'
> pg_bindir='/usr/pgsql-16/bin' log_file='/usr/pgsql-16/repmgr.log'
>
> Cheers
> Paul


Re: DB wal file disabled --_Query

2024-11-14 Thread jayakumar s
Hi All,

Archive mode is already disabled. If more wal files will generate fs also
reached 100 percent based on application data load.

As updated archive enabled or disabled. Will any state wall file that
will be generate correct?

On Wed, Nov 13, 2024 at 9:54 PM Adrian Klaver 
wrote:

> On 11/13/24 08:15, jayakumar s wrote:
> > Hi Team,
> >
> > We have disabled walfile ion database level. While I do manual switch
> > wal file generating in wal file location.
> >
> > Here is my question if we disable it. Walfile won't generate am i
> correct?
> >
> > Kindly clarify my doubts.
> >
> > postgres=# select name,setting from pg_settings where name like
> 'archive%';
> >name   |  setting
> > -+
> >   archive_command | (disabled)
> >   archive_mode| off
> >   archive_timeout | 0
> > (3 rows)
>
> The above is disabling the archiving of WAL files to another location.
> WAL will still be written to pg_wal.
>
> What are you trying to achieve?
>
> You can  specify individual tables be UNLOGGED as shown here:
>
> https://www.postgresql.org/docs/current/sql-createtable.html
>
> "UNLOGGED
>
>  If specified, the table is created as an unlogged table. Data
> written to unlogged tables is not written to the write-ahead log (see
> Chapter 28), which makes them considerably faster than ordinary tables.
> However, they are not crash-safe: an unlogged table is automatically
> truncated after a crash or unclean shutdown. The contents of an unlogged
> table are also not replicated to standby servers. Any indexes created on
> an unlogged table are automatically unlogged as well.
>
>  If this is specified, any sequences created together with the
> unlogged table (for identity or serial columns) are also created as
> unlogged.
> "
>
>
>
>
> >
> > postgres=#
> >
> > postgres=# SELECT pg_switch_wal();
> >   pg_switch_wal
> > ---
> >   D/9D00
> > (1 row)
> >
> > [postgres@x pg_wal]$ ls -lrt
> > total 81920
> > drwx--. 2 postgres postgres6 Oct 13  2020 archive_status
> > -rw---. 1 postgres postgres 16777216 Nov 13 20:47
> > 0001000D009F
> > -rw---. 1 postgres postgres 16777216 Nov 13 20:50
> > 0001000D00A0
> > -rw---. 1 postgres postgres 16777216 Nov 13 20:51
> > 0001000D00A1
> > -rw---. 1 postgres postgres 16777216 Nov 13 21:02
> > 0001000D009D
> > -rw---. 1 postgres postgres 16777216 Nov 13 21:02
> > 0001000D009E
> > [postgres@# pg_wal]$
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>
>


DB Switchover using repmgr--Error

2024-11-25 Thread jayakumar s
Hi Team,

I have tried to configure DB switch over using repmgr. Post updated repmgr
file then tried to register in primary db but getting the below error.

Kindly check and let me know to fix the issue.

*Error:*

[postgres@post1 bin]$ ./repmgr -f /var/lib/pgsql/repmgr.conf primary
register
ERROR: following errors were found in the configuration file:
  syntax error in file "/var/lib/pgsql/repmgr.conf" line 3, near token
"data_directory"
  syntax error in file "/var/lib/pgsql/repmgr.conf" line 6, near token
"log_file"
[postgres@post1 bin]$

*Conf file:*

[postgres@post1 data]$ cat /var/lib/pgsql/repmgr.conf
node_id=1
node_name=primary
conninfo='host=192.168.29.193 user=repmgr dbname=repmgr connect_timeout=2'
data_directory='/application/pgsql/data' failover=automatic
promote_command='/usr/pgsql-16/bin/repmgr standby promote -f
/var/lib/pgsql/repmgr.conf --log-to-file'
follow_command='/usr/pgsql-16/bin/repmgr standby follow -f
/var/lib/pgsql/repmgr.conf --log-to-file --upstream-node-id=%n'
pg_bindir='/usr/pgsql-16/bin' log_file='/usr/pgsql-16/repmgr.log'
[postgres@post1 data]$