Typically, when using a feature service, the user requires that the data be stored in a spatial database. At the same time, you need to register the database with ArcGIS for Server so that you do not need to copy the data when you publish the service, which saves disk space and service release time. The following summarizes how the PostgreSQL database is used in desktop and server products on the ArcGIS platform, including the Linux version of ArcGIS for server and PostgreSQL, and the Windows edition of ArcGIS for Server and PostgreSQL.
1 Pre-conditions
1.1 ArcGIS Platform software supports operating system requirements
After the ArcGIS10.1 version, the operating system requirements for the ArcGIS for server product must be 64-bit. This requires attention, whether it's Windows or Linux. It is recommended that you verify that the current operating system meets the installation requirements of the current version of the software before installing the software. such as the ArcGIS for Server10.2 installation system requirements list: htp://resources.arcgis.com/zh-cn/help/system-requirements/10.2/index.html#/na/ 015100000072000000/
1.2 ArcGIS platform supports database system version requirements
Similarly, the ArcGIS platform software is not the same for different versions of database product support. Before installing the software, you need to verify that the current version of the software matches and is compatible with the version of the customer installation database software PRODUCT. Support for PostgreSQL data such as the ArcGIS10.2 platform is as follows: http://resources.arcgis.com/zh-cn/help/system-requirements/10.2/index.html#/ Na/015100000075000000/
PostgreSQL 9.0.5 (64-bit), PostgreSQL 9.1.3 (64-bit), PostgreSQL 9.2.2 (64-bit)
1.3 File permissions for software installation and database connection configuration
In the case of software installation or database connection configuration, it is often necessary to have appropriate permissions for the relevant files or directories, especially the Linux environment. Both the PostgreSQL software and the ArcGIS for Server software are installed with read and write access to the installation directory and its subdirectories. Generally by Chmod–r 777/home/arcgis/arcgisserver to set. Check for permissions issues when software installation or configuration errors occur.
1.4 ArcGIS Platform Connect to database software common sense
Generally speaking, database software is divided into server side and client. For an ArcGIS engineer, configuring a database connection is essentially configuring client connection information for different database platforms in different operating system environments. For the database connection configuration of ArcGIS for desktop, you need to install or configure a free-install database client on this machine that installs desktop, and you need to set up environment variables and database listening information on the machine installed on the database software. It is important to note that the Desktop Connection database requires a 32-bit client or a related library file. For the database connection configuration of ArcGIS for server, it is necessary to install or configure a 64-bit database client or a related library file on the machine where the server is installed before registering the database.
2 ArcGIS Platform Connection PostgreSQL database Windows edition
2.1 Windows version of PostgreSQL database configuration
For the Windows version of the PostgreSQL database, you need to configure the connection settings for the database after the installation is complete. The default path for the configuration file is required: C:\Program files\postgresql\9.2\data. The configuration files are pg_hba.conf and postgresql.conf.
2.1.1 pg_hba.conf Configuration
Machine information that can be connected to the database The default configuration allows only native connections. # IPV4 Local Connections:host All 127.0.0.1/32 MD5 add additional connections allow 10.1.1.0~10.1.1.255 network segment login database: Host all all 10.1.1.0/24 MD5 Add Trust 192.168.1.10 Login database: Host all 192.168.1.10/32 trust allows all machines to access the host all All 0.0.0.0/0 trust specifically refer to this connection: Http://www.cnblog S.com/hiloves/archive/2011/08/20/2147043.html
2.1.2 postgresql.conf Configuration
The database listens for information listen_address=*, listening on all ports so that the remote client can access the database.
2.1.3 St_geometry.dll Configuration
Copy the current version of the St_geometry.dll connection library to the Lib directory of the PostgreSQL database. such as: \arcgis\desktop10.2\databasesupport\postgresql\9.2\windows64\st_geometry.dll target directory: C:\Program Files\PostgreSQL\ 9.2\lib
2.2 ArcGIS for desktop Connection for Windows version PostgreSQL
When the database configuration is complete, connecting to the database in desktop is relatively straightforward. With help from ArcGIS for desktop, you can see that the Client connection libraries that desktop connects to the PostgreSQL database are: Libeay32.dll, Libiconv-2.dll, Libintl-8.dll, Libpq.dll and Ssleay32.dll. PG_CLIENT_WINDOWS86: Contains the client files required to connect to a PostgreSQL database from a 32-bit client on a Windows manipulation system. Documents include Libeay32.dll, Libiconv-2.dll, Libintl-8.dll, Libpq.dll, and Ssleay32.dll. These library files for the installed version database need to be found and then copied to the desktop Bin directory. Locate the relevant library file copy of the PostgreSQL database 9.2 version to: Target directory: C:\Program files (x86) \arcgis\desktop10.2\bin Complete the above configuration can be done in the ArcGIS for Desktop to connect to the PostgreSQL database, but it is often necessary to create a spatial library using the tool that comes with desktop.
It should be noted that the default table space created by this tool will be in the development directory of Oracle's environment variables, if you are a RAC or the tablespace location is not in the default directory, first create the SDE user and tablespace in Oracle and assign the tablespace to the specified SDE user, and then Use an existing SDE user and tablespace when creating a spatial library. Otherwise, an error will occur.
Once created, you can connect to the spatial library SDE via desktop
2.3 AGS (Windows Edition) connects Windows edition PostgreSQL
ArcGIS for server connects the PostgreSQL database to Windows Edition Server or Linux Edition Server. The exact configuration is slightly different. Windows Edition Server configuration requires copying the corresponding version of the PostgreSQL database library file to the bin directory of the server.
PG_CLIENT_WINDOWS64: Includes client files required to connect to a PostgreSQL database from a 64-bit client running on a Windows operating system. Documents include Libeay32.dll, Libintl.dll, Libpq.dll and Ssleay32.dll. Find a copy of the relevant library file from the PostgreSQL database version 9.2 to: Target directory: C:\Program files \arcgis\server10.2\bin ArcGIS for server database registration, connect to server via desktop, The database is added through the server properties-data Storage tab.
Fill in the Database connection information or select the database connection file created by desktop to import the database connection information.
2.4 AGS (Linux Edition) connects Windows version PostgreSQL
The Linux version of ArcGIS for server connection PostgreSQL database is basically similar to Windows, unlike the connection library files required by the server. Pg_client_linux64: Contains the RPM client files required to connect to a PostgreSQL database from a 64-bit client running on the Red Hat Linux operating system. Libraries include libpq.so, libpq.so.5, and libpq.so.5.3.
Note: The libraries for the PostgreSQL9.2 versions are: Libpq.so, libpq.so.5, and libpq.so.5.5. In the installation directory of the Linux version PostgreSQL database or the Linux client with an existing version of the database, locate the above file and copy it to the Lib directory of the Linux version server.
Then, repeat the steps for registering the Windows Server database by using desktop to connect to the Linux server.
3 ArcGIS Platform Connection PostgreSQL database Linux Edition
3.1 Linux version PostgreSQL database configuration
For the Linux version of PostgreSQL database, first of all, the installation is aware of the installation directory read and write permissions, or you will be prompted to install the unsuccessful. You need to configure the connection settings for the database after the installation is complete. The default path for the configuration file is required:/opt/postgresql/9.2/data. The configuration files are pg_hba.conf and postgresql.conf.
3.1.1 Configuring system environment Variables
Modify the profile file under etc by directly editing the file or by using the command line tool VI. Vi/etc/profile Add the configuration: Export ld_library_path=/opt/postgresql/9.2/lib; $LD _library_path Export path=/opt/postgresql/ 9.2/bin: $PATH Export Pgdata=/opt/postgresql/9.2/data
3.1.2 pg_hba.conf Configuration
The machine information configuration that can be connected to the database is the same as the Windows edition. If the condition is available, you can modify the file directly. Terminal Modification Command: vi/opt/postgresql/9.2/data/pg_hba.conf
3.1.3 postgresql.conf Configuration
The machine information configuration that can be connected to the database is the same as the Windows edition. Terminal Modification Command: vi/opt/postgresql/9.2/data/postgresql.conf
3.1.4 st_geometry.so Configuration
Copy the current ArcGIS product version of the Linux version of the St_geometry library to the Lib/postgresql directory of the PostgreSQL database, not the Lib directory Oh.
such as: \arcgis\desktop10.2\databasesupport\postgresql\9.2\ linux64\st_geometry.so target directory://opt/postgresql/9.2/lib/ PostgreSQL
3.2 ArcGIS for desktop Connection to Linux version PostgreSQL
In fact, after completing the above configuration of the Linux version of PostgreSQL, the desktop Connection to the Linux version of PostgreSQL is no different from the Windows edition, it also requires a 32-bit PostgreSQL database connection library file and then creates an enterprise Geodatabase. Connection. PG_CLIENT_WINDOWS86: Contains the client files required to connect to a PostgreSQL database from a 32-bit client on a Windows manipulation system. Documents include Libeay32.dll, Libiconv-2.dll, Libintl-8.dll, Libpq.dll, and Ssleay32.dll.
3.3 AGS (Windows edition) connects to the Linux version of PostgreSQL
The Linux version of the ArcGIS for server connection for the PostgreSQL database is no different from the version of Windows. Also requires the Windows version of the PostgreSQL database connection library file. Connect to server through desktop, and then register the database with the server properties. PG_CLIENT_WINDOWS64: Includes client files required to connect to a PostgreSQL database from a 64-bit client running on a Windows operating system. Documents include Libeay32.dll, Libintl.dll, Libpq.dll and Ssleay32.dll.
3.4 AGS (Linux edition) connects to the Linux version of PostgreSQL
The Linux version of the ArcGIS for server connection to the PostgreSQL database is virtually indistinguishable from the Linux version of Server's connection to the Windows version PostgreSQL database. You need to copy the ArcGIS product to the Linux version of the library file to the server's Lib directory. Pg_client_linux64: Contains the RPM client files required to connect to a PostgreSQL database from a 64-bit client running on the Red Hat Linux operating system. Libraries include libpq.so, libpq.so.5, and libpq.so.5.3. Note: The libraries for the PostgreSQL9.2 versions are: Libpq.so, libpq.so.5, and libpq.so.5.5. Then, again, connect to the Linux server through desktop, and repeat the steps for registering the server database.
Overview of PostgreSQL data connection configuration in the ArcGIS platform