20
Page 1 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X Installing and Configuring the Hortonworks ODBC driver on Mac OS X May 28, 2013 Summary This document describes how to install and configure the Hortonworks ODBC driver on Mac OS X. After you install and configure the ODBC driver, you will be able to access Hortonworks sandbox data using Excel. In this procedure, we will use Microsoft Excel 2011 to access Hortonworks sandbox data. You should also be able to access sandbox data using other versions of Excel. The process may not be identical in other versions of Excel, but it should be similar. Prerequisites: Mac running OS X Hortonworks Sandbox 1.2 (installed and running) Excel 2011 Overview To install and configure the Hortonworks ODBC driver on Mac OS X: 1. Download and install the Hortonworks ODBC driver for Mac OS X. 2. Download and install the iODBC Driver Manager for Mac OS X. 3. Configure the Hortonworks ODBC driver 4. Open Excel and test the connection to the Hortonworks sandbox.

Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 1 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

Installing and Configuring the Hortonworks ODBC driver on Mac OS X May 28, 2013 Summary This document describes how to install and configure the Hortonworks ODBC driver on Mac OS X. After you install and configure the ODBC driver, you will be able to access Hortonworks sandbox data using Excel. In this procedure, we will use Microsoft Excel 2011 to access Hortonworks sandbox data. You should also be able to access sandbox data using other versions of Excel. The process may not be identical in other versions of Excel, but it should be similar. Prerequisites:

• Mac running OS X

• Hortonworks Sandbox 1.2 (installed and running)

• Excel 2011

Overview To install and configure the Hortonworks ODBC driver on Mac OS X:

1. Download and install the Hortonworks ODBC driver for Mac OS X. 2. Download and install the iODBC Driver Manager for Mac OS X. 3. Configure the Hortonworks ODBC driver 4. Open Excel and test the connection to the Hortonworks sandbox.

Page 2: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 2 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

Step 1 – Download and Install the Hortonworks ODBC Driver for Mac OS X

1. Open a web browser and navigate to http://hortonworks.com/download/. Click the Add-Ons link at the bottom of the Hortonworks Data Platform 1.2 box.

2. On the Add-Ons page, scroll down to Hortonworks Hive ODBC Driver (Windows + Mac) and select Mac OS X (dmg).

Page 3: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 3 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

3. Review the Hortonworks license, then click Accept Agreement.

4. A confirmation message appears. Click OK to open the file with the Disk Image Mounter.

Page 4: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 4 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

5. When the download is complete, the driver package will appear in a new window. Double-click (or right-click with the mouse) the driver package, then select Open.

6. To start the installation, click Continue on the ODBC Driver Installer Welcome screen.

Page 5: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 5 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

7. Review the license agreement, then click Continue.

8. Click Agree on the pop-up message to agree to the license terms.

Page 6: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 6 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

9. Click Install to accept the default installation folder.

10. A progress indicator appears while the driver is being installed.

Page 7: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 7 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

11. When the installation is complete, the Driver Installer displays a confirmation message.

Click Close to close the installer.

Now that you have installed the Hortonworks ODBC driver for Mac OS X, the next step is to install the iODBC Driver Manager for Mac OS X.

Step 2 – Download and Install the iODBC Driver Manager for Mac OS X

1. Open a web browser and navigate to: http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/Downloads Scroll down to the Mac OS X section and select the applicable installer package.

Note: In this tutorial, we successfully installed the latest available version of the iODBC driver for Mac OS X (10.5 Leopard, 10.6 Snow Leopard) on a MacBook Pro running OS X 10.8.3.

Page 8: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 8 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

2. Click Save File on the confirmation pop-up message.

Page 9: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 9 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

3. When the installer file download is complete, double-click the file, then select Open.

4. The driver package appears in a new window. Double-click the driver package, then

select Open.

Page 10: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 10 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

5. To start the installation, click Continue on the ODBC Driver Installer Welcome screen.

6. Review the Read Me information, then click Continue.

Page 11: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 11 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

7. Review the license agreement, then click Continue.

8. Click Agree on the pop-up message to agree to the license terms.

Page 12: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 12 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

9. Click Install to accept the default installation folder.

10. When the installation is complete, the Driver Installer displays a confirmation message. Click Close to close the installer.

Page 13: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 13 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

Now that you have installed the iODBC Driver Manager for Mac OS X, the next step is to configure the Hortonworks ODBC .ini files.

Step 3 – Configure the Hortonworks ODBC Driver Overview To configure the Hortonworks ODBC driver:

1. Enable the Finder to view hidden files. 2. Configure the Hortonworks ODBC .ini files. 3. Set the DYLD_LIBRARY_PATH environmental variable.

Procedure In this procedure we will need to work with files that start with a period. Files that start with a period are considered to be hidden files, and are not usually visible with the Finder. We will run two Terminal commands to make these files visible with the Finder. Please note that these commands are case-sensitive.

1. Open Finder (or click an empty portion of the desktop) to display the Finder menu at the top of the screen. Select Go > Utilities > Terminal, then click Open to open a Terminal window.

2. In the Terminal window, type in the following command, then press the Enter key:

defaults write com.apple.Finder AppleShowAllFiles TRUE

3. In order for the changes to take effect, you must restart the Finder. To restart the Finder,

type the following command in the Terminal window, then press the Enter key.

killall Finder You will now be able to view hidden files using the Finder. If you would like to reset Finder later to hide hidden files, use the following Terminal commands to hide hidden files and restart the Finder: defaults write com.apple.Finder AppleShowAllFiles FALSE killall Finder

4. Use Go > Go to Folder or the Finder to navigate to the /usr/lib/hive/lib/native/hiveodbc/Setup directory. The Setup directory contains the following sample files:

• odbc.ini and odbcinst.ini – sample DSN setup files

• hortonworks.hiveodbc.ini – sample Hortonworks driver configuration file

5. Copy the hortonworks.hiveodbc.ini to the Home directory and rename the file as .hortonworks.hiveodbc.ini (insert a period at the beginning of the file name).

Page 14: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 14 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

6. In the Home directory, open the .hortonworks.hiveodbc.ini file with TextEdit in plain text mode. Confirm that the line containing the ODBCInstLib setting for the iODBC driver manager is uncommented (does not have a # symbol at the beginning of the line). The path should be set to the location of the libiodbcinst.dylib file by default.

7. Review the contents of the Home directory. If there are no .odbc.ini or .odbcinst.ini files in

the Home directory, copy the odbc.ini and .odbcinst.ini files from the /usr/lib/hive/lib/native/hiveodbc/Setup folder to the Home directory. Rename the files to .odbc.ini and .odbinst.ini (insert a period at the beginning of the file name).

Page 15: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 15 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

Use TextEdit in plain text mode to edit the configuration settings in the .odbc.ini file. The host settings should be set to the IP address of the sandbox. PORT should be set to 10000 (the default listening port). HS2AuthMech should be set to 2, and UserName should be set to the sandbox user name (in this case, the default user name “sandbox”).

8. If there is already an .odbc.ini or .odbcinst.ini file in the Home directory, copy the relevant settings from the odbc.ini and .odbcinst.ini sample files in the /usr/lib/hive/lib/native/hiveodbc/Setup folder to the files in the Home directory. Configure the settings as described in the previous step.

9. The final step is to add the /usr/lib/hive/lib/native/universal directory to the

DYLD_LIBRARY_PATH environment variable. Open a Terminal window and type the following command, then press the Enter key:

Launchctl setenv DYLD_LIBRARY_PATH /usr/lib/hive/lib/native/universal

This command will set the DYLD_LIBRARY_PATH variable only for the current session – you will need to run the command again each time you log in. To permanently set the DYLD_LIBRARY_PATH environmental variable, navigate to the /etc folder and add the following line to the launchd.conf file: setenv DYLD_LIBRARY_PATH /usr/lib/hive/lib/native/universal If there is no launchd.conf file in the /etc folder, you can use TextEdit to create a launchd.txt file, then rename it to launchd.conf. Note: You may need to be logged in as an administrator to edit files in the /etc folder.

Page 16: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 16 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

Now that you have configured the Hortonworks ODBC driver, the next step is to open Excel and test the connection to the Hortonworks sandbox.

Step 4 – Open Excel and Test the Connection to the Hortonworks Sandbox

1. Open a new Excel workbook, then select Data > Get External Data > New Database Query.

2. On the iODBC Data Source Chooser window, select the Hortonworks ODBC data source,

then click Test.

Page 17: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 17 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

3. On the Login pop-up, type “sandbox” in the Username box, then click Ok.

4. It may take several seconds for the connection to be established. After the connection is established, a confirmation message appears. Click OK to close the message.

Page 18: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 18 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

Now that you have configured the Hortonworks ODBC driver, you can use Excel to access data in the Hortonworks sandbox.

5. Open a new Excel workbook, then select Data > Get External Data > New Database

Query.

6. On the iODBC Data Source Chooser window, select the Hortonworks ODBC data source, then click OK.

7. On the Login pop-up, type “sandbox” in the Username box, then click Ok. The Microsoft

Query window and the Tables pop-up box appear.

8. In the Tables pop-up box, select a table, then click Add Table. The table will appear in the top section of the Microsoft Query window. It may take several seconds for the table to appear.

Notes

• The tables listed in the pop-up have been previously created in the Sandbox with a Create new table command using either HCatalog or Beeswax (Beeswax >Tables).

Page 19: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 19 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

• In this tutorial, we selected the omniture table previously created in the “Loading Data into the Hortonworks Sandbox” tutorial, but you can select any available table.

9. To preview the table data, select the table in the Field drop-down, then click Test. The data will appear in the lower section of the Microsoft Query window. It may take several seconds for the data to appear.

Page 20: Installing and Configuring the Hortonworks ODBC Driver ...hortonworks.com/wp-content/uploads/2013/05/Installing...commands are case-sensitive. 1. Open Finder (or click an empty portion

Page 20 of 20 Installing and Configuring the Hortonworks ODBC driver on Mac OS X

10. To import the data into Excel, click Return Data at the bottom right of the Microsoft Query Window, then click OK on the Returning Data to Microsoft Excel pop-up box.

11. The table data will appear in the Excel workbook.