Unable to start zookeeper and kafka service

Hi,

When I try to start the zookeeper and kafka services I get the following error “confluent-zookeeper.service: Failed to determine user credentials: No such process”. I had a look and the cp-kafka user isn’t being created when I install the Confluent Platform using only Confluent Community components using this url Manual Install using Systemd on Ubuntu and Debian | Confluent Documentation.

Is there a step I am missing during installation?

My VM setup is as follows
OS:- Ubuntu 20.04.2 LTS
Java:- openjdk version “11.0.11” 2021-04-20 LTS (Amazon Corretto)

Hi,

could you provide some log output?

How does your zookeeper config look like?

Hi,

Thanks for the feedback.
I only changed the following values in my zookeeper.properties file
advertised.listeners=PLAINTEXT://xxx.xxx.xxx.xxx:9092, where xxx.xxx.xxx.xxx is the IP of my VM.

log.retention.hours=2190
log.segment.bytes=545728
log.retention.check.interval.ms=150000

Herewith the error I get when starting zookeeper

johnnyl@confluent-kafka:~$ sudo systemctl start confluent-zookeeper
johnnyl@confluent-kafka:~$ sudo systemctl status confluent-zookeeper
● confluent-zookeeper.service - Apache Kafka - ZooKeeper
     Loaded: loaded (/lib/systemd/system/confluent-zookeeper.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-06-25 08:53:19 UTC; 2s ago
       Docs: http://docs.confluent.io/
    Process: 2427 ExecStart=/usr/bin/zookeeper-server-start /etc/kafka/zookeeper.properties (code=exited, status=217/USER)
   Main PID: 2427 (code=exited, status=217/USER)

Jun 25 08:53:19 confluent-kafka systemd[1]: Started Apache Kafka - ZooKeeper.
Jun 25 08:53:19 confluent-kafka systemd[2427]: confluent-zookeeper.service: Failed to determine user credentials: No such process
Jun 25 08:53:19 confluent-kafka systemd[2427]: confluent-zookeeper.service: Failed at step USER spawning /usr/bin/zookeeper-server-start: No such process
Jun 25 08:53:19 confluent-kafka systemd[1]: confluent-zookeeper.service: Main process exited, code=exited, status=217/USER
Jun 25 08:53:19 confluent-kafka systemd[1]: confluent-zookeeper.service: Failed with result 'exit-code'.

Content of confluent-zookeeper.service

johnnyl@confluent-kafka:~$ sudo nano /lib/systemd/system/confluent-zookeeper.service
  GNU nano 4.8                                                   /lib/systemd/system/confluent-zookeeper.service
[Unit]
Description=Apache Kafka - ZooKeeper
Documentation=http://docs.confluent.io/
After=network.target

[Service]
Type=simple
User=cp-kafka
Group=confluent
ExecStart=/usr/bin/zookeeper-server-start /etc/kafka/zookeeper.properties
LimitNOFILE=100000
TimeoutStopSec=180
Restart=no

[Install]
WantedBy=multi-user.target

Hi,

thanks

are there any error logs in the logfile?
dataDir is writtable?

Could you paste content of /etc/kafka/zookeeper.properties?

Regards,
Michael

Hi Michael,

Herewith the content of my zookeeper.properties file

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
# 
#    http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=0
# Disable the adminserver by default to avoid port conflicts.
# Set the port to something non-conflicting if choosing to enable this
admin.enableServer=false
# admin.serverPort=8080

I don’t have a zookeeper directory in my /var/lib/ directory.
The challenge I think I have is the cp-kafka user that is used to start zookeeper isn’t in my /etc/passwd file. I only see these cp-* user in that file

cp-ksql:x:113:117::/var/empty:/usr/sbin/nologin
cp-kafka-rest:x:114:117::/var/empty:/usr/sbin/nologin
cp-schema-registry:x:115:117::/var/empty:/usr/sbin/nologin
cp-control-center:x:116:117::/var/empty:/usr/sbin/nologin

Hi Johnny,

did you try to reinstall the confluent-platform with
sudo apt-get install confluent-platform

User and directory should be created automatically during installation.

Manual workaround would be to create the user and directory manually.

HTH,
Michael

[Service]
Type=simple
User=cp-kafka
Group=confluent
ExecStart=/usr/bin/zookeeper-server-start /etc/kafka/zookeeper.properties
LimitNOFILE=100000
TimeoutStopSec=180
Restart=no

Does this user “cp-kafka” exists and has permissions? It should be “johnnyl” if you are not going to create a separate user for Kafka.