Manage and Migrate ArcGIS Server Services--Slice Service (TileServer Cache Service) (2)

This article mainly introduces how to manage and migrate the cache service after the cache service is released ;

What to do with the cache or slice is applicable to this tutorial:
1. The cache service of my machine is deleted, but after the server manager is deleted, the computer still occupies a lot of resources, so this tutorial will teach you how to clean up the residual cache ;

2. I have completed slicing on the arcgis server of machine A before, so I want to migrate the cache service of machine A to the arcgis server on my new machine B;

3. I now have two cache services under one arcgis server or multiple arcgis servers; I now need to combine these two cache services into one cache service;

4. After the cache is released, what tools can we use before and after the release?

The common ones are:
map service: publish and use ArcGIS Server service - map service (Mapserver)
feature service: publish and use ArcGIS Server service - feature server (feature server)
image service: publish and use ArcGIS Server service - image Service (image server)
OGC service: publish and use ArcGIS Server service – OGC service (WMS/WMTS/WFS/WCS/WPS)
cache service: publish and use ArcGIS Server service – cache service (TileServer) (1)
cache service : Manage and migrate ArcGIS Server services and cache services (TileServer) (2)
Geoprocessing services, vector tile services, scene services
, geographic data services, and geometry services, KML services, geocoding services, locator Maritime Server, path services, Schematics service, flow service, utility network service, Workflow Manager service, etc.;

1. Management of cache service

1.1 After the cache service is released, if the data is updated, you want to update the local slice

There are two methods:

Method 1: Update the content of the data source referenced by the cache service, and re-create slices in the area to be updated for the published service. The steps are as follows:
1) If the folder or database where the data source is located has been registered, then directly modify the relevant source data in the folder or database (such as adding or deleting elements in the layer); if the folder where the data source is
located Or if the database is not registered, the source data will be backed up to the arcgisinput directory of the GIS server when publishing the service before, and directly modify the relevant source data in this directory (such as adding or deleting elements in the layer); if you
want To directly replace the layer referenced in the map document with another layer with the same name, then modify the relevant msd file under the arcgisinput directory of the GIS server. The specific modification method is to connect the folder where the msd file is located in the ArcMap Catalog window, right-click msd file, select Set Data Sources, and change the Connection Properties of the layer;
2) Right-click the published cache service, manage cache -> manage tile -> execute the RECREATE_ALL_TILES operation based on the feature class boundary in the Manage Map Server Cache Tiles window.

Method 2: Republish the cache service and import the newly generated tiles into the previous cache service. The steps are as follows:
1) Organize the updated data into a map document and publish it as a cache service. The tiling scheme and image format need to be the same as those of the previous service, and only the changed area can be sliced ​​based on the boundary of the feature class; 2) In the
Catalog Under the server node of , right-click the service to update the cache, select manage cache -> Import tile, and import the slice generated in the previous step based on the feature class boundary. Note that Overwrite Tiles is selected, which will replace all pixels in the region of interest, and It is not merged or blended with the image in the receive buffer.

To create a small test cache, first use the editing tools in ArcMap to create a feature class containing a small rectangle around the area to be tested. Then use the options at the bottom of the Manage Map Server Cache Tiling tools dialog box to create tiles based on the boundaries of the feature class. Browse to the feature class containing the test area and create tiles.

1.2 Can I still access the underlying data?

Although map caches represent pictures of data, you can allow others to identify, search, and query on your map service. These tools get the geographic location of features from a server and return the corresponding results.

The application draws these results in its native graphics layer format on top of the cached image.

1.3 Server directory cleanup

ArcGIS Server periodically deletes (or cleans up) old, unneeded files from the job directory, output directory, and system directories to prevent them from taking up disk space unnecessarily. Cache directories are not cleaned, as the contents of these directories should always be available.

How the server cleans up the directory:
When ArcGIS Server prepares to clean up files in the server directory, it automatically checks to see if the time since the file was last modified exceeds the maximum file retention period specified. If the file satisfies this condition, it is deleted and the server moves on to the next file in the directory. If the file does not meet this condition, it will be kept in the directory.

By default, the following criteria are used to specify the server job directory, output directory, and system directory to clean up:

Table of contents cleaning mode Maximum file retention period
Operation time since last modification 360 minutes (6 hours)
output time since last modification 10 minutes
system time since last modification 1,440 minutes (24 hours)

For example, if a file in the output directory has not been modified for 10 minutes after it was created, the cleanup mechanism will delete the file because it exceeds the maximum allowed file retention period. You can fine-tune the cleanup mode and maximum file retention period to suit your site's needs.

In addition to the cleaning mode and maximum file retention period, the job directory, output directory, and system directory have their own set of cleaning rules. For example:

  • For job directory cleanup, ArcGIS Server will only delete the job if it has completed, been canceled, or failed.
  • For output directory cleanup, ArcGIS Server only deletes files and folders whose names begin with _ags.
  • For system catalog cleanup, ArcGIS Server deletes uploaded items only when they have been fully uploaded to the server.

My cache directory is:
insert image description here

If I have deleted a certain service in the server manager, but want to completely delete the cache of a certain service, then we go to arcgiscache, find the corresponding cache and delete it;

How to query the cache directory, open the server manager interface:
insert image description here

2. ArcGIS Server service migration and recovery

2.1 Migration service

If the service can be migrated, the original service can be restored by backing up the files required for migration. Therefore, the problems of "service migration and recovery" and "service backup" can be summarized into one question "how to migrate services and cache?" service migration
:

Description of the problem: Two Server servers, how to migrate services from one to the other.

Note:
①The following solutions are also applicable to "transfer the server of machine A to the server of machine B (there is already a publishing service in B)", and there is no need to ensure that B is a new site.

②The solution is suitable for migration between versions 10.1~10.8. From version 10.0 to 10.1, the Server product architecture has undergone major adjustments, so the service can only be re-released.

③The 10.0 cache can be reused in later versions of the service. For details, see "2.2 Cache Migration" below.

First of all: the arcgis for server accounts, config-store and direcotires physical locations, and data source physical locations of the two arcgis for servers are all consistent. My server directory is as follows:
insert image description here

Directly put the services under the original config-store (the default path is in C:\arcgisserver, mine is under D:\arcgisserver: but some customers set the path by themselves, then query their own path in the above figure. Yes) and the directories directory can be copied;
insert image description here

Note: Because the machine information is recorded in the config-store, it cannot be copied completely, only services need to be copied;

At the same time, pay attention to stop the cache, and then after migrating the registered data, grant the read and write permissions of the arcgis for server account to its folder to ensure that Arcgis for server has the permission to read the data.
insert image description here

Another: Regarding the problem that the data source has been registered, only the folder address of the data is recorded in arcgis for server. If the data source is copied to the same physical path, arcgis for server can read the data under normal circumstances.

2.2 Migrating the cache

The cache file of the slice file type on the server is:
insert image description here

Cache migration The specific cache migration process:

1. Copy the file to the new server for backup;
insert image description here
among them, _alllayers is the slice file of each level, and the xml file is the slice information (level).

2. Copy the gdb and xml files and put them on the new server;
insert image description here
the Layers can be recognized as the raster data format under the arcmap catalog, and can be directly loaded into arcmap; so you need to copy the gdb and xml files in advance;
insert image description here

3. The steps to publish the service are as follows:

1) Open ArcMap and add the JobStatus layer in gdb; of course, you can also create a new cache outer bounding box;
2) Use the File>share As>Service wizard in ArcMap to create a map service with the same name as the existing cache service ;
3 ) In the service Editor window, under the Cache tab, Tiling Scheme configuration: Tiling scheme file Select the conf.xml file of the old version of the cache map tile (can be found in the directory provided below) to import to set the cache scale of the new service; modify Minimum and maximum cache scale scrollbars to include all scale levels of existing tiles. Choose to create the cache manually , and then publish the service. 4) Stop the newly released service first; copy
the cache under the **_alllayers** folder of the old version of the cache slice to the corresponding existing server cache directory.

For example, the existing cache service name is: MyMapService001
server directory is: D:\arcgisserver\directories\arcgiscache\MyMapService001
\Layers

Notes:
1) For publishing a cache service using a mosaic dataset, it is recommended that the published new service maintain the same settings as the original service, except for manually creating the cache, such as the registered data source path .

2) Only create the service, pay attention to choose to manually create the cache , this step is to build the folder structure of the cache service, and publish the service MyMapService001 with the same name.

3) Copy the cache under the server directory _alllayers folder to the corresponding existing service server directory _alllayers folder named MyMapService001, and use the slice file of the original service.

The specific process is as follows:

insert image description here

Check the status of the newly replaced cache service. After the update is complete, you need to wait for a few more minutes, and the cache status can be updated slowly; the following is the query method, mine has not been fully updated yet;
insert image description here

2.3 Cache service overlay: merge two adjacent cache services

Note: If you need to superimpose or combine two cache services into one cache service, you need to pay attention to the consistent
tile scheme;
the same tile height and tile width:
the default width and height of tiles are 256 pixels. 256 or 512 is recommended. If you are building a cache that overlaps another cache, you should make sure to use the same tile width and height for both caches.

Questions and answers:
Question 1: If the tile scheme and tile size of the cache are different, can the merge be achieved?
Answer: No;
Question 2: Is there any way to merge?
Answer: Load the data into arcmap, publish it again, and then slice it;
Q3: The spatial reference is inconsistent, but can the same ellipsoid be merged?
Answer: No; the slice has a starting origin, so should it use the projected coordinate system of latitude and longitude or row and column number? So it is not possible; for

the understanding of spatial reference, please refer to: EPSG and WKID spatial reference - a simple understanding of coordinate system
For the introduction of related parameters of tile cache, please refer to Publishing and using ArcGIS Server services - caching service (TileServer) (1)

The two slicing services first save the two services as tpk, and then publish the service. The published data is the entire range of the two data, choose manual slicing; and then import the cached tpk after the service cannot be finished;

You must ensure that the size of the tiles and the level of the tiles are consistent before merging two cache services.

3. Introduction of caching (slicing) related tools

insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/weixin_40625478/article/details/110917301
Recommended