-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to change path of postgresql_data_dir and etcd_data_dir #790
Comments
I recommend leaving the etcd on the system disk and the database data on a dedicated one Avoid storing etcd or consul data on the same disk as other resource-intensive processes, like the database. Ensure that etcd/consul and PostgreSQL data are stored on separate disks (etcd_data_dir, consul_data_path variables), and use SSDs if possible. https://postgresql-cluster.org/docs/overview/recommendations#distributed-consensus-store-dcs
Please attach etcd logs. https://postgresql-cluster.org/docs/management/basic-commands#etcd
Do not change the value of |
hi @vitabaks , Thanks for the reply. My ETCD and PostgresNode are on different servers, so their data wont be at the same disk. In this case, is changing etcd_data_dir to /data/var/lib/etcd should work? I will try on the solution for pgpass that you mentioned. Thank you. |
yes, it should work and if there is an error, then logs are needed for analysis. |
I face similar issue on task Prepare PostgreSQL | generate default postgresql config files I modified Debian.yml file to add in "/data", but postgresql_home_dir remain unchange.
This is the error hit. I tried same solution to run the task as root user by editing patroni main.yml file but no luck.
Am I doing something wrong on the file? |
Judging by the log, there is a problem at the pg_createcluster stage and not when creating the pgpass file, so this is not related.
But it is not yet clear why there is no access to the directory, although we first create a directory with the necessary rights.
P.S. You've chosen a slightly strange data path, I usually use something like: postgresql_data_dir: "/data/{{ postgresql_version }}/{{ postgresql_cluster_name }}" |
This should not be the case, since the variable is common to all nodes, then the data path should be set the same for all nodes. So that I can help you, please attach the following
|
Please find attached ansible log and configuration file patroni.yml (from all nodes). Sorry to say I can't attach the entire postgresql_cluster directory because it is on protected VM and I failed to scp out.
For your information, I am setting up cluster with 3 pgnodes and 3 etcd without haproxy. And I am using version 1.11.0 branch. |
hi @vitabaks , If I use console GUI to deploy the cluster, is it possible to change the postgresql_data_dir? |
Not at the moment. This will be provided in one of the next releases where there will be an Expert Mode. |
A strange situation, I checked the patroni configuration and there is one path for all nodes
Try to remove PGDATA and cluster information from DCS and deploy the cluster again pg_dropcluster 16 main
rm -rf /data/postgresql/16/main
patronictl remove postgres-cluster |
If you are using vip-manager, make sure that the version is not lower than 2.6.0 |
hi @vitabaks ,
Would like to double check with you, is the line |
If you see this error, then the Patroni REST API for endpoint ' Code: https://github.com/vitabaks/postgresql_cluster/blob/1.11.0/roles/patroni/tasks/main.yml#L948 |
Those issues seems due to my pgnodes are on different VLAN and subnets, they can't use the same VIP when failover. Is assigning 2 VIPs possible? |
Yes, you can make two groups of HAProxy load balancers using keepalived. To do this, create two inventory files and specify the This method is often used when creating a cluster in several data centers/regions. P.S. If you require individual support or assistance in implementing this solution, please consider joining our sponsorship program, which offers tailored support for sponsors https://postgresql-cluster.org/docs/sponsor |
I had found another approach for my cluster. Appreciate and thanks for the assistance! |
Hi @vitabaks ,
I am trying to deploy the cluster on /data path.
I modified
etcd_data_dir
in vars/main.yml from/var/lib/etcd
to/data/var/lib/etcd
. But the etcd will fail to start.Beside, I tried to change
postgresql_data_dir
in vars/Debian.yml into/data/var/lib/postgresql/....
, but it showsFailed to get information on remote file (/data/var/lib/postgresql/.pgpass): Permission denied
.Please find below images:
May I know if have any other files that I need to change etcd and postgresql directory to make this work?
Thank you.
The text was updated successfully, but these errors were encountered: