diff --git a/docs/faq.rst b/docs/faq.rst index 3fc8cefce..12a019895 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -145,13 +145,13 @@ In the example above, if a timed refresh is set for the dashboard, then every sl Why does fabmanager or superset freezed/hung/not responding when started (my home directory is NFS mounted)? ----------------------------------------------------------------------------------------- -superset creates and uses an sqlite database at ``~/.superset/superset.db``. Sqlite is known to `don't work well if used on NFS`__ due to broken file locking implementation on NFS. +By default, superset creates and uses an sqlite database at ``~/.superset/superset.db``. Sqlite is known to `don't work well if used on NFS`__ due to broken file locking implementation on NFS. __ https://www.sqlite.org/lockingv3.html -One work around is to create a symlink from ~/.superset to a directory located on a non-NFS partition. +You can override this path using the ``SUPERSET_HOME`` environment variable. -Another work around is to change where superset stores the sqlite database by adding ``SQLALCHEMY_DATABASE_URI = 'sqlite:////new/localtion/superset.db'`` in superset_config.py (create the file if needed), then adding the directory where superset_config.py lives to PYTHONPATH environment variable (e.g. ``export PYTHONPATH=/opt/logs/sandbox/airbnb/``). +Another work around is to change where superset stores the sqlite database by adding ``SQLALCHEMY_DATABASE_URI = 'sqlite:////new/location/superset.db'`` in superset_config.py (create the file if needed), then adding the directory where superset_config.py lives to PYTHONPATH environment variable (e.g. ``export PYTHONPATH=/opt/logs/sandbox/airbnb/``). How do I add new columns to an existing table --------------------------------------------- diff --git a/superset/config.py b/superset/config.py index 47126f8bd..bc91edd07 100644 --- a/superset/config.py +++ b/superset/config.py @@ -24,7 +24,10 @@ from superset.stats_logger import DummyStatsLogger STATS_LOGGER = DummyStatsLogger() BASE_DIR = os.path.abspath(os.path.dirname(__file__)) -DATA_DIR = os.path.join(os.path.expanduser('~'), '.superset') +if 'SUPERSET_HOME' in os.environ: + DATA_DIR = os.environ['SUPERSET_HOME'] +else: + DATA_DIR = os.path.join(os.path.expanduser('~'), '.superset') if not os.path.exists(DATA_DIR): os.makedirs(DATA_DIR)