centos7的flink安装过程

安装步骤

  1. 下载flink的tar.gz包
  2. 修改flink的conf配置
  3. 下载需要的lib包

具体代码(以flink1.15为例)

# 下载flink的tar.gz包
wget https://archive.apache.org/dist/flink/flink-1.15.4/flink-1.15.4-bin-scala_2.12.tgz
tar -zxvf flink-1.15.4-bin-scala_2.12.tgz

# 修改flink的conf配置
vim /root/flink1.15/flink-1.15.4/conf/flink-conf.yaml 
# 将所有的bind后面的都改成0.0.0.0
jobmanager.bind-host: 0.0.0.0
taskmanager.bind-host: 0.0.0.0
rest.bind-address: 0.0.0.0

# 下载需要的jar包,我这边是需要mysql CDC到mysql
wget https://repo.maven.apache.org/maven2/org/apache/flink/flink-connector-jdbc/1.15.4/flink-connector-jdbc-1.15.4.jar
wget https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/5.1.9/mysql-connector-java-5.1.9.jar
wget https://repo1.maven.org/maven2/com/ververica/flink-sql-connector-mysql-cdc/2.0.2/flink-sql-connector-mysql-cdc-2.0.2.jar
# 下载的jar包放到/root/flink1.15/flink-1.15.4/lib就好,需要重启flink

# 启动flink
cd /root/flink1.15/flink-1.15.4/
./start-cluster.sh 
# 关闭flink
./stop-cluster.sh 
# 运行flink-sql(需要在flink启动的状态下)
./sql-client.sh -f m2dwm.sql
# 访问flink控制台
http://IP:8081/

你可能感兴趣的:(flink,大数据)