I see below error in my /var/log when I start Standalone schema registry. I have the Apache Zookeeper and Kafka server up and running. I have java location in profile path and java home variables.
[Oct 5 16:18:18 chn-vm-operaxd1 systemd: Started RESTful Avro schema registry for Apache Kafka.
Oct 5 16:18:18 chn-vm-operaxd1 schema-registry-start: /usr/bin/schema-registry-run-class: line 174: exec: java: not found
Oct 5 16:18:18 chn-vm-operaxd1 systemd: confluent-schema-registry.service: main process exited, code=exited, status=127/n/a
Oct 5 16:18:18 chn-vm-operaxd1 systemd: Unit confluent-schema-registry.service entered failed state.
Oct 5 16:18:18 chn-vm-operaxd1 systemd: confluent-schema-registry.service failed.
What user are you starting it as, and does that user have
JAVA_HOME configured properly? Double check that
$JAVA_HOME/bin/java -version succeeds when run as that user.
What deployment method are you using for ZooKeeper, Kafka, and Schema Registry? i.e., which docs page are you following?
Thank you for your response,
I’m starting the schema registry service as root user.
I double checked and the $JAVA_HOME is configured properly, below is the output from root user,
java version “11.0.7” 2020-04-14 LTS
Java™ SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)
Yes, the deployment method is ZooKeeper, Kafka and Schema Registry. I have the ZooKeper and Kafka server up and running.
The document page I’m following is,
When I run the step 6 ( Start Schema Registry), I’m getting my error (confluent-schema-registry.service failed.) .
I’d recommend following the latest docs from Confluent here.
This still seems like a java install / config issue. Since the service runs as
# cat /lib/systemd/system/confluent-schema-registry.service
You might ensure that java works for that user, e.g.:
# sudo su -l cp-schema-registry -s /bin/bash
Last login: Fri Oct 20 20:47:01 UTC 2023 on pts/0
[cp-schema-registry@localhost ~]$ java -version
openjdk version "11.0.21" 2023-10-17 LTS
OpenJDK Runtime Environment (Red_Hat-22.214.171.124.9-1) (build 11.0.21+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-126.96.36.199.9-1) (build 11.0.21+9-LTS, mixed mode, sharing)
I’m able to verify that the Java works for cp-schema-registry user, here is the output,
Do you think it probably has issue with java version I have installed ? Is there a recommended java version for schema registry.
Thank you for your valuable inputs.
That version of Java is OK. Java 17 is recommended but 8 and 11 are also supported.
Did you start from scratch following the Confluent docs? If you haven’t, I’d recommend doing that (and installing v 7.5) since I see some differences between the latest docs and this page that you were following.
Another thing you could try is to explicitly set
/lib/systemd/system/confluent-schema-registry.service. For example, if the
java executable is located at
/usr/lib/jvm/java-11-openjdk-188.8.131.52.9-2.el9.x86_64/bin/java, you’d add this line to the service file:
systemctl daemon-reload to reload the service definition and then try starting Schema Registry again.