编译并启动 schema-registry

近期版本(2024)

7.7.0 版的 schema-registry

操作参考:https://github.com/confluentinc/rest-utils/issues/367
schema-registry 需要 rest-utils,rest-utils 需要 common,common 需要 kafka
编译顺序:kafka -> common -> rest-utils -> schema-registry

1. 下载源码

到 rest-utils 的 pom.xml 中查看需要的 common 版本,到对应版本的 common 的 pom.xml 中查看需要的 kafka 版本——kafka 的版本在 gradle.properties 中,下载对应版本的 common 和 kafka,否则可能编译失败

git clone --depth 1 https://github.com/confluentinc/schema-registry.git
git clone --depth 1 https://github.com/confluentinc/rest-utils.git
git clone --branch v7.7.0-XXX --depth 1 https://github.com/confluentinc/common.git
git clone --branch v7.7.0-XXX-ccs --depth 1 https://github.com/confluentinc/kafka.git
2. 编译
  • kafka: ./gradlewAll publishToMavenLocal
    若出现报错Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain,访问:https://raw.githubusercontent.com/gradle/gradle/v8.5.0/gradle/wrapper/gradle-wrapper.jar,将下载的 jar 包放入 ./gradle/wrapper/ 目录
    ![[Pasted image 20240305114626.png]]

  • common: mvn install -Dmaven.test.skip=true
    ![[Pasted image 20240305114751.png]]

  • rest-utils: mvn install -Dmaven.test.skip=true
    ![[Pasted image 20240305114911.png]]

  • schema-registry: mvn package -DskipTests
    ![[Pasted image 20240305125529.png]]

3. 启动
  • 修改 schema-registry 的配置文件./config/schema-registry.properties 中的 kafka 地址
    kafkastore.bootstrap.servers=PLAINTEXT://localhost:9092
  • 在 schema-registry 目录中执行启动脚本./bin/schema-registry-start ./config/schema-registry.properties
  • 发送请求检查是否启动成功:curl -X GET http://localhost:8081/subjects

早期版本(2020)

5.3.2 版的 schema-registry

操作参考:https://blog.csdn.net/weixin_41609807/article/details/105275389
schema-registry 需要 rest-utils,rest-utils 需要 common
编译顺序:common -> rest-utils -> schema-registry

1. 下载源码
git clone --branch 5.3.2-post --depth 1 https://github.com/confluentinc/common.git
git clone --branch 5.3.2-post --depth 1 https://github.com/confluentinc/rest-utils.git
git clone --branch 5.3.2-post --depth 1 https://github.com/confluentinc/schema-registry.git
2. 编译
  • common: mvn install -Dmaven.test.skip=true
    ![[Pasted image 20240305135310.png]]

  • rest-utils: mvn install -Dmaven.test.skip=true
    ![[Pasted image 20240305135358.png]]

  • schema-registry: mvn install -Dmaven.test.skip=true
    ![[Pasted image 20240305135624.png]]

3. 启动
  • 修改 schema-registry 目录下的配置文件./config/schema-registry.properties 中的 zookeeper 地址
    kafkastore.connection.url=localhost:2181
  • 在 schema-registry 目录中执行启动脚本./bin/schema-registry-start ./config/schema-registry.properties
  • 发送请求检查是否启动成功:curl -X GET http://localhost:8081/subjects
  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值