You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by "Brady, John" <jo...@intel.com> on 2015/03/10 10:55:46 UTC

installing Phoenix using AWS-EMR

Hi,

I'm installing Phoenix using AWS-EMR as described at the end of this link

http://java.dzone.com/articles/apache-phoenix-sql-driver

During setup you define the bootsrap action to load Phoenix onto your AWS EMR cluster.

I've a 2 questions.


1.       The bootstrap action installs phoenix 2.2.0 - how do you get it to install the latest release?


2.       If your using a JDBC connection which IP address should you connect to? Is it the master node?

Thanks

This is my code:

import java.sql.*;

public class PhoenixJDBC {

     public static void main(String args[]) {

     try {
         //Register JDBC Driver
         Class.forName("org.apache.phoenix.jdbc.PhoenixDriver").newInstance();

         Connection conn = DriverManager.getConnection("jdbc:phoenix:54.xx.xx.xx","","");

         //Create a Statement class to execute the SQL statement
         Statement stmt = conn.createStatement();

         //Execute the SQL statement and get the results in a Resultset
         ResultSet rs = stmt.executeQuery("select * from US_POPULATION");

         // Iterate through the ResultSet, displaying two values
         // for each row using the getString method

         while (rs.next())
             System.out.println("Name= " + rs.getString("host"));
     }
     catch (SQLException e) {
         e.printStackTrace();
     }
     catch (Exception e) {
         e.printStackTrace();
     }
     }
     }


-------------------------------------------------------------
Intel Ireland Limited (Branch)
Collinstown Industrial Park, Leixlip, County Kildare, Ireland
Registered Number: E902934

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

RE: installing Phoenix using AWS-EMR

Posted by "Brady, John" <jo...@intel.com>.
Thanks Krishna.

If you have the scripts that would be very helpful.

John

From: Krishna [mailto:research800@gmail.com]
Sent: Tuesday, March 10, 2015 6:56 PM
To: user@phoenix.apache.org
Subject: Re: installing Phoenix using AWS-EMR

Latest version available on EMR is 0.94, so, you can upgrade phoenix to 3.x, however, EMR's default bootstrap script doesn't do that.
Download and save phoenix binaries to your S3 bucket, modify the EMR bootstrap script to install 3.x, save it to your S3 bucket and add it as a bootstrap action. I did something like this a while ago and will send it across if I find the scripts.
Here is the reference: https://github.com/awslabs/emr-bootstrap-actions/blob/master/phoenix/install-phoenix-bootstrap.sh


On Tue, Mar 10, 2015 at 2:55 AM, Brady, John <jo...@intel.com>> wrote:
Hi,

I’m installing Phoenix using AWS-EMR as described at the end of this link

http://java.dzone.com/articles/apache-phoenix-sql-driver

During setup you define the bootsrap action to load Phoenix onto your AWS EMR cluster.

I’ve a 2 questions.


1.       The bootstrap action installs phoenix 2.2.0 – how do you get it to install the latest release?


2.       If your using a JDBC connection which IP address should you connect to? Is it the master node?

Thanks

This is my code:

import java.sql.*;

public class PhoenixJDBC {

     public static void main(String args[]) {

     try {
         //Register JDBC Driver
         Class.forName("org.apache.phoenix.jdbc.PhoenixDriver").newInstance();

         Connection conn = DriverManager.getConnection("jdbc:phoenix:54.xx.xx.xx","","");

         //Create a Statement class to execute the SQL statement
         Statement stmt = conn.createStatement();

         //Execute the SQL statement and get the results in a Resultset
         ResultSet rs = stmt.executeQuery("select * from US_POPULATION");

         // Iterate through the ResultSet, displaying two values
         // for each row using the getString method

         while (rs.next())
             System.out.println("Name= " + rs.getString("host"));
     }
     catch (SQLException e) {
         e.printStackTrace();
     }
     catch (Exception e) {
         e.printStackTrace();
     }
     }
     }



-------------------------------------------------------------
Intel Ireland Limited (Branch)
Collinstown Industrial Park, Leixlip, County Kildare, Ireland
Registered Number: E902934

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-------------------------------------------------------------
Intel Ireland Limited (Branch)
Collinstown Industrial Park, Leixlip, County Kildare, Ireland
Registered Number: E902934

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Re: installing Phoenix using AWS-EMR

Posted by Krishna <re...@gmail.com>.
Latest version available on EMR is 0.94, so, you can upgrade phoenix to
3.x, however, EMR's default bootstrap script doesn't do that.
Download and save phoenix binaries to your S3 bucket, modify the EMR
bootstrap script to install 3.x, save it to your S3 bucket and add it as a
bootstrap action. I did something like this a while ago and will send it
across if I find the scripts.
Here is the reference:
https://github.com/awslabs/emr-bootstrap-actions/blob/master/phoenix/install-phoenix-bootstrap.sh


On Tue, Mar 10, 2015 at 2:55 AM, Brady, John <jo...@intel.com> wrote:

>  Hi,
>
>
>
> I’m installing Phoenix using AWS-EMR as described at the end of this link
>
>
>
> http://java.dzone.com/articles/apache-phoenix-sql-driver
>
>
>
> During setup you define the bootsrap action to load Phoenix onto your AWS
> EMR cluster.
>
>
>
> I’ve a 2 questions.
>
>
>
> 1.       The bootstrap action installs phoenix 2.2.0 – how do you get it
> to install the latest release?
>
>
>
> 2.       If your using a JDBC connection which IP address should you
> connect to? Is it the master node?
>
>
>
> Thanks
>
>
>
> This is my code:
>
>
>
> *import* java.sql.*;
>
>
>
> *public* *class* PhoenixJDBC {
>
>
>
>      *public* *static* *void* main(String args[]) {
>
>
>
>      *try* {
>
>          //Register JDBC Driver
>
>          Class.*forName*("org.apache.phoenix.jdbc.PhoenixDriver"
> ).newInstance();
>
>
>
>          Connection conn = DriverManager.*getConnection*(
> "jdbc:phoenix:54.xx.xx.xx","","");
>
>
>
>          //Create a Statement class to execute the SQL statement
>
>          Statement stmt = conn.createStatement();
>
>
>
>          //Execute the SQL statement and get the results in a *Resultset*
>
>          ResultSet rs = stmt.executeQuery("select * from US_POPULATION");
>
>
>
>          // Iterate through the ResultSet, displaying two values
>
>          // for each row using the getString method
>
>
>
>          *while* (rs.next())
>
>              System.*out*.println("Name= " + rs.getString("host"));
>
>      }
>
>      *catch* (SQLException e) {
>
>          e.printStackTrace();
>
>      }
>
>      *catch* (Exception e) {
>
>          e.printStackTrace();
>
>      }
>
>      }
>
>      }
>
>
>
>
>
> -------------------------------------------------------------
> Intel Ireland Limited (Branch)
> Collinstown Industrial Park, Leixlip, County Kildare, Ireland
> Registered Number: E902934
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>