无法启动 Oryx - NoSuchMethodError
Unable to start Oryx - NoSuchMethodError
问题:
当使用 ALS 示例启动 oryx 服务层时,出现以下异常:
SEVERE: Exception sending context initialized event to listener
instance of class com.cloudera.oryx.lambda.serving.ModelManagerListener
java.lang.NoSuchMethodError: kafka.admin.AdminUtils.topicExists(Lorg/I0Itec/zkclient/ZkClient;Ljava/lang/String;)Z
at com.cloudera.oryx.kafka.util.KafkaUtils.topicExists(KafkaUtils.java:93)
at com.cloudera.oryx.lambda.serving.ModelManagerListener.contextInitialized(ModelManagerListener.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
上下文: 我在 docker 容器中的 CDH 5.7 上 运行 - 所有 jar 都在计算类路径建议的预期位置和 kafka (0.8.2.0) 已启动,运行 需要的主题:
**In dir opt/cloudera/parcels/CDH/jars:**
commons-cli-1.2.jar
kafka_2.10-0.8.2.0-kafka-1.4.0.jar
commons-collections-3.2.2.jar
kafka-clients-0.8.2.0-kafka-1.4.0.jar
commons-configuration-1.6.jar
protobuf-java-2.5.0.jar
hadoop-auth.jar
scala-library-2.11.8.jar
hadoop-common.jar
snappy-java-1.0.4.1.jar
hadoop-hdfs.jar
spark-examples-1.6.0-cdh5.7.0-hadoop2.6.0-cdh5.7.0.jar
htrace-core4-4.0.1-incubating.jar
zookeeper-copy.jar
配置:
kafka-brokers = "localhost:9092"
zk-servers = "localhost:2181"
hdfs-base = "hdfs:///user/example/Oryx"
oryx {
id = "ALSExample"
als {
rescorer-provider-class = null
}
input-topic {
broker = ${kafka-brokers}
lock = {
master = ${zk-servers}
}
}
update-topic {
broker = ${kafka-brokers}
lock = {
master = ${zk-servers}
}
}
batch {
streaming {
generation-interval-sec = 300
num-executors = 4
executor-cores = 8
executor-memory = "4g"
}
update-class = "com.cloudera.oryx.app.batch.mllib.als.ALSUpdate"
storage {
data-dir = ${hdfs-base}"/data/"
model-dir = ${hdfs-base}"/model/"
}
ui {
port = 4040
}
}
speed { model-manager-class = "com.cloudera.oryx.app.speed.als.ALSSpeedModelManager"
ui {
port = 4041
}
}
serving { model-manager-class = "com.cloudera.oryx.app.serving.als.model.ALSServingModelManager"
application-resources = "com.cloudera.oryx.app.serving,com.cloudera.oryx.app.serving.als"
api {
port = 8080
}
}
}
示例启动命令:
/oryx-run.sh serving --conf als-example.conf --app-jar oryx-serving-2.1.2.jar
要么
/oryx-run.sh serving --conf als-example.conf --app-jar example.jar
如有任何建议,我们将不胜感激:-)
在此处复制结论:CDH 5.7 附带并需要 Apache Kafka 0.9。所以,有必要使用支持0.9的Oryx 2.2.x,5.7。即将发布。
问题: 当使用 ALS 示例启动 oryx 服务层时,出现以下异常:
SEVERE: Exception sending context initialized event to listener
instance of class com.cloudera.oryx.lambda.serving.ModelManagerListener
java.lang.NoSuchMethodError: kafka.admin.AdminUtils.topicExists(Lorg/I0Itec/zkclient/ZkClient;Ljava/lang/String;)Z
at com.cloudera.oryx.kafka.util.KafkaUtils.topicExists(KafkaUtils.java:93)
at com.cloudera.oryx.lambda.serving.ModelManagerListener.contextInitialized(ModelManagerListener.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
上下文: 我在 docker 容器中的 CDH 5.7 上 运行 - 所有 jar 都在计算类路径建议的预期位置和 kafka (0.8.2.0) 已启动,运行 需要的主题:
**In dir opt/cloudera/parcels/CDH/jars:**
commons-cli-1.2.jar
kafka_2.10-0.8.2.0-kafka-1.4.0.jar
commons-collections-3.2.2.jar
kafka-clients-0.8.2.0-kafka-1.4.0.jar
commons-configuration-1.6.jar
protobuf-java-2.5.0.jar
hadoop-auth.jar
scala-library-2.11.8.jar
hadoop-common.jar
snappy-java-1.0.4.1.jar
hadoop-hdfs.jar
spark-examples-1.6.0-cdh5.7.0-hadoop2.6.0-cdh5.7.0.jar
htrace-core4-4.0.1-incubating.jar
zookeeper-copy.jar
配置:
kafka-brokers = "localhost:9092"
zk-servers = "localhost:2181"
hdfs-base = "hdfs:///user/example/Oryx"
oryx {
id = "ALSExample"
als {
rescorer-provider-class = null
}
input-topic {
broker = ${kafka-brokers}
lock = {
master = ${zk-servers}
}
}
update-topic {
broker = ${kafka-brokers}
lock = {
master = ${zk-servers}
}
}
batch {
streaming {
generation-interval-sec = 300
num-executors = 4
executor-cores = 8
executor-memory = "4g"
}
update-class = "com.cloudera.oryx.app.batch.mllib.als.ALSUpdate"
storage {
data-dir = ${hdfs-base}"/data/"
model-dir = ${hdfs-base}"/model/"
}
ui {
port = 4040
}
}
speed { model-manager-class = "com.cloudera.oryx.app.speed.als.ALSSpeedModelManager"
ui {
port = 4041
}
}
serving { model-manager-class = "com.cloudera.oryx.app.serving.als.model.ALSServingModelManager"
application-resources = "com.cloudera.oryx.app.serving,com.cloudera.oryx.app.serving.als"
api {
port = 8080
}
}
}
示例启动命令:
/oryx-run.sh serving --conf als-example.conf --app-jar oryx-serving-2.1.2.jar
要么
/oryx-run.sh serving --conf als-example.conf --app-jar example.jar
如有任何建议,我们将不胜感激:-)
在此处复制结论:CDH 5.7 附带并需要 Apache Kafka 0.9。所以,有必要使用支持0.9的Oryx 2.2.x,5.7。即将发布。