From 7de498cc954ab4cb17978f5b3f0d5181cf345310 Mon Sep 17 00:00:00 2001 From: Carla Date: Thu, 31 Mar 2016 16:01:22 +0200 Subject: [PATCH] Add redis/sentinel examples --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7b77ae4..73d7841 100644 --- a/README.md +++ b/README.md @@ -57,23 +57,27 @@ Steps to deploy a new Data Services API version : ``` - # SELECT CDB_Conf_SetConf('redis_metadata_config', '{"redis_host": "localhost", "redis_port": 26379, "sentinel_master_id": "mymaster", "timeout": 0.1, "redis_db": 5}'); - # SELECT CDB_Conf_SetConf('redis_metrics_config', '{"redis_host": "localhost", "redis_port": 26379, "sentinel_master_id": "mymaster", "timeout": 0.1, "redis_db": 5}'); - - # SELECT CDB_Conf_SetConf('heremaps_conf', '{"app_id": "APP_ID", "app_code": "APP_CODE", "geocoder_cost_per_hit": "COST_PER_HIT"}'); - # SELECT CDB_Conf_SetConf('user_config', '{"is_organization": false, "entity_name": ""}') - # SELECT CDB_Conf_SetConf('mapzen_conf', '{"routing_app_key": "ROUTING_API_KEY", "geocoder_app_key": "GEOCODER_API_KEY"}'); - # SELECT CDB_Conf_SetConf('logger_con', '{"geocoder_log_path": "/tmp/geocodings.log"}') + # If sentinel is used: + SELECT CDB_Conf_SetConf('redis_metadata_config', '{"sentinel_host": "localhost", "sentinel_port": 26379, "sentinel_master_id": "mymaster", "timeout": 0.1, "redis_db": 5}'); + SELECT CDB_Conf_SetConf('redis_metrics_config', '{"sentinel_host": "localhost", "sentinel_port": 26379, "sentinel_master_id": "", "timeout": 0.1, "redis_db": 5}'); + # If sentinel is not used + SELECT CDB_Conf_SetConf('redis_metadata_config', '{"redis_host": "localhost", "redis_port": 26379, "sentinel_master_id": "mymaster", "timeout": 0.1, "redis_db": 5}'); + SELECT CDB_Conf_SetConf('redis_metrics_config', '{"redis_host": "localhost", "redis_port": 6379, "sentinel_master_id": "mymaster", "timeout": 0.1, "redis_db": 5}'); + + SELECT CDB_Conf_SetConf('heremaps_conf', '{"app_id": "APP_ID", "app_code": "APP_CODE", "geocoder_cost_per_hit": "COST_PER_HIT"}'); + SELECT CDB_Conf_SetConf('user_config', '{"is_organization": false, "entity_name": ""}') + SELECT CDB_Conf_SetConf('mapzen_conf', '{"routing_app_key": "ROUTING_API_KEY", "geocoder_app_key": "GEOCODER_API_KEY"}'); + SELECT CDB_Conf_SetConf('logger_con', '{"geocoder_log_path": "/tmp/geocodings.log"}') ``` -- configure plproxy to point to the same user database (you could do in a different one) +- configure plproxy to point to the a database (you can use a specific database for the server or your same user) ``` - SELECT CDB_Conf_SetConf('geocoder_server_config', '{ "connection_str": "host=localhost port=5432 dbname=cartodb_dev_user_accf0647-d942-4e37-b129-8287c117e687_db user=postgres"}'); + SELECT CDB_Conf_SetConf('geocoder_server_config', '{ "connection_str": "host=localhost port=5432 dbname= user=postgres"}'); ``` - configure the search path in order to be able to execute the functions without using the schema: ``` - ALTER ROLE "" SET search_path='"$user", public, cartodb, cdb_dataservices_client'; + ALTER ROLE "" SET search_path="$user", public, cartodb, cdb_dataservices_client; ```