Select to view content in your preferred language

Managing ArcGIS Datastore

1406
4
06-15-2022 03:11 PM
Brian_Wilson
Honored Contributor

I have ArcGIS Datastore and

1. I want to know how to monitor its health. I need to be able to tell when it's running normally or not.

2. I want to know how much data is stored in it and where.

3. I want to be able to manage backups for it.

4. I can see it has its own log files but I don't see how I am supposed to access them.

This snippet of code dumps out information, but that's about all I've come up with so far.

import arcgis.gis.server
from config import Config

server = arcgis.gis.server.Server(url = Config.SERVER_URL + '/admin',
    username = Config.PORTAL_USER, password = Config.PORTAL_PASSWORD
)
dsm = arcgis.gis.server.DataStoreManager(url = server.url + "/data", gis = server)
for ds in dsm.list():
    print(ds.properties)
    print()

 

0 Kudos
4 Replies
RyanUthoff
Frequent Contributor

All the ArcGIS Data Store is is a PostgreSQL database. You can connect to it through PGAdmin or any other PostgreSQL tool. From there, you can query the tables, monitor sizes, etc. like any other PostgreSQL database. 

As far as backups, you can manage the backups through Esri here using the backupdatastore command:

https://enterprise.arcgis.com/en/data-store/latest/install/windows/data-store-utility-reference.htm

Brian_Wilson
Honored Contributor

So far I don't see any docs on what's in that hidden PostgreSQL database. Have you found anything?

There is one inside Portal too. I was under the impression if they don't tell me it's there, I will get my hand slapped if I go there. I had a tech give me the psql commands to delete an undeletable feature service but that's the closest I've gotten.

Thanks for the link on the backups.

0 Kudos
RyanUthoff
Frequent Contributor

All of your hosted feature services you published are in there as tables/views. So, if you publish a parcel table as a hosted feature service, that will show up as a table in the ArcGIS Data Store in the PostgreSQL database.

With that being said, you can't just go in and create/delete tables (well, you could, but Esri wouldn't recognize them). All of the interactions you do with the tables needs to be through Esri. Although, editing data directly through the DB should be fine, in theory. Doing anything with the data store outside of Esri is still a risk though.

0 Kudos
Brian_Wilson
Honored Contributor

I just had a phone conversation with Esri support and confirmed there's no other official documentation outside of https://enterprise.arcgis.com/en/portal/latest/administer/windows/what-is-arcgis-data-store.htm

If I needed to store other data, for example PostGIS tables, I'd put that in a separate PostgreSQL instance.

Currently we don't use the scene storage (aka "tile cache") which is just files so I can ignore that part entirely. That means this really just becomes a PostgreSQL project. I don't need to write anything so I can't see any harm in creating a read-only connection to monitor the database status.

The support tech directed me to the "describedatastore" command, for anyone else reading this you'd find that in "C:\Program Files\ArcGIS\Datastore\tools as a .BAT script. Running it will give config information and also a few status items. I don't really want to remote into the machine and parse the file. It works by running a java binary so it's not possible to dump that out and see what it's doing.

The firewall information page https://enterprise.arcgis.com/en/data-store/latest/install/windows/ports-used-by-arcgis-data-store.h... tells me that PostgreSQL is running on port 9876.

The script "listadminusers" gives the usernames and passwords to access the PostgreSQL server. 

With this information I should be able to set up a pgadmin instance to look at the database and to create a 'read-only' account for monitoring it.

I still don't know how I am supposed access logs but I can see the files in C:/arcgisdatastore/logs so I will just read them as files.