5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Azure Blob Storage にデータを蓄積しながら、Google Cloud Storage にもデータを蓄積しよう

Last updated at Posted at 2018-03-31

前々回、前回のブログで、 AWS 上で生成されたデータを、 AWS S3 にストアしながら、 GCP GCS にもデータを流して、ストアする方法を書きました。

今回は、Azure 上で生成されたデータを、 Azure Blob Storage にストアしながら、 GCP GCS にもデータを流してストアする方法を書きます。 GCP GCS をデータレイクにして、 Google BigQuery などで分析を行うことを想定しています。

  • GCP 上の NiFi
    ss 2018-03-31 12.52.30.png

  • AWS 上の NiFi
    ss 2018-03-31 12.52.28.png

  • Azure 上の NiFi
    ss 2018-03-31 12.52.24.png

Azure での作業

  • Azure 上で仮想マシンを作成
sudo yum -y update
sudo yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel
sudo sh -c "echo 'export JAVA_HOME=/usr/lib/jvm/jre-openjdk' >> /etc/profile.d/jdk.sh"
sudo sh -c "echo 'export PATH=\$JAVA_HOME/bin:\$PATH' >> /etc/profile.d/jdk.sh"
source /etc/profile.d/jdk.sh
wget https://archive.apache.org/dist/nifi/1.4.0/nifi-1.4.0-bin.tar.gz
tar zxvf nifi-1.4.0-bin.tar.gz
cd nifi-1.4.0/bin
./nifi.sh start
  • port 8080 をオープン

  • http://[ipaddress]:8080/nifi にアクセスし、正常に NiFi の UI が表示されるか確認

  • Azure Blob を作成
    ss 2018-03-31 13.01.35.png

  • ストレージアカウント名、アクセスキー、コンテナ名を確認
    ss 2018-03-31 12.58.19.png

  • NiFi の PutAzureBlobStorage Processor を作成し、Property タブで、下記を入力

  • Storage Account Name : ストレージアカウント名
  • Storage Account Key : アクセスキー
  • Container name : コンテナ名
  • Blob : 任意の名前
    ss 2018-03-31 12.51.34.png
  • GenerateFlowFile を作成し、GenerateFlowFIle と PutAzureBlobStorage 接続し、両 Processor を実行
  • Blob で、ファイルが作成されていることを確認

GCP での作業

  • GCP 上にインストールした、 NiFi http://[ipaddress]:8080/nifi にアクセス
  • Input Port を作成
  • Input Port Name : Azure

Azure での作業

  • Azure 上にインストールした、 NiFi http://[ipaddress]:8080/nifi にアクセス
  • Remote Process Group を作成
  • URLs : [GCP 上の NiFI の URL]
    ss 2018-03-31 12.43.36.png

以上

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?