CARTO can be installed on a local server, or set of servers, either directly or using our commercial installer.

Technical Operations with CARTO LDS On-Premises

There are many things in CARTO that can be configured, but are not included in the installation process. One way to configure some of these things is by running some specific application tasks.

CARTO LDS works together with Builder, therefore LDS tools are distributed among them:

  • CARTO Builder server: tools are located in /opt/carto/tools/bin
  • CARTO LDS server: tools are located in /opt/carto/tools/bin
Note
All the operation tools must be executed with root user or full root privileges. Operation tools are executed through `cartoctl` via `cartoctl exec -- ` </div>
Warning
`cartoctl` can be executed from the LDS uncompressed tar ball folder, or from `/opt/carto/tools/bin/cartoctl`. In case of using the latter, make sure to use `--release-path` flag, pointing to a copy/backup of the uncompressed tar ball folder, otherwise some tools might fail. As a best practice, you can consistently use `--release-path /opt/carto/tools`.
### Configure LDS in Builder server Located in **Builder server**. The following configuration steps are used to connect Builder and LDS together. It can be used for LDS reconfiguration purposes as well. For example, if the CARTO LDS server IP changes.
Note
Before using the tool, remember to modify your installation configuration file `~/carto/.config.yml` to update `CARTO_DATASERVICES_ADDRESS`, `CARTO_DATASERVICES_PORT` accordingly. Preferably, config keys should be placed under dataservices role.
Note
Before using the tool, remember to modify your installation configuration file `~/carto/.config.yml` to update `CARTO_REDIS_BIND` to `0.0.0.0` under redis role, so LDS server can communicate with redis.
1. Update `CARTO_DATASERVICES_ADDRESS` and `CARTO_DATASERVICES_PORT` accordingly under dataservices role, to point to your LDS server. ``` ini - hostname: node01-lds.carto.lan user: privileges: true ssh_key: id_rsa command: /bin/sudo role: - name: dataservices release: "" installed: false env: env: - name: CARTO_DATASERVICES_ADDRESS value: 4.4.4.4 - name: CARTO_DATASERVICES_PORT value: "5433" - name: CARTO_DS_ANALYSIS_GEOCODER value: "false" - name: CARTO_DS_ANALYSIS_HIRES value: "false" - name: CARTO_DS_ANALYSIS_ISOLINES value: "false" - name: CARTO_DS_ANALYSIS_ROUTING value: "false" - name: CARTO_DS_ANALYSIS_DOBSERVATORY value: "false" package: [] tasks: [] ``` 2. Update `CARTO_REDIS_BIND` to either bind to `0.0.0.0`, or a given IP address reachable from the LDS server (`CARTO_DATASERVICES_ADDRESS`), since LDS requires connectivity with **redis server** (`CARTO_REDIS_ADDRESS`). ``` ini - hostname: node01.carto.lan user: privileges: true ssh_key: id_rsa command: /bin/sudo role: - name: redis release: 4.0.0 installed: true env: - name: CARTO_REDIS_ADDRESS value: 5.5.5.5 - name: CARTO_REDIS_BIND value: 0.0.0.0 - name: CARTO_REDIS_PORT value: "6379" ``` 3. Refresh **builder, redis and resque templates** and restart the **services** accordingly
Note
Builder, resque and redis services will be restarted, therefore CARTO will be unavailable for a few seconds.
``` bash cartoctl nodes roles refresh-templates \ --restart-services \ --release-path /opt/carto/tools \ builder resque redis Starting reload process on node node01.carto.lan Reloading role builder Restarting service builder ✔ Successfully reloaded builder Reloading role resque Restarting service resque ✔ Successfully reloaded resque Reloading role redis Restarting service redis ✔ Successfully reloaded redis ``` 4. Enable LDS service for your **Organization**.
Note
Organization name is defined in `CARTO_ORG`, under builder section in `~/.carto/config.yml`, however, you can use any other Organization name, as long as it has been created already. In the example above, replace \<organization\> by the suitable Organization name.
``` bash cartoctl exec -- carto-builder-exec-rake.sh \ "cartodb:db:configure_geocoder_extension_for_organizations[organization,false]" ``` ### Setting up LDS Limits and Quotas It is a recommended best practice to set limits to a CARTO LDS installation. There are different methods to set quotas and limits but first, a brief introduction to familiarize yourself with some concepts: - **Quotas**: service limits can be established for individual users or organizations, in the form of quotas (maximum number of requests per billing period). - **Billing period**: one month starting from user/organization creation day. For instance, if the organization was created on the 15th of June, the billing period will start the 15th day of every month. If any quota limit is reached, it will be cleared the first day of that billing period (day 15th for this example). - **Rate-limit**: CARTO LDS offers integration with third-party providers, allowing request rate limiting on the CARTO side, in order to avoid any kind of throttling, or additional billing charges from an external service provider. - **Overquota (soft limits)**: service limits for a user can be configured to be soft. This indicates that the user can exceed the limits (possibly incurring in additional charges). Soft user limits bypass both quotas and rate limits. ### LDS Quotas Located in **Builder server**. You might want to set quota limits for any available LDS service, to limit the number of requests allowed for services per billing period. Setting quota limits enables you to avoid additional billing charges in case you are using third-party services such as Mapbox, TomTom, HERE, Google or Geocodio. Before using this tool, be sure that you understand these concepts: - Billing period: one month starting from user/organization creation day. See example above. - Quota limit: maximum number of requests allowed per billing period. - LDS services: quotas can be set separately by LDS service. - geocoding - routing - isolines - data observatory - Organization: quotas will apply to an organization, hence they will apply to every user belonging to the organization. - User: quotas will apply to a specific users. User quotas are overridden by Organization quotas. ``` bash cartoctl exec -- carto-builder-ds-quotas.sh This tool will set a quota limit, valid for a range of time: - Range of time: One month starting from the Organization/User creation date. - Quota limit: Maximum number of requests allowed on a certain range of time (one month). carto-builder-ds-quotas.sh <--user username|--organization organization> [-g|-i|-r|-s|-n] Options: quota : quota value. Maximum number of requests allowed on a certain range of time (one month). -h|--help : show help. -u|--user : apply quota to this user. User quotas are overriden by organization ones. -o|--organization : apply quota to this organization -g|--geocoding : geocoding quota -i|--isolines : isolines quota -r|--routing : routing quota -s|--do-snapshot : data observatory snapshot quota -n|--do-general : data observatory general quota -y|--non-interactive : Assume yes for all questions (no prompt). Examples: carto-builder-ds-quotas.sh 30000 --organization organization -g carto-builder-ds-quotas.sh 10000 --user user1 -ri ``` ### LDS Rate-Limit Located in **LDS server** This tool will set a LDS rate-limit using several scopes (user, organization, server). Once the limit is in place, it will apply to any LDS geocoding/routing/isolines request. Once the limit is in place, LDS will only allow {n} requests during a time range. Available options: - enable: enables rate-limit - disable: disables rate-limit - org-user: organization user. If you are setting a user rate-limit, it will apply to this user. - organization: organization name. The user set with `org-user` option, should belong to this organization. If you are setting an organization rate-limit, it will apply to this organization. - limit: maximum number of requests for a given period. - period: rate-limiting period in seconds. Rate-limit precedence: - User: it overrides any other Organization, or Server rate-limit. - Organization: it overrides any Server rate-limit and it is overridden by any User rate-limit. - Server: it has the lowest precedence. It is overridden by any Organization, or User rate-limit. #### User Rate-Limit Set a rate-limit for a given user. ``` bash cartoctl exec -- carto-dataservices-rate-limit.sh user Enables/Disables/Shows the rate limit configuration for the user. It overrides any other configuration. carto-dataservices-rate-limit.sh user <enable|disable|show> [-l|--limit] [-p|--period] [-h|--help] Options: enable : Enables rate limit disable : Disables rate limit show : Shows current rate limit organization : Required. Any valid organization name (required for configuration purposes) org-user : Required. Any valid username belonging to the org above. Limits will apply to such user -l|--limit : Maximum number of request in the established period (Default: 1000) -p|--period : Rate-limiting period, in seconds (Default: 86400) One day -h|--help : show help. ``` #### Organization Rate-Limit Set a rate-limit for a given organization. ``` bash cartoctl exec -- carto-dataservices-rate-limit.sh org Enables/Disables/Shows the rate limit configuration for the Organization. It overrides server level configuration and is overridden by user configurations, if present. carto-dataservices-rate-limit.sh org <enables|disable|show> [-l|--limit] [-p|--period] [-h|--help] Options: enable : Enables rate limit disable : Disables rate limit show : Shows current rate limit organization : Required. Any valid organization name. Limits will apply to to every user belonging to this org. org-user : Required. Any valid username belonging to the org above (required for configuration purposes) -l|--limit : Maximum number of request in the established period (Default: 1000) -p|--period : Rate-limiting period, in seconds (Default: 86400) One day -h|--help : Show help. ``` #### Server Rate-Limit Set a rate-limit that affects any user, or organization, in the system. This takes precedence over any preset organization, or user, rate-limits. ``` bash cartoctl exec -- carto-dataservices-rate-limit.sh server Enables/Disables/Shows the default rate limit configuration for all users accessing the dataservices server, no matter what Organization they belong to. It is overridden by organization, or user limits. carto-dataservices-rate-limit.sh server <enable|disable|show> [-l|--limit] [-p|--period] [-h|--help] Options: enable : Enables rate limit disable : Disables rate limit show : Shows current rate limit organization : Required. Any valid organization name (required for configuration purposes) org-user : Required. Any valid username belonging to the org above (required for configuration purposes) -l|--limit : Maximum number of request in the established period (Default: 1000) -p|--period : Rate-limiting period, in seconds (Default: 86400) One day -h|--help : Show help. ``` ### LDS Overquota (Soft Limits) Located in **Builder server**. Once you have properly set the quotas and rate-limits described in the previous sections, you may want to add some exceptions. With this tool, you can bypass both quotas and rate-limits for a specified **user** within the LDS service. Even after reaching a set limit, the system allows additional requests of services from the user. Before using this tool, ensure that you understand the following concepts: - User: soft limits will apply to the specified user. - LDS services: soft limits can be set separately by the LDS service. - geocoding - routing - isolines - data observatory - Enable/Disable: once enabled, soft limits will apply to a certain user until you explicitly disable them. ``` bash cartoctl exec -- carto-builder-ds-overquota.sh This tool enables/disables overquota for a given user in one or more services. - After reaching any limit by a user for a given service, like geocoding/routing/isolines ... , the system will allow further calls to such service. carto-builder-ds-overquota.sh <enable|disable> [-g|-i|-r|-s|-n] Options: enable : enable overquota for a given service disable : disable overquota for a given service user : apply overquota to this user -h|--help : show help. -g|--geocoding : geocoding overquota -i|--isolines : isolines overquota -r|--routing : routing overquota -s|--do-snapshot : data observatory snapshot overquota (only for Qlik) -n|--do-general : data observatory general overquota -y|--non-interactive : Assume yes for all questions (no prompt). Examples: carto-builder-ds-overquota.sh enable user1 -gr carto-builder-ds-overquota.sh disable user2 -i -s ``` ### Setting up LDS providers CARTO LDS offers integration with third-party providers such as Google, Mapbox, TomTom, HERE or Geocodio. There are **two configuration steps** in order to configure LDS providers: 1) Configure CARTO Builder 2) Set the proper configuration in CARTO LDS. ### LDS Providers (Builder configuration) Located in **Builder server**. This tool configures a LDS provider (Mapbox, TomTom, HERE, Google, Geocodio) for a given LDS service (geocoding, routing, isolines). LDS providers can only be set at the **Organization** level. ``` bash cartoctl exec -- carto-builder-ds-providers.sh carto-builder-ds-providers.sh <google|mapbox|here|tomtom|geocodio> [-h|--help] Options: -h: help. Show help. Examples: carto-builder-ds-providers.sh google -h carto-builder-ds-providers.sh mapbox -h ``` #### Configuring Mapbox LDS provider Available options: - organization: changes will apply to this Organization. - geocoder/routing/isolines: set Mapbox as LDS provider for any of these services. - delete-google-conf: delete Google provider existing configuration, if we are no longer using google services. ``` bash cartoctl exec -- carto-builder-ds-providers.sh mapbox --help carto-builder-ds-providers.sh [-h|--help] [-g|-o|-r|-i|-d|-y] Options: -h|--help : help. Show help. -o|--organization : organization name. (Default: organization) -g|--geocoder : geocoder. Set mapbox as Geocoder provider -r|--routing : routing. Set mapbox as Routing provider -i|--isolines : isolines. Set mapbox as Isolines provider -d|--delete-google-conf : delete Google config keys. Delete them if they are not used anymore -y|--non-interactive : non-interactive. Assume yes for all questions (no prompt). Examples: carto-builder-ds-providers.sh mapbox -r -i carto-builder-ds-providers.sh mapbox -g -y carto-builder-ds-providers.sh (Default: Interactive mode) - Please, would you like to set [mapbox] as your [Geocoder] provider ? (Y/N) Y ``` #### Configuring TomTom LDS provider Available options: - organization: changes will apply to this Organization. - geocoder/routing/isolines: set TomTom as LDS provider for any of these services. - delete-google-conf: delete Google provider existing configuration, if we are no longer using google services. ``` bash cartoctl exec -- carto-builder-ds-providers.sh tomtom --help carto-builder-ds-providers.sh [-h|--help] [-g|-o|-r|-i|-d|-y] Options: -h|--help : help. Show help. -o|--organization : organization name. (Default: organization) -g|--geocoder : geocoder. Set tomtom as Geocoder provider -r|--routing : routing. Set tomtom as Routing provider -i|--isolines : isolines. Set tomtom as Isolines provider -d|--delete-google-conf : delete Google config keys. Delete them if they are not used anymore -y|--non-interactive : non-interactive. Assume yes for all questions (no prompt). Examples: carto-builder-ds-providers.sh tomtom -r -i carto-builder-ds-providers.sh tomtom -g -y carto-builder-ds-providers.sh (Default: Interactive mode) - Please, would you like to set [tomtom] as your [Geocoder] provider ? (Y/N) Y ``` #### Configuring Here LDS provider Available options: - organization: changes will apply to this Organization. - geocoder/isolines: set HERE as LDS provider for any of these services. - delete-google-conf: delete Google provider existing configuration, if we are no longer using google services. ``` bash cartoctl exec -- carto-builder-ds-providers.sh here --help carto-builder-ds-providers.sh [-h|--help] [-g|-o|-i|-d|-y] Options: -h|--help : help. Show help. -o|--organization : organization name. (Default: organization) -g|--geocoder : geocoder. Set here as Geocoder provider -i|--isolines : isolines. Set here as Isolines provider -d|--delete-google-conf : delete Google config keys. Delete them if they are not used anymore -y|--non-interactive : non-interactive. Assume yes for all questions (no prompt). Examples: carto-builder-ds-providers.sh here -i carto-builder-ds-providers.sh here -g -y carto-builder-ds-providers.sh (Default: Interactive mode) - Please, would you like to set [here] as your [Geocoder] provider ? (Y/N) Y ``` #### Configuring Google LDS Provider Available options: - organization: changes will apply to this Organization. - geocoder: set Google as LDS provider for geocoding service. - google-clientid: set Google client id (mandatory for google services). - google-key: set Google private key (mandatory for google services). ``` bash cartoctl exec -- carto-builder-ds-providers.sh google --help carto-builder-ds-providers.sh [-h|--help] [-g|-o|-c|-k|-y] Options: -h|--help : help. Show help. -o|--organization : organization name. (Default: organization) -g|--geocoder : geocoder. Set google as Geocoder provider -c|--google-clientid : google clientid. Set Google Client ID -k|--google-key : google key: Set Google Private Key -y|--non-interactive : non-interactive. Assume yes for all questions (no prompt). Examples: carto-builder-ds-providers.sh google -g -o organization carto-builder-ds-providers.sh google -g -y carto-builder-ds-providers.sh google -g -c google_id_1 -k google_key_1 carto-builder-ds-providers.sh (Default: Interactive mode) - Please, would you like to set [google] as your [Geocoder] provider ? (Y/N) Y ``` Configuring Geocodio LDS provider ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Available options: - organization: changes will apply to this Organization. - geocoder: set Geocodio as LDS provider for this service - delete-google-conf: delete Google provider existing configuration, if we are no longer using google services. ``` bash cartoctl exec -- carto-builder-ds-providers.sh geocodio --help carto-builder-ds-providers.sh [-h|--help] [-g|-o|-r|-i|-d|-y] Options: -h|--help : help. Show help. -o|--organization : organization name. (Default: organization) -g|--geocoder : geocoder. Set geocodio as Geocoder provider -d|--delete-google-conf : delete Google config keys. Delete them if they are not used anymore -y|--non-interactive : non-interactive. Assume yes for all questions (no prompt). Examples: carto-builder-ds-providers.sh geocodio -g -y carto-builder-ds-providers.sh (Default: Interactive mode) - Please, would you like to set [geocodio] as your [Geocoder] provider ? (Y/N) Y ```
Note
Please use --delete-google-conf option with caution. Remove Google configuration keys, only if you are confident that no other Google service within CARTO installation are being used.
Note
This tool **must be used** along with lds\_providers\_lds , in order to complete LDS provider configuration.
### LDS Providers (LDS configuration) Located in **LDS server**. Third parties such as HERE, Mapbox, TomTom or Geocodio need additional configurations for api keys and need this tool for such configurations. This is an advanced tool that offers several configuration options for each provider. For most deployments, it should be enough to configure the provider keys. Available options: - save: saves configuration for Mapbox/TomTom/Here/Geocodio including the information provided by tool parameters. - show: shows current configuration for Mapbox/TomTom/Here/Geocodio. - check\_connectivity: performs a connectivity check between LDS server and LDS provider URL. It attempts to establish a connection to the already configured Mapbox/TomTom/Here URL. - Some Here deployments bring a Here Offline implementation, indicating that the URL is available through the local network instead of off the Internet. ``` bash cartoctl exec -- carto-dataservices-configure-providers.rb save Usage: ./carto-dataservices-configure-providers.rb show [provider] ./carto-dataservices-configure-providers.rb save [provider] [section] [options] ./carto-dataservices-configure-providers.rb check_connectivity [provider] Shows or saves configuration and checks connectivity where the provider can be mapbox, tomtom, here or geocodio Use "carto-dataservices-configure-providers.rb command --help" to get more options ``` #### Configuring Mapbox The mandatory configuration for this provider requires an API key, in order for CARTO LDS to perform requests to Mapbox. There are other options, such as **timeouts**, in cases where you want to limit the time for a Mapbox request. Available services: - geocoder - routing - matrix - isochrone ``` bash cartoctl exec -- carto-dataservices-configure-providers.rb save mapbox geocoder Usage: ./carto-dataservices-configure-providers.rb save mapbox geocoder [options] Saves configuration merging defaults, global configuration and given arguments (in that order) --api-keys [api keys] --monthly-quota [monthly quota] --service-base-url [service base url] --service-connect-timeout [service connect timeout] --service-read-timeout [service read timeout] --service-max-retries [service max retries] --config-file [config file] --no-save Does not save config to /etc config file --current Saves current config. Use this option to create a configuration based in defaults and config with no further arguments --quiet Suppresses output of configuration --no-connection-check Suppresses connection check --help Show this message cartoctl exec -- carto-dataservices-configure-providers.rb save mapbox geocoder --api-keys xxxxxxxxxxxxxxxxx { "geocoder": { "api_keys": [ "xxxxxxxxxxxxxxxxx" ], "monthly_quota": 99999999999 }, "routing": { "api_keys": [ ], "monthly_quota": 99999999999 }, "matrix": { "api_keys": [ ], "monthly_quota": 99999999999 }, } ``` #### Configuring TomTom The mandatory configuration for this provider requires an API key, in order for CARTO LDS to perform requests to TomTom. There are other options, such as **timeouts**, in cases where you want to limit the time for a TomTom request. Available services: - geocoder - routing - isolines ``` bash cartoctl exec -- carto-dataservices-configure-providers.rb save tomtom geocoder Usage: ./carto-dataservices-configure-providers.rb save tomtom geocoder [options] Saves configuration merging defaults, global configuration and given arguments (in that order) --api-keys [api keys] --monthly-quota [monthly quota] --service-base-url [service base url] --service-connect-timeout [service connect timeout] --service-read-timeout [service read timeout] --service-max-retries [service max retries] --config-file [config file] --no-save Does not save config to /etc config file --current Saves current config. Use this option to create a configuration based in defaults and config with no further arguments --quiet Suppresses output of configuration --no-connection-check Suppresses connection check --help Show this message cartoctl exec -- carto-dataservices-configure-providers.rb save tomtom geocoder --api-keys xxxxxxxxxxxxxxxxx { "geocoder": { "api_keys": [ "xxxxxxxxxxxxxxxxx" ], "monthly_quota": 99999999999 }, "routing": { "api_keys": [ ], "monthly_quota": 99999999999 }, "isolines": { "api_keys": [ ], "monthly_quota": 99999999999 }, } ``` #### Configuring Geocodio The mandatory configuration for this provider requires an API key, in order for CARTO LDS to perform requests to Geocodio. There are other options, such as **timeouts**, in cases where you want to limit the time for a Geocodio request. Available services: - geocoder ``` bash cartoctl exec -- carto-dataservices-configure-providers.rb save geocodio geocoder Usage: ./carto-dataservices-configure-providers.rb save geocodio geocoder [options] Saves configuration merging defaults, global configuration and given arguments (in that order) --api-keys [api keys] --monthly-quota [monthly quota] --service-base-url [service base url] --service-connect-timeout [service connect timeout] --service-read-timeout [service read timeout] --service-max-retries [service max retries] --config-file [config file] --no-save Does not save config to /etc config file --current Saves current config. Use this option to create a configuration based in defaults and config with no further arguments --quiet Suppresses output of configuration --no-connection-check Suppresses connection check --help Show this message cartoctl exec -- carto-dataservices-configure-providers.rb save geocodio geocoder --api-keys xxxxxxxxxxxxxxxxx { "geocoder": { "api_keys": [ "xxxxxxxxxxxxxxxxx" ], "monthly_quota": 99999999999 } } ``` #### Configuring HERE The mandatory configuration options for this provider require an **api-id** and **app-code**, that allow CARTO LDS to perform requests to HERE. There are other options, such as **timeouts**, in cases where you want to limit how much time a Here request can take, or **service-json-url**, if you want to customize the HERE service URL. Available services: - geocoder - isolines ``` bash cartoctl exec -- carto-dataservices-configure-providers.rb save here geocoder Usage: ./carto-dataservices-configure-providers.rb save here geocoder [options] Saves configuration merging defaults, global configuration and given arguments (in that order) --app-id [app id] --app-code [app code] --geocoder-cost-per-hit [geocoder cost per hit] --service-json-url [service json url] --service-connect-timeout [service connect timeout] --service-read-timeout [service read timeout] --service-max-retries [service max retries] --service-gen [service gen] --config-file [config file] --no-save Does not save config to /etc config file --current Saves current config. Use this option to create a configuration based in defaults and config with no further arguments --quiet Suppresses output of configuration --no-connection-check Suppresses connection check --help Show this message cartoctl exec -- carto-dataservices-configure-providers.rb save here geocoder --app-id XXXXXXX --app-code YYYYYYYY --service-json-url "http://carto-here-test.com" --no-connection-check { "geocoder": { "app_id": "XXXXXXX", "app_code": "YYYYYYYY", "geocoder_cost_per_hit": "1", "service": { "json_url": "http://carto-here-test.com" } }, "isolines": { "app_id": "", "app_code": "" } } ```
Note
If the key value starts with a dash `-`, a format `key='value'` **must be used**.
### Enabling Data Observatory Analysis Located in **Builder server**. Setting `CARTO_DS_ANALYSIS_DOBSERVATORY` config key to **true** enables the LDS Data Observatory analysis, in order to make them available in Builder's web interface. Steps: 1. Update `CARTO_DS_ANALYSIS_DOBSERVATORY` in `~/carto/config.yml` accordingly ``` ini nodes - hostname: node01-lds.carto.lan user: privileges: true ssh_key: id_rsa command: /bin/sudo role: - name: dataservices release: "" installed: false env: - name: CARTO_DATASERVICES_ADDRESS value: 4.4.4.4 - name: CARTO_DATASERVICES_PORT value: "5433" - name: CARTO_DS_ANALYSIS_DOBSERVATORY value: "true" package: [] tasks: [] ``` 2. Refresh **builder templates** and restart **builder service**
Note
Builder service will be restarted, therefore it will be unavailable for a few seconds.
``` bash cartoctl nodes roles refresh-templates \ --restart-services \ --release-path /opt/carto/tools \ builder Starting reload process on node node01.carto.lan Reloading role builder Restarting service builder ✔ Successfully reloaded builder ```
Note
You must apply this tool after loading the Data Observatory the first time after installation at observatory\_database\_lds
### Loading Data Observatory Database Located in **LDS server**. This tool loads the Data Observatory database into the LDS server. First you must upload a Data Observatory dump file to the LDS server, that will be used to extract the information and dump it into LDS database. You can use this tool to keep your Data Observatory information **updated**: Upload the brand new Data Observatory dump file to the LDS server and use this tool to dump it. ``` bash cartoctl exec -- carto-dataservices-observatory.sh \ load-data /tmp/obs_2018_04_18_e0da59b211.dump [INFO] creating database: ok [INFO] adding extensions to the database: ok [INFO] importing data: ok [INFO] creating indices: ok [INFO] configuring user grants: ok [INFO] updating dataservices configuration: ok [INFO] observatory data successfully loaded ```
Note
After running this tool for the very first time, ensure that you enable the LDS Data Observatory analysis at lds\_do.
### Enabling LDS Geocoding Analysis Located in **Builder server**. Setting `CARTO_DS_ANALYSIS_GEOCODER` config key to **true** enables the LDS internal geocoder analysis, in order to make it available in Builder's web interface. Steps: 1. Update `CARTO_DS_ANALYSIS_GEOCODER` in `~/carto/config.yml` accordingly ``` ini nodes - hostname: node01-lds.carto.lan user: privileges: true ssh_key: id_rsa command: /bin/sudo role: - name: dataservices release: "" installed: false env: - name: CARTO_DATASERVICES_ADDRESS value: 4.4.4.4 - name: CARTO_DATASERVICES_PORT value: "5433" - name: CARTO_DS_ANALYSIS_GEOCODER value: "true" package: [] tasks: [] ``` 2. Refresh **builder templates** and restart **builder service**
Note
Builder service will be restarted, therefore it will be unavailable for a few seconds.
``` bash cartoctl nodes roles refresh-templates \ --restart-services \ --release-path /opt/carto/tools \ builder Starting reload process on node node01.carto.lan Reloading role builder Restarting service builder ✔ Successfully reloaded builder ```
Note
You must apply this tool after loading the Geocoder database the first time after installation at geocoding\_database\_lds.
### Loading LDS Geocoding Database Located in **LDS server**. CARTO provides some internal geocoding functions that must be loaded with this tool, in order to get the most out of CARTO LDS. 1. Upload a tar file containing the geocoding data to the LDS server 2. Use this tool to load the data into the LDS database. The tool can work either with a gzipped tar file, or an uncompressed folder. ``` bash cartoctl exec -- carto-dataservices-geocoder.sh \ load-data /tmp/geocoder_dumps [INFO] loading data from /data-dataservices/tmp.4dSou7Wny9/geocoder_dumps/admin0_synonyms.sql: SET SET SET SET SET SET SET COPY 1332 -------- 43957 (1 row) ok [INFO] loading data from /data-dataservices/tmp.4dSou7Wny9/geocoder_dumps/admin1_decoder.sql: ... ... ```
Note
If both `geocoder` and `geocoder-patch` files are provided you must load first the `geocoder` one and then the `geocoder-patch`. For example, if you are provided with `geocoder-0.0.1.tar.gz` and `geocoder-patch-0.0.1-20181019.tar.gz` files, you must load first `geocoder-0.0.1.tar.gz` and then `geocoder-patch-0.0.1-20181019.tar.gz`.
Note
After running this tool for the very first time, ensure that you enable the LDS Geocoding analysis at lds\_geocoding.