Redis in production with Node.js - node.js

It may be trivial question but I need to be sure. I have made node/express app with redis connected as a cache manager. All works fine in dev environment. But how to run this in prod? I'm deploying it on Heroku. On development I'm installing redis with brew package menager, then installing it redis client with npm. How can I set up/mimic this process on remote server on production, f.ex. Heroku?

Use Heroku Redis or RedisCloud provided as addons on heroku.By cost redis cloud may be efficient but I would recommend using heroku Redis as aquarium you can connect and execute all command via cli.

Related

Deploy nodejs from CI server to production

I have a CI server which handle to build the node app. It's separated. And once the build is done I want to deploy my node app to the production server. But I have to deploy the node modules as well.
Ofcourse I can run npm install command on the remote server, but it makes the production server to "work" on something that is else of serving the app.
How can I deploy nodejs bundle to production server without bringing all of the node modules, but just a prepared bundle?
Is this possible?

How to connect local Postgres database not synchronizing to Heroku production database

I have an application deployed on Heroku but for some reason when I create the database locally it does not get applied to the actual database on heroku and I'm not sure why this is happening.
I've install Postgres locally via the web app and I also installed using Brew Install Postgres.

How do I setup Apache CouchDB to run on Heroku?

I have a node.js RESTful API that is using Apache CouchDB for it's NoSQL database. I am new to Heroku and just deployed my API to Heroku instance. However, the startup failed because it couldn't connect to CouchDB. I have researched how to setup CouchDB on Heroku but haven't found anything that works.
I found this buildpack but it doesn't exist any longer: https://elements.heroku.com/buildpacks/aindeev/heroku-buildpack-couchdb
I found this stack overflow post but there doesn't look to be a solution provided: Host couchdb on heroku
Can someone help provide me with some instructions on how I can host couchdb on heroku?
If you are at the step of creating an app you can do the following
heroku create --buildpack https://github.com/creativegeekjp/heroku-buildpack-couchdb.git
and thereby create the app with the couchdb buildpack installed.
however if you already have the app what you can do is
heroku config:add BUILDPACK_URL="https://github.com/creativegeekjp/heroku-buildpack-couchdb.git" -a YOUR_APP
The -a YOUR_APP is optional, you probably don't need it considering you're probably in a folder you've initialized as a heroku app when you add the buildpack.
Or the easier
heroku buildpacks:set https://github.com/creativegeekjp/heroku-buildpack-couchdb.git
after which you have to run
git push heroku master
to deploy your buildpack

Nodejs and Meteor on OpenShift

I have a mobile (Ionic 2) chat application with the following implementation, that uses nodejs-0.10 and MongoDB 3.2.7 and Meteor 1.4.1.1. It works perfectly on my localhost.
Now I need to deploy it to an OpenShift server. I have followed the following steps and created a server on OpenShift with Meteor. It is connecting with Git, and I can push my code to the server.
I am pretty sure the Meteor server is running on OpenShift, because I saw something to that effect on the startup logs (via ssh). However, I am not sure how to connect to the Meteor server to test it.
The domain is nodejs-easyjobs.rhcloud.com (54.208.77.250) on the OpenShift server, I can ping this successfully.
I am using Ionic 2 to build the mobile app. I am currently just running on Android, but plan to add iOS and Windows.
I am following this tutorial, and it runs on localhost. However, I am not sure where this is configured. I guess localhost is default, and you need to change it to a different host if needs be.
If I check my OpenShift server (nodejs-easyjobs.rhcloud.com) via ssh, I can see that the contents of the Meteor bundle directory is on the server. So Git is pushing the code.
The part I don't understand is:
Do I need to configure Meteor differently for being on the OpenShift
Server? Or do I just leave it as is?
Where do I configure the client
(Ionic 2) to point to the OpenShift server?
Question:
My question is, how do I configure my mobile app (Ionic 2) to connect to the OpenShift Meteor Server?
UPDATE:
My dir structure:
openshift-appname
.../ionic-apps/nodejs/bundle/server/...
meteorapp
.../ionic-aps/myIonicApp/api/.meteor/...
.../ionic-aps/myIonicApp/api/server/...
The contents of the .../ionic-apps/nodejs is cloned on the OpenShift server with Git.
I followed this tutorial to deploy the Meteor bundle to OpenShift. `
So I used the following to build my Meteor app:
> cd .../ionic-aps/myIonicApp/
> meteor build .../ionic-apps/nodejs --directory --server-only
As far as I can see, I may be wrong, but the Meteor Server is all correct and running on OpenShift. I need to know how I can get my Ionic2 app to access it.
Step1: Find the access point to the Meteor server using the OpenShift
IP. i.e. nodejs-easyjobs.rhcloud.com (54.208.77.250).
Step2: Configure my Ionic2 client to use this.

Meteor deploy on Heroku Error deploying Node

I built a Meteor app, and it runs on my local machine, where I have meteor installed.
I have never deployed an app online, and am trying to put the app on heroku.
I first tried to use buildpack/jordansissel/heroku-buildpack-meteor.git, but I got an error "Meteor requires Node v0.10.41 or later"
I then tried to use buildpack/michaltakac/meteor-buildpack-horse.git but it failed to push because it couldn't unpack Node.
Lastly I've tried kevinseguin/heroku-buildpack-meteor.git but I get lots of warnings about npm depricated http://prntscr.com/bewzak
When I look at the logs it says "Slug compilation failed: failed to compile Node.js app"
I also get Error: MONGO_URL must be set in environment
I don't know enough to understand what the errors are, or how to get my app deployed
Image of errors: http://prntscr.com/bex0av
my goal it to get the site on gr-fireworks.herokuapp.com
I contacted Heroku helpdesk and they said they couldn't help me because the issue was outside the scope of Heroku Support.
I tried to reach out to Snap CI who said they were successful in deploying it, but when I try to type in exactly what they did, I am still getting the error about Node https://snap-ci.com/ankitsri11/Fireworks/branch/master/logs/defaultPipeline/1/Heroku?back_to=build_history
My repository I'm trying to deloy is on git at github.com/jschwarzwalder/Fireworks
From description of your problem I can conclude you need to do 2 things on your app's Heroku dashboard (Settings tab):
Add MONGO_URL environment variable that points to your Mongo DB database. You can create mongo instance on external service or use mLab Heroku addon (it has free plan).
So your environment variables may look like:
Also, you may need to add METER_SETTINGS if you use --settings settings.json and ROOT_URL - URL of you app gr-fireworks.herokuapp.com (is required).
Set this buildpack:
Ensure you have .git at the end of url.
Now you can deploy your app using single command (if you setup Heroku Toolbelt and heroku remote points Heroku's app repository):
$ git push heroku master

Resources