how to demonize superset with supervisor?

1,299 views
Skip to first unread message

Haytham Amin

unread,
Dec 6, 2016, 12:24:59 PM12/6/16
to airbnb_superset
is it possible to post an example of how to demonize Superset with Supervisor?

Sungju Jin

unread,
Dec 6, 2016, 5:33:06 PM12/6/16
to Haytham Amin, airbnb_superset
I assume you installed superset on virtualenv and config file (superset_config.py) is located under /data/superset/ dir like this.

```
cat /data/superset/superset_config.py
LOG_LEVEL = 'INFO'
ROW_LIMIT = 5000
SUPERSET_WORKERS = 4
```

Here's configuration for supervisord as I'm using.

```
[program:superset]
command = /usr/local/pyenv/versions/superset/bin/superset runserver
directory = /data/superset
environment = PATH='$PATH:/usr/local/pyenv/versions/superset/bin/',PYTHONPATH='$PYTHONPATH:/data/superset'
autostart = false
autorestart = true
startretries = 3
stdout_logfile = /data/logs/supervisor/superset.log
stdout_logfile_maxbytes = 100MB
stdout_logfile_backups = 5
stderr_logfile = /data/logs/supervisor/superset-err.log
stderr_logfile_maxbytes = 100MB
stderr_logfile_backups = 5

[program:superset-worker] # you need to run celery worker if you want to enable async mode in superset
command = /usr/local/pyenv/versions/superset/bin/superset worker
directory = /data/superset
environment = PATH='$PATH:/usr/local/pyenv/versions/superset/bin/',PYTHONPATH='$PYTHONPATH:/data/superset'
autostart = false
autorestart = true
startretries = 3
stdout_logfile = /data/logs/supervisor/superset-worker.log
stdout_logfile_maxbytes = 100MB
stdout_logfile_backups = 5
stderr_logfile = /data/logs/supervisor/superset-worker-err.log
stderr_logfile_maxbytes = 100MB
stderr_logfile_backups = 5
```


Cheers,
Sungju


On Wed, Dec 7, 2016 at 2:24 AM, Haytham Amin <haytham...@gmail.com> wrote:
is it possible to post an example of how to demonize Superset with Supervisor?

--
You received this message because you are subscribed to the Google Groups "airbnb_superset" group.
To unsubscribe from this group and stop receiving emails from it, send an email to airbnb_superset+unsubscribe@googlegroups.com.
To post to this group, send email to airbnb_superset@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/airbnb_superset/1f08782f-e816-402c-95e1-4c8477f6d8b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sungju Jin
- Hacker, Apache Usergrid PMC, ApacheCon & OSCON Speaker

Haytham Amin

unread,
Dec 6, 2016, 6:01:40 PM12/6/16
to airbnb_superset, haytham...@gmail.com
Super, thanks

Haytham Amin

unread,
Dec 6, 2016, 6:40:41 PM12/6/16
to airbnb_superset
ok so I ran into some error I dont understand. here are my /etc/supervisor/conf,d/superset.conf settings:
I have the superset_config.py file in the /data/superset/superset_config.py location and im not using virtualenv

[program:superset]
command = /usr/local/lib/python2.7/dist-packages/superset/bin/superset runserver
directory = /usr/local/lib/python2.7/dist-packages/superset/data/superset
environment = PATH='$PATH:/usr/local/lib/python2.7/dist-packages/superset/bin/',PYTHONPATH='$PYTHONPATH:/data/superset'
autostart = false
autorestart = true
startretries = 3
stdout_logfile = /var/log/superset.log
stdout_logfile_maxbytes = 100MB
stdout_logfile_backups = 5
stderr_logfile = /var/log/superset_err.log
stderr_logfile_maxbytes = 100MB
stderr_logfile_backups = 5


I run: 
Sudo supervisorclt start superset
superset: ERROR (spawn error)

Im getting for:
#sudo supervisorctl status superset
>superset      STOPPED   Not started

help please

Sungju Jin

unread,
Dec 6, 2016, 7:04:54 PM12/6/16
to Haytham Amin, airbnb_superset
please check logs (/var/log/superset_err.log, /var/log/superset.log)

--
You received this message because you are subscribed to the Google Groups "airbnb_superset" group.
To unsubscribe from this group and stop receiving emails from it, send an email to airbnb_superset+unsubscribe@googlegroups.com.
To post to this group, send email to airbnb_superset@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Haytham Amin

unread,
Dec 6, 2016, 7:10:43 PM12/6/16
to airbnb_superset, haytham...@gmail.com
found this in the superset_err.log:
/usr/bin/env: ‘python’: No such file or directory

Haytham Amin

unread,
Dec 7, 2016, 10:45:00 AM12/7/16
to airbnb_superset, haytham...@gmail.com
OK after some research I found the problem in the superset/bin/superset file line one: 
I changed /usr/bin/env python ----> /usr/bin/python and that seemed to make it work. However,I got another error related to Gunicron: /bin/sh: 1: gunicorn: not found

any suggestions?  

Haytham Amin

unread,
Dec 7, 2016, 10:45:27 PM12/7/16
to airbnb_superset, haytham...@gmail.com
Fixed it with adding sudo next to command = /usr/local/pyenv/versions/superset/bin/superset runserver, like so:
command = sudo /usr/local/pyenv/versions/superset/bin/superset runserver
Reply all
Reply to author
Forward
0 new messages