DataSource Athena

Redashにおいて表題の通り使えるように設定した。

■ 環境

  • Amazon Athena
  • Redash 3.0.0

■ Data Sources

画面右上のデータベース(?)のマークで”Settings > DATA SOURCES“。

+New Data Source“から追加する。

  • Type: Amazon Athena
  • Name: 自身がわかりやすい名前で。athenaとつけておいた。
  • AWS Region: 使用するAthenaのリージョンを。ap-northeast-1。
  • AWS Access Key: Athenaの権限を持つアクセスキーを登録。
  • AWS Secret Key: AccessKeyと対のものを。
  • S3 Staging Path: Athenaの実行結果やメタ情報が出力されるS3のパスを指
  • 定。
  • Schema Name: デフォルトでは”default”のようだ。無記入でもOK。
  • KMS Key: 無記入

上記で設定し、”Test Connection“も試し”Success“となればOKである。

設定後ではあるが下記のようになった。

以上。

■ 関連

redash 3.0.0 upgrade

redash 3.0.0 upgrade

表題の通り。公式のAMIで起動しているredashで下記のような表示がされていたのでupgradeしてみた。たぶん使い始めた時にはすでに表示されていたはずである…。

■ 環境

  • redash 2.0.0 → 3.0.0
  • Ubuntu 16.04
  • AWS

■ redash upgrade

New Redash version available“のリンクからアクセスし、upgradeの方法を確認してみる。

Re:dash Releases
https://version.redash.io/

最新版である”3.0.0“の”Upgrade Instructions“から下記にアクセスした。

How to Upgrade | Redash
https://redash.io/help/open-source/admin-guide/how-to-upgrade

この通りコマンドを実行したがエラーとなった。

$ sudo /opt/redash/current/bin/upgrade
Starting Redash upgrade:
Found version: 3.0.0
Current version: 2.0.0+b2990
* 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
Continue with upgrade? (y/n): y
Downloading release tarball...
Unpacking to: redash.3.0.0.b3134...
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.3.0.0.b3134/manage.py", line 6, in 
    from redash.cli import manager
  File "/opt/redash/redash.3.0.0.b3134/redash/__init__.py", line 70, in 
    import_query_runners(settings.QUERY_RUNNERS)
  File "/opt/redash/redash.3.0.0.b3134/redash/query_runner/__init__.py", line 175, in import_query_runners
    __import__(runner_import)
  File "/opt/redash/redash.3.0.0.b3134/redash/query_runner/big_query.py", line 18, in 
    import apiclient.errors
  File "/usr/local/lib/python2.7/dist-packages/apiclient/__init__.py", line 19, in 
    from googleapiclient import discovery
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py", line 71, in 
    from oauth2client.client import GoogleCredentials
  File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 47, in 
    from oauth2client import crypt
  File "/usr/local/lib/python2.7/dist-packages/oauth2client/crypt.py", line 45, in 
    from oauth2client import _openssl_crypt
  File "/usr/local/lib/python2.7/dist-packages/oauth2client/_openssl_crypt.py", line 16, in 
    from OpenSSL import crypto
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in 
    from OpenSSL import rand, crypto, SSL
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 105, in 
    SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

$

前述のURLの”Troubleshooting“に記載があったので”pyOpenSSL“のversionを確認すると、”3.0.0“では”16.2.0“が必要なようである。現状を確認。

$ pip list --format=legacy | grep pyOpenSSL
pyOpenSSL (0.14)
$

まずは”pyOpenSSL“から”upgrade“する必要があるようだ。

$ sudo pip install --upgrade pyOpenSSL

再度versionを確認すると下記のようになった。

$ pip list --format=legacy | grep pyOpenSSL
pyOpenSSL (17.5.0)
$

随分と上がったがまぁ良いだろう。これで再度”upgrade“を実行する。

$ sudo /opt/redash/current/bin/upgrade
Starting Redash upgrade:
Found version: 3.0.0
Current version: 2.0.0+b2990
* 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
Continue with upgrade? (y/n): y
Downloading release tarball...
Unpacking to: redash.3.0.0.b3134...
Changing ownership to redash...
Linking .env file...
Installing new Python packages (if needed)...
Running migrations (if needed)...
Linking to current version...
Restarting...
Done! Enjoy.
$

画面上でもフッターのversionが”3.0.0“になったのを確認することができた。

以上。

■ 関連

DataSource Athena