Redashを最新バージョンにしようとして相当ハマったのでブログします。
Redashはなぜかv2.0.0をインストールすると0.11.1+b2095がインストールされます。
流れ的には0.11.1を0.12にアップグレードし、2.0.0にアップグレードするようです。
ふぁ!?と思いますがいってみましょう!
※ちなみに環境としてはEC2の中でbootstrap.shを使って構築してます。
■How to Upgrade Redash
https://redash.io/help-onpremise/maintenance/how-to-upgrade-redash.html
・公式通りアップグレードしてみる
1 2 3 4 5 6 |
/opt/redash/redash-2.0.0/bin# ./upgrade Starting Redash upgrade: Found version: 2.0.0 Current version: 0.11.1+b2095 You need to have Redash v0.12.0 or newer to upgrade to post v1.0.0 releases. To upgrade to v0.12.0, run the upgrade script set to the legacy channel (--channel legacy). |
え…できない!?どうやら0.11使ってる奴らは–channel legacyつけてアップグレードしろと。
からの2系はv0.12にしてからアップグレードしろということみたい。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
/opt/redash/redash-2.0.0/bin# ./upgrade --channel legacy Starting Redash upgrade: Found version: 0.12.0 This version has been too long in the making and now finally released. Includes new visualizations, data sources, updated packages and numerous fixes and additions. See [CHANGELOG](https://github.com/getredash/redash/blob/master/CHANGELOG.md#v0120---2016-11-20) for full release notes. Huge thanks to over 30 contributors (!) that participated in this release. Continue with upgrade? (y/n): y Downloading release tarball... Unpacking to: redash.0.12.0.b2449... Changing ownership to redash... Linking .env file... Installing new Python packages (if needed)... Running migrations (if needed)... New migrations to run: 0025_add_query_snippets_table.py, 0026_add_access_control_tables.py, 0026_remove_query_trackers_redis_key.py Apply new migrations? (make sure you have backup) (y/n): y Applying 0025_add_query_snippets_table.py... Applying 0026_add_access_control_tables.py... Applying 0026_remove_query_trackers_redis_key.py... Linking to current version... Restarting... Done! Enjoy. |
できた。次はv2.0.0にアップグレードしてみる!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
/opt/redash/redash-2.0.0/bin# ./upgrade Starting Redash upgrade: Found version: 2.0.0 Current version: 0.12.0+b2449 * Before doing an upgrade, please make sure you have a backup. * If you have any issues, please refer to the troubleshooting section in the upgrade guide: https://redash.io/help-onpremise/maintenance/how-to-upgrade-redash.html * If the upgrade guide doesn't help, you can ask for help on the forum (https://discuss.redash.io). Full CHANGELOG for this release: https://github.com/getredash/redash/blob/master/CHANGELOG.md#v200---2017-08-08 Continue with upgrade? (y/n): y Downloading release tarball... Unpacking to: redash.2.0.0.b2990... Changing ownership to redash... Linking .env file... Installing new Python packages (if needed)... Running migrations (if needed)... Failed running: sudo -u redash bin/run ./manage.py db upgrade Exit status: 1 Output: Traceback (most recent call last): File "/opt/redash/redash.2.0.0.b2990/manage.py", line 9, in <module> manager() File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/flask/cli.py", line 345, in main return AppGroup.main(self, *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/flask/cli.py", line 229, in decorator return __ctx.invoke(f, *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/flask_migrate/cli.py", line 132, in upgrade _upgrade(directory, revision, sql, tag, x_arg) File "/usr/lib/python2.7/dist-packages/flask_migrate/__init__.py", line 239, in upgrade command.upgrade(config, revision, sql=sql, tag=tag) File "/usr/lib/python2.7/dist-packages/alembic/command.py", line 254, in upgrade script.run_env() File "/usr/lib/python2.7/dist-packages/alembic/script/base.py", line 425, in run_env util.load_python_file(self.dir, 'env.py') File "/usr/lib/python2.7/dist-packages/alembic/util/pyfiles.py", line 93, in load_python_file module = load_module_py(module_id, path) File "/usr/lib/python2.7/dist-packages/alembic/util/compat.py", line 75, in load_module_py mod = imp.load_source(module_id, path, fp) File "migrations/env.py", line 87, in <module> run_migrations_online() File "migrations/env.py", line 72, in run_migrations_online connection = engine.connect() File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2082, in connect return self._connection_cls(self, **kwargs) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/base.py", line 90, in __init__ if connection is not None else engine.raw_connection() File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2168, in raw_connection self.pool.unique_connection, _connection) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2142, in _wrap_pool_connect e, dialect, self) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1456, in _handle_dbapi_exception_noconnection exc_info File "/usr/lib64/python2.7/dist-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2138, in _wrap_pool_connect return fn() File "/usr/lib64/python2.7/dist-packages/sqlalchemy/pool.py", line 328, in unique_connection return _ConnectionFairy._checkout(self) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/pool.py", line 766, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/pool.py", line 516, in checkout rec = pool._do_get() File "/usr/lib64/python2.7/dist-packages/sqlalchemy/pool.py", line 1229, in _do_get return self._create_connection() File "/usr/lib64/python2.7/dist-packages/sqlalchemy/pool.py", line 333, in _create_connection return _ConnectionRecord(self) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/pool.py", line 461, in __init__ self.__connect(first_connect_check=True) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/pool.py", line 651, in __connect connection = pool._invoke_creator(self) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 105, in connect return dialect.connect(*cargs, **cparams) File "/usr/lib64/python2.7/dist-packages/sqlalchemy/engine/default.py", line 392, in connect return self.dbapi.connect(*cargs, **cparams) File "/usr/local/lib64/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect conn = _connect(dsn, connection_factory=connection_factory, async=async) sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: Ident authentication failed for user "redash" |
おいいいいいw
公式を見ると。。
v1系から.envの指定が変わったので変更してみる。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
/opt/redash# cat .env export REDASH_LOG_LEVEL="INFO" export REDASH_REDIS_URL=redis://localhost:6379/1 export REDASH_DATABASE_URL="postgresql:///redash" #export REDASH_DATABASE_URL="postgresql://redash" export REDASH_COOKIE_SECRET=veryverysecret #export REDASH_STATIC_ASSETS_PATH="../rd_ui/dist/" export REDASH_MAIL_SERVER="localhost" export REDASH_MAIL_PORT="25" export REDASH_MAIL_USE_TLS="false" export REDASH_MAIL_USE_SSL="false" export REDASH_MAIL_USERNAME="None" export REDASH_MAIL_PASSWORD="None" export REDASH_MAIL_DEFAULT_SENDER="redash@adachin-gmail.com" export REDASH_HOST="https://redash.adachin.com" |
これで良さそう。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
/opt/redash/redash-2.0.0# bin/upgrade Starting Redash upgrade: Found version: 2.0.0 Current version: 0.12.0+b2449 * Before doing an upgrade, please make sure you have a backup. * If you have any issues, please refer to the troubleshooting section in the upgrade guide: https://redash.io/help-onpremise/maintenance/how-to-upgrade-redash.html * If the upgrade guide doesn't help, you can ask for help on the forum (https://discuss.redash.io). Full CHANGELOG for this release: https://github.com/getredash/redash/blob/master/CHANGELOG.md#v200---2017-08-08 Continue with upgrade? (y/n): y Downloading release tarball... Unpacking to: redash.2.0.0.b2990... Changing ownership to redash... Linking .env file... Installing new Python packages (if needed)... Running migrations (if needed)... Linking to current version... Restarting... Done! Enjoy. |
キタ━━━━(゚∀゚)━━━━!!
・redash再起動
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
/opt/redash# /etc/init.d/redash_supervisord start Starting process supervisor supervisord Traceback (most recent call last): File "/usr/local/bin/supervisord", line 5, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in <module> add_activation_listener(lambda dist: dist.activate()) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 933, in subscribe callback(dist) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in <lambda> add_activation_listener(lambda dist: dist.activate()) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2576, in activate for pkg in self._get_metadata('namespace_packages.txt'): File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2566, in _get_metadata for line in self.get_metadata_lines(name): File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1589, in get_metadata_lines return yield_lines(self.get_metadata(name)) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1581, in get_metadata return self._get(self._fn(self.egg_info, name)) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1692, in _get with open(path, 'rb') as stream: IOError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/google_gax-0.15.15-py2.7.egg/EGG-INFO/namespace_packages.txt' 1 /opt/redash# chmod 644 /usr/lib/python2.7/dist-packages/google_gax-0.15.15-py2.7.egg/EGG-INFO/namespace_packages.txt /opt/redash# /etc/init.d/redash_supervisord start Starting process supervisor supervisord 0 |
権現のエラーが出たけど変更して起動された。
完全に忘れてた自動起動も忘れずに。
1 2 |
# chkconfig nginx on # chkconfig postgresql93 on |
しかし!!!
なぜかSetting>DatasourcesのTypeにAmazon AthenaとBigQueryが出てこない!
■Troubleshooting
いろいろとpipでぶち込むのだが、
公式通りにバージョン指定してやってもまったく表示されなかったので、
最新バージョンでインストールしてみる。
・PyAthena
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# pip install PyAthena Collecting PyAthena Using cached PyAthena-1.2.0-py2.py3-none-any.whl Requirement already satisfied: future in /usr/local/lib/python2.7/site-packages (from PyAthena) Requirement already satisfied: botocore>=1.5.52 in /usr/lib/python2.7/dist-packages (from PyAthena) Requirement already satisfied: futures in /usr/lib/python2.7/dist-packages (from PyAthena) Requirement already satisfied: tenacity>=4.1.0 in /usr/local/lib/python2.7/site-packages (from PyAthena) Requirement already satisfied: boto3>=1.4.4 in /usr/local/lib/python2.7/site-packages (from PyAthena) Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/lib/python2.7/dist-packages (from botocore>=1.5.52->PyAthena) Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python2.7/site-packages (from botocore>=1.5.52->PyAthena) Requirement already satisfied: docutils>=0.10 in /usr/lib/python2.7/dist-packages (from botocore>=1.5.52->PyAthena) Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python2.7/site-packages (from tenacity>=4.1.0->PyAthena) Requirement already satisfied: monotonic>=0.6 in /usr/local/lib/python2.7/site-packages (from tenacity>=4.1.0->PyAthena) Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in /usr/local/lib/python2.7/site-packages (from boto3>=1.4.4->PyAthena) Installing collected packages: PyAthena Successfully installed PyAthena-1.2.0 |
・google-api-python-client、oauth2client
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# pip install google-api-python-client oauth2client Collecting google-api-python-client Downloading google_api_python_client-1.6.4-py2.py3-none-any.whl (53kB) 100% |████████████████████████████████| 61kB 6.0MB/s Collecting oauth2client Using cached oauth2client-4.1.2-py2.py3-none-any.whl Requirement already satisfied: six<2dev,>=1.6.1 in /usr/local/lib/python2.7/site-packages (from google-api-python-client) Requirement already satisfied: httplib2<1dev,>=0.9.2 in /usr/local/lib/python2.7/site-packages (from google-api-python-client) Collecting uritemplate<4dev,>=3.0.0 (from google-api-python-client) Downloading uritemplate-3.0.0-py2.py3-none-any.whl Requirement already satisfied: rsa>=3.1.4 in /usr/local/lib/python2.7/site-packages (from oauth2client) Requirement already satisfied: pyasn1>=0.1.7 in /usr/lib/python2.7/dist-packages (from oauth2client) Requirement already satisfied: pyasn1-modules>=0.0.5 in /usr/local/lib/python2.7/site-packages (from oauth2client) Installing collected packages: oauth2client, uritemplate, google-api-python-client Found existing installation: uritemplate 0.6 Uninstalling uritemplate-0.6: Successfully uninstalled uritemplate-0.6 Successfully installed google-api-python-client-1.6.4 oauth2client-4.1.2 uritemplate-3.0.0 /opt/redash# /etc/init.d/redash_supervisord restart Restarting process supervisor supervisord 0 |
結果…
OK!!
■まとめ
アップグレード方法いけてなさすぎるのでなんとかしてほちい。
公式ちゃんと直してほしい!w(コミッターだ)
前回Redshiftで連携してみましたが、
次回はAmazon Athena使って可視化してみたいと思います。
0件のコメント