Skip to main content

Connect to Amazon Redshift from ArcGIS

To connect to an Amazon Redshift cloud data warehouse, install and configure client files to implement communication between ArcGIS Server and Redshift. For best performance, deploy the ArcGIS Server site in the Amazon cloud in the same region as the data warehouse.

Typically, IT professionals install the ArcGIS software and the drivers required to connect to the data warehouse. They also configure network, firewall, and other communication channels necessary to allow communication between ArcGIS and the cloud data warehouse.

Next, the administrator of the cloud data warehouse creates accounts and grants the accounts privileges to access specific tables in the cloud data warehouse. The administrator can create a connection to the cloud data warehouse and share the connection file with publishers, or the administrator can provide publishers with the credentials necessary to allow them to create their own connection files.

To publish ArcGIS Server web services that reference data in the cloud data warehouse, publishers must register the database connection file with an ArcGIS Server site that is federated with an ArcGIS Enterprise organization. To publish a web service with a snapshot, you must register the database connection file with the ArcGIS Enterprise deployment's hosting server.

Install and configure drivers

You must install the latest Amazon Redshift 64-bit ODBC driver on each ArcGIS Server machine. Use the latest Amazon Redshift 64-bit ODBC driver supported for the operating system of the machines on which the federated ArcGIS Server site is running.

Download the Amazon Redshift ODBC driver from the Amazon Web Services (AWS) website, and install it on all machines in the ArcGIS Server site to which you will publish. See the Amazon Redshift help for instructions to install and configure the ODBC driver.

Edit the init_user_param.sh script

If the federated ArcGIS Server sites to which you'll publish run on Linux machines, you must install the drivers on each machine in the GIS Server site and configure the init_user_param.sh script on each machine to access the drivers.

Alter the init_user_param.sh script installed with ArcGIS Server to reference the drivers. You can access this script by browsing to the <ArcGIS Server installation directory>/arcgis/server/usr directory.

  1. Ensure that the ArcGIS Server installation owner on each machine has at least read and execute permissions on the data warehouse client libraries.

  2. Open the init_user_param.sh script in a text editor.

  3. Remove the comment marks (#) from the line beginning with export, replace <Location_to_ODBC_driver_manager_libraries> with the location of the ODBC driver on the ArcGIS Server machine, and replace <Location_to_amazon.redshiftodbc.ini> with the location of the amazon.redshiftodbc.ini file on the machine.

    # -----------------------------------------------------------------------
    # Modify this section to configure Amazon Redshift ODBC connector
    #
    # -----------------------------------------------------------------------
    export LIB_ODBC_DRIVER_MANAGER=<Location_to_ODBC_driver_manager_libraries>/libodbc.so.2
    export AMAZONREDSHIFTODBCINI=<Location_to_amazon.redshiftodbc.ini>/amazon.redshiftodbc.ini
    
  4. Save and close the script.

  5. For the changes you made in the init_user_param.sh file to take effect, you must restart ArcGIS Server.

    To do this, run the stopserver.sh script, then run the startserver.sh script on each machine in the ArcGIS Server site.

    ./stopserver.sh

    ./startserver.sh

Create a database connection

You must have a database connection (.sde file) that authenticates the connection to the database.

You can call the ArcPy CreateDatabaseConnection function from one of the machines in the ArcGIS Server site that needs to connect to the database. See Create Database Connection in the ArcGIS Pro help for information about running this function.

Register the connection file

To allow ArcGIS Server sites to access the data, use the database connection file you created to add a registered data store in ArcGIS Pro or add a data store item in the portal.

To publish with the Create a snapshot for query layers configuration parameter enabled, you must register the database connection file with the hosting server. See the Configure parameters section of Configure a web feature layer in the ArcGIS Pro help for more information about this parameter.