Shkurupii commented on issue #11765:
URL: 
https://github.com/apache/incubator-superset/issues/11765#issuecomment-733824076


   @bzmatteo72 hi, eventually you should end up with config kinda mine. Pay 
attention that my application is bound to port 9000 and hidden behind nginx on 
https://dev-superset-01.localhost.localdomain/, mysql as backend and redis for 
brokers and cache.
   
   ```
   (venv) [superset@dev-superset-01 ~]$ cat config/superset_config.py
   from celery.schedules import crontab
   from cachelib.redis import RedisCache
   
   #---------------------------------------------------------
   # Superset specific config
   #---------------------------------------------------------
   
   SQLALCHEMY_DATABASE_URI = 'mysql://superset:passsssword@localhost/superset'
   
   ## include current/last day into reports
   DEFAULT_RELATIVE_END_TIME = "now"
   
   # Default configurator will consume the LOG_* settings below
   #LOGGING_CONFIGURATOR = DefaultLoggingConfigurator()
   
   # Console Log Settings
   
   LOG_FORMAT = "%(asctime)s:%(levelname)s:%(name)s:%(message)s"
   LOG_LEVEL = "INFO"
   
   # ---------------------------------------------------
   # Enable Time Rotate Log Handler
   # ---------------------------------------------------
   # LOG_LEVEL = DEBUG, INFO, WARNING, ERROR, CRITICAL
   
   ENABLE_TIME_ROTATE = True
   TIME_ROTATE_LOG_LEVEL = "DEBUG"
   FILENAME = "/var/log/apache-superset/superset.log"
   ROLLOVER = "midnight"
   INTERVAL = 1
   BACKUP_COUNT = 30
   
   # If the load balancer is inserting X-Forwarded-For/X-Forwarded-Proto 
headers, you should set ENABLE_PROXY_FIX = True in the superset config file to 
extract and use the headers.
   ENABLE_PROXY_FIX = True
   
   # Enable / disable scheduled email reports
   ENABLE_SCHEDULED_EMAIL_REPORTS = True
   ENABLE_ALERTS = True
   EMAIL_NOTIFICATIONS = True
   EMAIL_REPORTS_USER = "admin"
   EMAIL_REPORTS_SUBJECT_PREFIX = "[Report] "
   EMAIL_REPORTS_WEBDRIVER = "firefox"
   SMTP_HOST = "localhost"
   SMTP_STARTTLS = False
   SMTP_SSL = False
   SMTP_PORT = 25
   SMTP_USER = ""
   SMTP_PASSWORD = ""
   SMTP_MAIL_FROM = "[email protected]"
   
   WEBDRIVER_BASEURL = "http://0.0.0.0:9000/";
   WEBDRIVER_BASEURL_USER_FRIENDLY = 
"https://dev-superset-01.localhost.localdomain/";
   EMAIL_PAGE_RENDER_WAIT = 30
   
   class CeleryConfig(object):
       BROKER_URL = 'redis://localhost:6379/0'
       CELERY_IMPORTS = (
           'superset.sql_lab',
           'superset.tasks',
       )
       CELERY_RESULT_BACKEND = 
'db+mysql://superset:passsssword@localhost/superset'
       CELERYD_LOG_LEVEL = 'INFO'
       CELERYD_PREFETCH_MULTIPLIER = 10
       CELERY_ACKS_LATE = True
       CELERY_ANNOTATIONS = {
           'sql_lab.get_sql_results': {
               'rate_limit': '100/s',
           },
           'email_reports.send': {
               'rate_limit': '1/s',
               'time_limit': 320,
               'soft_time_limit': 350,
               'ignore_result': True,
           },
       }
       CELERYBEAT_SCHEDULE = {
           'email_reports.schedule_hourly': {
               'task': 'email_reports.schedule_hourly',
               'schedule': crontab(minute=1, hour='*'),
           },
       }
   
   CELERY_CONFIG = CeleryConfig
   
   RESULTS_BACKEND = RedisCache(
       host='localhost', port=6379, key_prefix='superset_results')
   
   SCREENSHOT_LOCATE_WAIT = 60
   SCREENSHOT_LOAD_WAIT = 60
   
   (venv) [superset@dev-superset-01 ~]$
   ```
   Apart of main superset config you should have also celery worker, celery 
beat and optionally celery flower services. [See 
daemonizing.html](https://docs.celeryproject.org/en/stable/userguide/daemonizing.html)
   If you need further assistance, ping me.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to