---
order: 1
---
# Deployment Guide
English | [简体中文](../../../zh/documents/start/deployment.md)
-----
> At present, ***BitSail*** supports flink deployment on Yarn and native Kubernetes.
Here are the contents of this part:
- [Yarn Deployment](#yarn_deployment)
- [Pre Configuration](#jump_pre_configure)
- [Configure Hadoop Environment](#jump_configure_hadoop)
- [Configure Flink Cluster](#jump_configure_flink)
- [Submit to Yarn](#jump_submit_to_yarn)
- [Submit an example job](#jump_submit_example)
- [Log for Debugging](#jump_log)
- [Submit to Local Flink Session](#jump_submit_local)
- [Run in Remote Flink Session](#jump_flink_remote)
- [Run Locally](#jump_flink_local)
- [Native Kubernetes Deployment](#native_kubernetes_deployment)
- [Prerequisites](#jump_prerequisites_k8s)
- [Pre Configuration](#jump_pre_configuration_k8s)
- [Setup RBAC](#jump_configure_RBAC)
- [Application Mode](#jump_application_mode)
- [Build Custom Flink Image](#jump_build_custom_flink_image)
- [Start Application](#jump_start_application)
- [Stop Application](#jump_stop_application)
- [Kubernetes Logs](#jump_kubernetes_logs)
- [History Server](#jump_history_server)
-----
# Yarn Deployment
Below is a step-by-step guide to help you effectively deploy it on Yarn.
## Pre configuration
### Configure Hadoop Environment
To support Yarn deployment, `HADOOP_CLASSPATH` has to be set in system environment properties. There are two ways to set this environment property:
1. Set `HADOOP_CLASSPATH` directly.
2. Set `HADOOP_HOME` targeting to the hadoop dir in deploy environment. The [bitsail](https://github.com/bytedance/bitsail/blob/master/bitsail-dist/src/main/archive/bin/bitsail) scripts will use the following command to generate `HADOOP_CLASSPATH`.
```shell
if [ -n "$HADOOP_HOME" ]; then
export HADOOP_CLASSPATH=$($HADOOP_HOME/bin/hadoop classpath)
fi
```
### Configure Flink Cluster
After packaging, the project production contains a file [conf/bitsail.conf](https://github.com/bytedance/bitsail/blob/master/bitsail-dist/src/main/resources/bitsail.conf).
This file describes the system configuration of deployment environment, including the flink path and some other default parameters.
Here are some frequently-used options in the configuration file:
| Prefix | Parameter name | Description | Example |
|---|---|---|---|
| sys.flink. | flink_home | The root dir of flink. | ${BITSAIL_HOME}/embedded/flink |
| checkpoint_dir | The path storing the meta data file and data files of checkpoints. Reference: Flink Checkpoints |
"hdfs://opensource/bitsail/flink-1.11/checkpoints/" | |
| flink_default_properties | General flink runtime options configued by "-D". | { classloader.resolve-order: "child-first" akka.framesize: "838860800b" rest.client.max-content-length: 838860800 rest.server.max-content-len } |
| Key | Required or Optional | Default | Type | Description |
|---|---|---|---|---|
| kubernetes.cluster-id | Optional | bitsail-<instance-id> | String | The cluster-id, which should be no more than 45 characters, is used for identifying a unique Flink cluster. If not set, the client will automatically generate it with a random numeric ID with 'bitsail-' prefix. |
| kubernetes.cluster.jar.path | Optional | "/opt/bitsail/bitsail-core.jar" | String | The BitSail jar path in kubernetes cluster. |
| kubernetes.container.image | Required | The default value depends on the actually running version. In general it looks like "flink:<FLINK_VERSION>-scala_<SCALA_VERSION>" | String | Image to use for BitSail containers. The specified image must be based upon the same Apache Flink and Scala versions as used by the application. Visit https://hub.docker.com/_/flink?tab=tags for the images provided by the Flink project. |
| kubernetes.container.image.pull-policy | Optional | IfNotPresent | Enum. Possible values: [IfNotPresent, Always, Never] | The Kubernetes container image pull policy (IfNotPresent or Always or Never). The default policy is IfNotPresent to avoid putting pressure to image repository. |
| kubernetes.container.image.pull-secrets | Optional | (none) | List <String> | A semicolon-separated list of the Kubernetes secrets used to access private image registries. |
| kubernetes.hadoop.conf.config-map.name | Optional | (none) | String | Specify the name of an existing ConfigMap that contains custom Hadoop configuration to be mounted on the JobManager(s) and TaskManagers. |
| kubernetes.jobmanager.cpu | Optional | 1.0 | Double | The number of cpu used by job manager |
| kubernetes.jobmanager.service-account | Required | "default" | String | Service account that is used by jobmanager within kubernetes cluster. The job manager uses this service account when requesting taskmanager pods from the API server. |
| kubernetes.namespace | Optional | "default" | String | The namespace that will be used for running the jobmanager and taskmanager pods. |
| kubernetes.taskmanager.cpu | Optional | -1.0 | Double | The number of cpu used by task manager. By default, the cpu is set to the number of slots per TaskManager |