confluentinc / confluent-cli

Confluent Platform CLI
Other
60 stars 38 forks source link

confluent start -> Kafka failed to start #76

Closed zfedoran closed 6 years ago

zfedoran commented 6 years ago

I'm following the quick start guide and am seeing the following message after executing confluent start schema-registry.

ubuntu@ip-172-31-36-54:~$ confluent start schema-registry
    Starting zookeeper
    zookeeper is [UP]
    Starting kafka
    -Kafka failed to start
    kafka is [DOWN]
    Cannot start Schema Registry, Kafka Server is not running. Check your deployment

This is on a clean Ubuntu machine, the following commands were executed:

    1  sudo apt-get update
    2  sudo apt-get install default-jre
    3  wget -qO - http://packages.confluent.io/deb/3.1/archive.key | sudo apt-key add -
    4  sudo add-apt-repository "deb [arch=amd64] http://packages.confluent.io/deb/3.1 stable main"
    5  sudo apt-get update && sudo apt-get install confluent-platform-2.11
    6  sudo apt-get update && sudo apt-get install confluent-platform-oss-2.11
    7  confluent start schema-registry

It would be nice to display a bit more information about what is preventing Kafka from starting.

zfedoran commented 6 years ago

Looks like this is my fault, but please do add some more documentation on debugging issues with the underlying services starting :)

Issue (in my case):

ubuntu@ip-172-31-36-54:~$ /usr/bin/kafka-server-start /etc/kafka/server.properties
OpenJDK 64-Bit Server VM warning: Cannot open file /var/log/kafka/kafkaServer-gc.log due to Permission denied

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/ubuntu/hs_err_pid8248.log
zfedoran commented 6 years ago

Looks like there is another issue now.

ubuntu@ip-172-31-77-164:~$ confluent start
Starting zookeeper
zookeeper is [UP]
Starting kafka
kafka is [UP]
Starting schema-registry
|Schema Registry failed to start
schema-registry is [DOWN]
Starting kafka-rest
-Kafka Rest failed to start
kafka-rest is [DOWN]
Starting connect
connect is [UP]

If I run the command manually:

ubuntu@ip-172-31-77-164:~$ /usr/bin/schema-registry-start /etc/schema-registry/schema-registry.properties
Exception in thread "main" java.lang.NoSuchFieldError: PASSWORD
    at io.confluent.kafka.schemaregistry.rest.SchemaRegistryConfig.baseSchemaRegistryConfigDef(SchemaRegistryConfig.java:316)
    at io.confluent.kafka.schemaregistry.rest.SchemaRegistryConfig.<clinit>(SchemaRegistryConfig.java:310)
    at io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain.main(SchemaRegistryMain.java:41)
viveksinghggits commented 5 years ago

@zfedoran when I try to start the Kafka with the server.proerties file, I dont even get the error. This is what I get instead.

zookeeper is already running. Try restarting if needed
Starting kafka
-Kafka failed to start
kafka is [DOWN]

did you manage to resolve it somehow ?

touseefzaki commented 5 years ago

Run this command "sudo rm -fr /tmp/confl*" which removes all Kafka related log directories. This is obviously not a solution in a production environment or a “proper” test/dev environment. Use it only for sandbox and quick testing

mzubairahmed commented 5 years ago

Run this command "sudo rm -fr /tmp/confl*" which removes all Kafka related log directories. This is obviously not a solution in a production environment or a “proper” test/dev environment. Use it only for sandbox and quick testing

Thank @touseefzaki this works! but any idea why this issue happened in the first place?

touseefzaki commented 5 years ago

Run this command "sudo rm -fr /tmp/confl*" which removes all Kafka related log directories. This is obviously not a solution in a production environment or a “proper” test/dev environment. Use it only for sandbox and quick testing

Thank @touseefzaki this works! but any idea why this issue happened in the first place?

I faced this problem while using confluent with Ubunto in Windows 10 OS. As Windows OS is not so user friendly for these Open source softwares like Confluent. On which OS you are running it?

samanmunikar commented 3 years ago

Basically, I ran confluent log kafka command and read the logs. I found out that port 9092 was already occupied so I freed the port using fuser -k 9092/tcp command.