Saturday, June 6, 2015

Running Usergrid - Improved version with a portal that runs on NodeJS

This is a follow up to my earlier post 'Running Usergrid - Get started'. The Usergrid portal now runs on a NodeJS server and that post is somewhat deprecated.

This post assumes you just want to run Usergrid for an evaluation and has the basic steps to get started without having to fork on github to keep up to date with the latest code (that tutorial will follow in my blog hopefully). I don't like lengthy blogs, so here it is short and sweet:

Setup environment for Usergrid: 
Requirements
JDK 1.7: (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Maven => 3.0  (http://maven.apache.org/): Download and install Maven using the instructions on the Apache Maven website

Download the source from https://github.com/apache/incubator-usergrid
1) Click on 'Download ZIP' and save the code to your machine


Getting started: 

Once you have the source downloaded, navigate to the 'stack' folder and run the following Maven command: 
(you need to have your java path, maven path and maven repository setup for the command to be successful)

A successful build will show 'success' for all the sub-projects as shown below:


This will download the required dependencies to the Maven repository which are needed to build the Usergrid project.
Once that is done, we will go into the launcher folder and run the jar file with the command:


When the jar file is run you will see the following Graphical User Interface (GUI):


'Initialize Database on Start' will create an instance of the Cassendra back-end for you to play around. (Keep in mind however that unlike a proper instance, this stops when you stop the GUI above).


 Go ahead and press the Play button. The light icon will change color from red to orange to green. Green means that the setup was successful. 

Since the launcher is using the command prompt you are using, open up another one for the following steps.
To start your portal instance (navigate to the root>portal folder from the command prompt). As prerequisites you need to:
"
  1. Install Node.js from http://nodejs.org/download/.
  2. From the root directory, run ./build.sh dev.
  3. This will build and run a lightweight server. Naviate to http://localhost:3000
  4. If you have problems, it is often due to having an old version of Node.js installed or a port conflict for port 3000."
(https://github.com/apache/incubator-usergrid/tree/master/portal)

Running step 2 will show an output as shown below:

Wait for the commands to run and when the server is listening on port 300 you should see the following:

You are in business, now browser to: http://localhost:3000/?api_url=http://localhost:8080
You should see the login screen shown below:


The root>stack>rest project readme file has the credentials you can use to login the first time.
Username: superuser
Password: superuser

Once you successfully log in you will be prompted to take the tour. If not, you still have the option at the top of the page.
The tour will explain the different sections of the page. Some screenshots of the tour can be seen below:

Now it doesn't make sense to follow the tour on this blog does it ! get cracking, spin up your very own MBaaS and have fun ! 
If you have any questions, leave a comment and I will see what I can do.
Let me know if this post helped you.
Cheers.

Regards, 
Malaka (Usergrid Contributor)

No comments:

Post a Comment