Is it possible to replicate heroku postgres to aws postgres? how is it done?
Related
I want to host a database in Heroku server and also a django application. The problem is: To transfer data to my Heroku database i would need be connected to a VPN. Does Heroku provides a way to connect to a VPN in order to access another database, like AWS client VPN?
My infra would be like this:
Airflow running DAGs to pull data from a AWS database that requires VPN connection to source from it. I would transfer the data from this AWS database to my heroku database.
Is it possible?
Thank you
Another thing that i'm wondering is if it is possible to connect Heroku to AWS client VPN, in case Heroku does not have something similar or a way to do this step.
Yes Heroku does provides a VPN labelled as Heroku Private Spaces and Shield Spaces.
Here is the link
https://devcenter.heroku.com/articles/private-space-vpn-connection
This works for local redis-server
BullModule.forRoot({
redis: {
host: "localhost",
port: 6379,
db: 0,
password: ""
}
})
But if I use the DataStore Credentials on Heroku Redis, the bull board does not load and Heroku Logs gives an H12 error.
How can I get the BullModule to properly connect to Heroku Data for Redis?
Thanks!
You must specify the location of where redis is accessible. localhost:6379 is the default for running redis locally, but to deploy an application that uses Redis to Heroku, you will need to add the Connecting to Heroku Data for Redis add-on. Then, you'll need to pass the location of your Redis service via process.env.REDIS_URL to the BullModule.forRoot() constructor.
Be aware that encountering TLS issues in connecting to Redis like this are common. When I tried connecting using the format from PedroPovedaQ's answer, I ran into one.
There's a discusson on that here.
I suggest trying
BullModule.forRoot({
redis: "<redisurl given by heroku in env variable>"
})
This fixed the issue for me.
I'm learning redis and have it working from a java app. I'm trying to use the heroku redis:cli -a myAppName command to connect with it directly but it says "No Redis instances found".
When I do heroku apps it lists myAppName so I know it's valid.
heroku redis:info -a myAppName doesn't return anything.
The heroku docs don't seem to be accurate as they all leave out the -a flag which the cli tells me is required. Outside of that I don't know what I've missed.
You are looking at documentation for Heroku Redis, a hosted Redis service that Heroku itself provides. If you wish to use Heroku Redis, you can provision it for your app using like so:
heroku addons:create heroku-redis:hobby-dev -a your-app-name
Pricing for Heroku Redis can be found here. The Hobby Dev plan used in the previous command is free.
There are also other Redis providers that can be provisioned this way, including Redis Enterprise Cloud. Or you can use existing hosted Redis server. But with these options you won't be able to interact with the service using heroku redis commands. Use whatever tooling those providers offer.
I want to host an application in Heroku bu don't want to use a Heroku database. Can I connect to an existing remote database from my Heroku app?
You can use whatever database you like from Heroku as long as it is accessible from Heroku's platform.
Just set and use the proper env var in your app with your db's address and credentials and it should just work.
Where is your current database hosted? In short, the answer is likely yes. Heroku makes it really easy to connect to an Amazon RDS instance through a plugin. This is the same way many other database hosts provide connectivity, such as ClearDB or MongoLab. If you share where your current remote database is, it will be easier to give you more information.
I want to use mysql database which is hosted on my own server.
I've changed DATABASE_URL and SHARED_DATABASE_URL config vars to point to my server, but it's still trying to connect to heroku's amazonaws servers. How do I fix that?
According to the Heroku documentation, changing DATABASE_URL is the correct way to go.
If you would like to have your rails application connect to a non-Heroku provided database, you can take advantage of this same mechanism. Simply set your DATABASE_URL config var to point to any cloud-accessible database, and Heroku will automatically create your database.yml file to point to your chosen server. The Amazon RDS Add-on does this for you automatically, though you can also use this same method to connect to non-RDS databases as well.
Here's an example that should work:
heroku config:add DATABASE_URL=mysql://user:password#host/db
You may need to redeploy by making a change and running git push heroku master
By the way, the host is XXXX.amazonaws.com, where XXX is a long host hame that probably changes. If you can add a wildcard, that's the easiest %.amazonaws.com
I had this exact same problem with my Dreamhost MySQL database. Turns out the solution was to tell Dreamhost is was Ok to accept connections from this foreign host. Otherwise, Dreamhost blocks all requests to MySQL that don't originate from their systems.
It seems that if Heroku is falling back to Amazon AWS despite your DATABASE_URL, it's because it's being denied access to your MySQL database.