I’d like to finally deploy the first version of my first meteor app. It’s an app with mongodb and file upload and those files need a persistent storage (I’m using Meteor-files).
I’d like to use Galaxy to deploy the app and Atlas:mongodb for the db. First Question: Would I need something else to save the files persistently?
First I went to atlas and created an cluster and did the “Get started”-introduction
Now the part about connect your cluster is what I have to do next?
When it came to the options I clicked on “Connect your Application” - I don’t know if that would be the right thing to do. I know from PHP that there are database-connectors, would be a connection string the same thing?
Is this string the MONGO_URL it wants? At this point this project is still in an local environment. If all of that would be right, is there still something missing regarding configuring access to the Mongodb?
Setup
Before you begin, configure access to your MongoDB database and set up any environment variables your app depends on.
For your first question, for file uploads you will need another service where the files can be stored.
For Galaxy you want something like the following setup. Disregard any additional parameters in the connection string after the database name and you should be fine.
But when I try to “npm run production”, an error occurs
> DEPLOY_HOSTNAME=eu-west-1.galaxy.meteor.com meteor deploy ddcalpha.com --owner Kuroki --settings settings.json
Der Befehl "DEPLOY_HOSTNAME" ist entweder falsch geschrieben oder
konnte nicht gefunden werden. // translation: The command "DEPLOY_HOSTNAME" is written wrong or couldn't be found
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ddc@ production: `DEPLOY_HOSTNAME=eu-west-1.galaxy.meteor.com meteor deploy ddcalpha.com --owner Kuroki --settings settings.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ddc@ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\NERV\AppData\Roaming\npm-cache\_logs\2019-08-27T23_01_40_963Z-debug.log
C:\Users\NERV\Desktop\Projekte\DDCFull>
Because environment variables are set differently between *nix and windows, you’ll need to use a tool like cross-env to set the env var inline in your script.
After installing with npm npm i cross-env, you’ll need to use it in your script like so:
Also, I think you accidentally copied your connection string including your password in the last post. I’ve edited it out and hidden the edit so others can’t see the original, but you should probably change the mongo password anyway
Jeez, I shouldn’t ask for help when I’m that tired. Thank you … l changed it right away.
Now it does something but it gives me this error:
Error deploying application: Your account is not authorized to deploy to Galaxy.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ddc@ production: `cross-env DEPLOY_HOSTNAME=eu-west-1.galaxy.meteor.com meteor deploy ddcalpha.com --owner Kuroki --settings settings.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ddc@ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\NERV\AppData\Roaming\npm-cache\_logs\2019-08-28T04_38_51_368Z-debug.log
I logged in with my meteor account, so I’m not sure what the authorization problem could be?
Those are additional settings for MongoDB that are set properly inside the Meteor mongo packages when the connection is initialized. If you left it there you would run into errors.
Not sure why the deploy script is failing. The only strange thing I can see is that there is Node 10 being used, while current Meteor uses Node 8, but in this instance I don’t think that should matter. But since its Windows I have no clue.
Atlas has given you a modern connection string (‘mongodb+srv…’). I’ve had issues with this. In the Atlas UI, there’s an option to get a connection string in an older format. I’d give that a shot. Has helped me in the past.
I either do deployments completely manually on an EC2 instance or use MUP, depending on the project lifetime and scale.
We often do once-off projects that only last a few days or weeks and it’s easier to just whack it up on an existing EC2 with a wildcard DNS record pointing to it.
Things that last a bit longer or will be regularly updated get their own instance and deployed with MUP
For the larger project we’re working on, we’re looking at hosting it on Galaxy when it’s ready
M10 is a size of an instance. You see it when setting size of the container on Atlas.
You can set Galaxy Professional in your deployment settings on Galaxy. The most important thing it gives you is IP whitelisting, which you need for Galaxy and performance monitoring. It is a bit more expensive than Galaxy Essential, but worth it given the increased security and monitoring.
Ah, thanks, thought it was some kind of npm package.
I whitelisted my own IP address in atlas already. I mean, I just want to test my app, it’s not even done yet. I would like to stay on Essential. It almost sounds like I need this pro Level to deploy my app? Since I want to have the costs as low as possible for now, I also want to stay at the Sandbox cluster for now. If this wouldn’t work, I don’t see why that would be an offer.
No, essential works just fine. You won’t have IP addresses to whitelist in Atlas, so you will have to open that to every IP if you want to connect to Atlas from your Galaxy deployment.