07 GCloud Setup

本指南提供了一步式教程,说明如何在Google Compute Engine上自动部署带有Hadoop 1或Hadoop 2的Flink集群。通过Google的bdutil工具启动集群并部署Flink,无需额外配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Google Compute Engine Setup

This documentation provides instructions on how to setup Flink fully automatically with Hadoop 1 or Hadoop 2 on top of a Google Compute Enginecluster. This is made possible by Google’s bdutil which starts a cluster and deploys Flink with Hadoop. To get started, just follow the steps below.

Prerequisites

Install Google Cloud SDK

Please follow the instructions on how to setup the Google Cloud SDK. In particular, make sure to authenticate with Google Cloud using the following command:

gcloud auth login

Install bdutil

At the moment, there is no bdutil release yet which includes the Flink extension. However, you can get the latest version of bdutil with Flink support from GitHub:

git clone https://github.com/GoogleCloudPlatform/bdutil.git

After you have downloaded the source, change into the newly created bdutil directory and continue with the next steps.

Set up a bucket

If you have not done so, create a bucket for the bdutil config and staging files. A new bucket can be created with gsutil:

gsutil mb gs://<bucket_name>

Adapt the bdutil config

To deploy Flink with bdutil, adapt at least the following variables in bdutil_env.sh.

CONFIGBUCKET="<bucket_name>"
PROJECT="<compute_engine_project_name>"
NUM_WORKERS=<number_of_workers>

# set this to 'n1-standard-2' if you're using the free trial
GCE_MACHINE_TYPE="<gce_machine_type>"

# for example: "europe-west1-d"
GCE_ZONE="<gce_zone>"

bdutil’s Flink extension handles the configuration for you. You may additionally adjust configuration variables in extensions/flink/flink_env.sh. If you want to make further configuration, please take a look at configuring Flink. You will have to restart Flink after changing its configuration usingbin/stop-cluster and bin/start-cluster.

To bring up the Flink cluster on Google Compute Engine, execute:

./bdutil -e extensions/flink/flink_env.sh deploy
./bdutil shell
cd /home/hadoop/flink-install/bin
./flink run ../examples/WordCount.jar gs://dataflow-samples/shakespeare/othello.txt gs://<bucket_name>/output

Shut down your cluster

Shutting down a cluster is as simple as executing

./bdutil -e extensions/flink/flink_env.sh delete

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值