I recently installed the heroku dev database. Then when I type into the command line heroku pg:info I get THREE databases.
=== SHARED_DATABASE (DATABASE_URL)
Data Size 808k
=== HEROKU_POSTGRESQL_BRONZE
Plan Dev
Status available
Connections 1
PG Version 9.1.3
Created 2012-05-14 17:47 UTC
Tables 0
Conn Info "host=XXXXXX.compute-1.amazonaws.com
port=5432 dbname=resourceXXXXX
user=abcXXXXX sslmode=require
password=XXXXXXXXX"
=== HEROKU_POSTGRESQL_CHARCOAL
Plan Dev
Status available
Connections 1
PG Version 9.1.3
Created 2012-05-13 19:08 UTC
Tables 0
Conn Info "host=XXXXXXX.compute-1.amazonaws.com
port=5432 dbname=resourceXXXXX
user=YYYYYY sslmode=require
password=XXXXXXXXXXXXXXXX"
=== HEROKU_POSTGRESQL_GREEN
Plan Dev
Status available
Connections 1
PG Version 9.1.3
Created 2012-05-13 19:06 UTC
Tables 0
Conn Info "host=XXXXXXXXXXXX.compute-1.amazonaws.com
port=5432 dbname=resourceXXXXXX
user=XXXXXXXXXX sslmode=require
password=XXXXXXXXXXXXXX"
The host, resource, user, and password are different for each.
Why are there three? What's the difference between them?
With the dev plan similar to the production plan you are able to add multiple databases. Each of these is a unique database and you can connect to each of them individually.
If you wished to remove a database if you did not intend to add three you could:
heroku addons:remove HEROKU_POSTGRESQL_GREEN
To promote one of those to your primary database you may:
heroku pg:promote HEROKU_POSTGRESQL_GREEN
You may also connect to each of them individually:
heroku pg:psql HEROKU_POSTGRESQL_RED
If you install the add-on multiple times it creates multiple entries. I deleted the app and readded the addon and now there is only one entry. I guess previously, I inadvertently added the addon multiple times.
Related
I am using docker containers bitnami/postgresql-repmgr:13.3.0-debian-10-r22 in order to enable automatic failover for PostgreSql (I have 2 containers on 2 servers, one is the primary, the other a standby).
Our application (using springboot) is using this connection string for the Postgres replication:
postgres.host=xx.xx.x.140
postgres.port=1054
postgres.cluster=[xx.xx.x.140:5433 (http://xx.xx.x.140:5433)],[xx.xx.x.97:5433(http://xx.xx.x.97:5433)]
In case the Primary (140) fails, and repmgr will make 97 the primary, the application will try to connect to 140, will fail, and so will try the next string in the connection string, and will connect successfully to the new primary 97.
However, when I start the failed primary as standby, the application can connect to it, and does so, but returns errors on "read only".
I was thinking of using pgbouncer to overcome this problem, but I am not sure how and if it can be integrated into the repmgr container.
Anyone tried this combination?
Thanks
I am a bit new to postgresql db. I have done a setup over Azure Cloud for my PostgreSQL DB.
It's Ubuntu 18.04 LTS (4vCPU, 8GB RAM) machine with PostgreSQL 9.6 version.
The problem that occurs is when the connection to the PostgreSQL DB stays idle for some time let's say 2 to 10 minutes then the connection to the db does not respond such that it doesn't fulfill the request and keep processing the query.
Same goes with my JAVA Spring-boot Application. The connection doesn't respond and the query keep processing.
This happens randomly such that the timing is not traceable sometimes it happens in 2 minutes, sometimes in 10 minutes & sometimes don't.
I have tried with PostgreSQL Configuration file parameters. I have tried:
tcp_keepalive_idle, tcp_keepalive_interval, tcp_keepalive_count.
Also statement_timeout & session_timeout parameters but it doesn't change anyway.
Any suggestion or help would be appreciable.
Thank You
If you are setting up PostgreSQL DB connection on Azure VM you have to be aware that there are Unbound and Outbound connections timeouts . According to
https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections#idletimeout ,Outbound connections have a 4-minute idle timeout. This timeout is not adjustable. For inbound timeou there is an option to change in on Azure Portal.
We run into similar issue and were able to resolve it on client side. We changed Spring-boot default Hikari configuration as follow:
hikari:
connection-timeout: 20000
validation-timeout: 20000
idle-timeout: 30000
max-lifetime: 40000
minimum-idle: 1
maximum-pool-size: 3
connection-test-query: SELECT 1
connection-init-sql: SELECT 1
Just followed the steps in https://msdn.microsoft.com/en-us/library/ms143724.aspx to migrate a Reporting Services installation onto a new server (from and to SQL 2012 Standard Edition)
But when I'm ready to verify my deployment using the Report Manager web interface I get the error:
The feature: "Scale-out deployment" is not supported in this edition of Reporting Services. (rsOperationNotSupported)
Indeed when I go back to the Reporting Services Configuration manager, under Scale-out Deployment I have 2 servers, the one on the local server (new machine) and a reference to the old Server that has a different name. Problem is when I try to remove it tells me the task has failed:
Microsoft.ReportingServices.WmiProvider.WMIProviderException: Unable to connect to the Report Server . ---> System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable
I can understand why it's unavailable as it is on a different network all together. so my question is, how can I get rid of it so everything can finally work?
Found it. The way to remove the ghost server is to connect to the ReportServer database, and remove the old server from the dbo.Keys table.
After a restart of Reporting Services, the old server isn't in the list anymore.
USE ReportServer
go
select * from keys
--for safety added to the delete ghost machine if no recent executions in last 30 days.
delete from keys
where MachineName = 'YourGhostServer' --replace with your old server name, if multiple run one by one.
and MachineName not in (select substring(InstanceName,0,(charindex('\',InstanceName,0)))
from ExecutionLog
where timestart>getdate()-30
group by InstanceName)
CAREFUL, run the first part only with the select, analyze the output then copy the specific machine name value (old server name) you wish to delete into the where clause of the delete statement, replacing YourGhostServer verbiage.
Note, the Keys table may have legitimate machines that are network reachable and online. You can verify this by simply pinging them or checking if they run the SSRS Service, don't just simply delete from the table a server that's actually online, instead use the Report Server Manager to remove a Server that's online.
Deleting from the Keys table should only be done if the old machine is truly unreachable or has been decommissioned. At least, that's what I would do in my case. :)
my heroku app has dev plan
the app is useable and works and if I use pg:backups to download a backup and view it locally I can see that it has data..
however, when I do heroku pg:info it gives me 0 tables and 0 rows..
Connections: 0
Created: 2012-10-25 09:18 UTC
Data Size: 6.1 MB
Fork/Follow: Unavailable
PG Version: 9.1.6
Plan: Dev
Rows: 0/10000 (In compliance)
Status: available
Tables: 0
what's going on?
seems to resolve itself after a few days..
I have noticed that pg:info prints invalid data about your database when you create a new database with a new plan and you restore data into that new database from the old one. Especially the data size is shown as 0 even though it is the same size as your old database.
I observed this too. I just upgraded to a dev plan. It is really confusing.
I was able to "test" the upgrade on my staging app before doing it on production.
I would like to manage my Heroku database with pgadmin client. By now, I've been doing this with psql.
When I use data from heroku pg:credentials to connect de DB using pgadmin, I obtain:
An error has occurred:
Error connecting to the server: FATAL: permission denied for database
"postgres" DETAIL: User does not have CONNECT privilege.
How to achieve the connection?
Open the "Properties" of the Heroku server in pgAdminIII and change the "Maintenance DB" value to be the name of the database you want to connect to.
The default setup is suitable for DBAs et al who can connect to any database on the server, but apparently that isn't true in your case.
After you change the Maintenance DB name as suggested by araqnid's answer above, you should also add your database to the DB restrictions field because without this you will see thousands of databases and you may not be able to find yours in the list if the list is too long.
More details here - How to hide databases that I am not allowed to access
This is for pgAdmin 4
In order to connect pgAdmin to your database (postgres instance in Heroku), do the following:
Login to Heroku, and select the application in which you have the database
Select the Resources tab and then click on "Heroku Postgres Ad-on" (see below). This will open up a new tab.
Select the Settings tab and then click on "View Credentials..." (see below)
You will get the following information that you will use in pgAdmin:
Go to pgAdmin, and create a new server
In the General tab, give a useful name
In the Connection tab, fill the info you got at Heroku
In order to avoid seeing thousands of databases, you need to add your database name to DB restriction in the Advanced tab (see below)
We require SSL for connections outside Heroku. Please verify whether you're forcing SSL in your client.
Answered more thoroughly here: Connecting pgAdmin3 to Postgres on Heroku
We don't allow connections to the postgres database, so be sure to set Maintenance DB to your database name, and be sure to use SSL.
Change the Maintenance Database to the name of your Database, e.g. dva70000p0090. This should work.
the db password local isnt the same db password heroku. please check the heroku ip postgtres address and extrac