Esri / arcgis-cookbook

Chef cookbooks for ArcGIS
Apache License 2.0
300 stars 116 forks source link

Cookbook v3.3.0 using wrong content directory #205

Open sodtom opened 5 years ago

sodtom commented 5 years ago

Using Chef client v.13.9.4 and Cookbook v.3.3.0 and trying to install ArcGIS Enterprise 10.7 when came up to situation where v.3.3.0 ArcGIS cookbook recipes installs Portal content to it's default folder (c:\arcgisportal) EVEN IF you have definition to put this to a different folder/location.

I'm using definition

_"contentdir": "c:\arcgisdata\portal\content"

for the portal in the JSON file.

Logs: _[2019-03-25T21:48:50+02:00] FATAL: RuntimeError: arcgis_enterpriseportal[Create Portal Site] (arcgis-enterprise::portal line 60) had an error: RuntimeError: Cannot read from directory path 'C:\arcgisdata\portal'. Please check that the location is valid and that the Portal service account has permissions to the location.

directory[C:\arcgisportal] action delete - delete existing directory C:\arcgisportal

Seems that partially this definition is read correctly and partially not. Tested this also by creating a empty arcgisportal folder and disabled the acces to it totally.

Error

Cookbook-330-Bug

So, I assume there is a BUG in the v3.3.0 cookbook. Noticed that in portal.rb file content_dir has been commented out.

pbobov commented 5 years ago

Please try to set arcgis/portal/content_store_connection_string attribute instead of arcgis/portal/content_dir

{
  "arcgis": {
    "portal": {
       "content_store_connection_string": "c:\\arcgisdata\\portal\\content"
       ...
    }
   ...
}

By default arcgis/portal/content_store_connection_string attribute should be set to the value of arcgis/portal/content_dir attribute. For some reason it does not happen in your case.

arcgis/portal/content_dir attribute itself is not used by "arcgis_enterprise_portal[Create Portal Site]" action.

sodtom commented 5 years ago

Please try to set arcgis/portal/content_store_connection_string attribute instead of arcgis/portal/content_dir

{
  "arcgis": {
    "portal": {
       "content_store_connection_string": "c:\\arcgisdata\\portal\\content"
       ...
    }
   ...
}

By default arcgis/portal/content_store_connection_string attribute should be set to the value of arcgis/portal/content_dir attribute. For some reason it does not happen in your case.

arcgis/portal/content_dir attribute itself is not used by "arcgis_enterprise_portal[Create Portal Site]" action.

Hi,

thanks, but tried that too - actually tried to use both _"datadir" and this one, but either doesn't work. With _"contentent_store_connectionstring" it'll use still the c:\arcgisportal default folder. With _"datadir" everything seems to go to c:\arcgisdata\portal as defined, but it seems to create the "arcgisportal" folder in the c:\arcgisdata\portal folder leading to situation that we have a "content" folder in two places:

- c:\arcgisdata\portal\arcgisportal\content - c:\arcgisdata\portal\content

to my experience this leads troubles.

Using _"datadir", installation however did success, but I doubt with "arcgisportal" in the "content" folder we end to mess and troubles.

BR -Tom

sodtom commented 5 years ago

Hi,

tried this with 10.7 manual installation defining content to be c:\arcgisdata\portal\ and ended to a quite interesting folder structure (below arcgisdata is in c root) - note that arcgisportal was NOT used nor entered anywhere during installation:

CaptureX

So, seems that this arcgisportal is built in somewhere in 10.7 setup program and you can't avoid it?!? This explains also the behavior with the _"datadir" version. At create site phase setup program was asking for the content directory and offered the c:\arcgisdata\portal\arcgisportal\content as default.:

Content_Dir-107

To get this somehow correct with chef, seems that we must use combination of proper _"datadir" and _"contentdir" definitions to emulate the output of the manual installation. Seems that this "hard coded" arcgisportal folder has come to stay!? Just wondering, what may happen in upgrade situations?

BR, -Tom

cameronkroeker commented 5 years ago

There are two "content" directories that Portal uses/creates. The first one is created by the installer (setup), which uses the "data_dir" parameter. If the "data_dir" is not specified in the roles json file then it defaults to C:\arcgisportal and the following directory structure is created:

C:\arcgisportal\content C:\arcgisportal\db C:\arcgisportal\index C:\arcgisportal\logs C:\arcgisportal\temp

Keep in mind that a local path must be used for the "data_dir" as this is where the internal components of Portal will reside and is used for startup.

The second "content" directory Portal creates is for the Portal items which can reside locally, cloud store, or file share (for Portal high availability). This is created during the "Site Creation" process which uses the "content_dir" parameter. (C:\arcgisportal\content\items\

So if we wish to use a non-default location for either of these then we must specify both the "data_dir" and "content_dir" parameters within our roles json file.

For example if we want to use a non-default path then we could do the following:

"data_dir":"C:\arcgisdata" "content_dir":"C:\arcgisdata\arcgisportal\content"

This should create the following folder structure:

C:\arcgisdata\arcgisportal\content C:\arcgisdata\arcgisportal\db C:\arcgisdata\arcgisportal\index C:\arcgisdata\arcgisportal\logs C:\arcgisdata\arcgisportal\temp

I tested manually installing 10.6.1 and also noticed that the arcgisportal is "hard-coded" somewhere in the setup as well.