0
votes

I have my log files on EC2 instance and want to load it to Redshift. Two questions:

  1. Do I have to copy this log file to S3 before proceeding or can I directly copy from my EBS Volume.

  2. I can see I can use copy command from SQL Workbench or Data Pipeline. But can I use it from my EC2 instance itself ? Which AWS CLI I need to install?

http://docs.aws.amazon.com/cli/latest/reference/redshift/ does not list copy command

3

3 Answers

0
votes
  1. Not really. Redshift allows you to copy from a remote host, which, in your case, would be your EC2 instance. Documentation here.
  2. The link you've referred to provides cluster management commands. To run SQL queries on your cluster, you can use the psql tool. Documentation here.
0
votes
  1. you can copy the data directly from EC2, but my recommendation is to save it first on S3 , also for a backup
0
votes

All the documentation available online was confusing me. Finally the solution was that I wrote a simple Java file with DriverManager.getConnection() and calling copy command via stmt.executeUpdate() and it worked seamlessly. Only executeUpdate() did not return me number of records Inserted.