Support Questions
Find answers, ask questions, and share your expertise

Custom CSD failed to start

Explorer

It's hard to describe the situation

 
 

The custom service was started in cm console. There were no errors in the log, but it was retried four times

 

The truth is that the host has been started successfully.

Therefore, we want to know how the CM console perceives whether the service startup is successful, and how to solve the problem.

4 REPLIES 4

Re: Custom CSD failed to start

Explorer

hello?

Re: Custom CSD failed to start

Community Manager

Hi @exploer,

 

Are there any further details you can share about your cluster and the steps you took to reach the activity you mention? This will help other community members be more able to answer your question. 

 


Cy Jervis, Manager, Community Program

Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Learn more about the Cloudera Community:
Community Guidelines
How to use the forum

Re: Custom CSD failed to start

Explorer

Hello, I have shown more information. Can you take a look at it for me. Thank you

Re: Custom CSD failed to start

Explorer

The script of CSD starts as follows

#!/bin/sh
echo "NGINX_HOME : $NGINX_HOME"
start() {
    echo "Running nginx"
    exec $NGINX_HOME/sbin/nginx -c $NGINX_HOME/conf/nginx.conf -p $NGINX_HOME
    echo "start nginx success"
}

stop() {
    echo "stop nginx"
    $NGINX_HOME/sbin/nginx -s quit -p $NGINX_HOME
    echo "stop nginx success"
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    *)
        echo "Usage AILAB {start|stop}"
        ;;
esac

As above, simply start the command of nginx。

 

When I execute the command to start the service in cm console, the stdout log printed is as follows:

Thu Jul 15 20:38:38 CST 2021
JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir
Using scripts/control.sh as process script
CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
CMF_CONF_DIR=
NGINX_HOME : /opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
Running nginx
Thu Jul 15 20:38:42 CST 2021
JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir
Using scripts/control.sh as process script
CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
CMF_CONF_DIR=
NGINX_HOME : /opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
Running nginx
Thu Jul 15 20:38:50 CST 2021
JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir
Using scripts/control.sh as process script
CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
CMF_CONF_DIR=
NGINX_HOME : /opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
Running nginx
Thu Jul 15 20:38:58 CST 2021
JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir
Using scripts/control.sh as process script
CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
CMF_CONF_DIR=
NGINX_HOME : /opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
Running nginx

You can see that four attempts were made to start

 

 

The stderr log is as follows:

[15/Jul/2021 20:38:37 +0000] 113137 MainThread redactor     INFO     Started launcher: /opt/cloudera/cm-agent/service/csd/csd.sh start
[15/Jul/2021 20:38:37 +0000] 113137 MainThread redactor     ERROR    Redaction rules file doesn't exist, not redacting logs. file: redaction-rules.json, directory: /run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
[15/Jul/2021 20:38:37 +0000] 113137 MainThread redactor     INFO     Re-exec watcher: /opt/cloudera/cm-agent/bin/cm proc_watcher 113158
Thu Jul 15 20:38:38 CST 2021
+ locate_java_home
+ locate_java_home_no_verify
+ JAVA11_HOME_CANDIDATES=('/usr/java/jdk-11' '/usr/lib/jvm/jdk-11' '/usr/lib/jvm/java-11-oracle')
+ local JAVA11_HOME_CANDIDATES
+ OPENJAVA11_HOME_CANDIDATES=('/usr/lib/jvm/jdk-11' '/usr/lib64/jvm/jdk-11')
+ local OPENJAVA11_HOME_CANDIDATES
+ JAVA8_HOME_CANDIDATES=('/usr/java/jdk1.8' '/usr/java/jre1.8' '/usr/lib/jvm/j2sdk1.8-oracle' '/usr/lib/jvm/j2sdk1.8-oracle/jre' '/usr/lib/jvm/java-8-oracle')
+ local JAVA8_HOME_CANDIDATES
+ OPENJAVA8_HOME_CANDIDATES=('/usr/lib/jvm/java-1.8.0-openjdk' '/usr/lib/jvm/java-8-openjdk' '/usr/lib64/jvm/java-1.8.0-openjdk' '/usr/lib64/jvm/java-8-openjdk')
+ local OPENJAVA8_HOME_CANDIDATES
+ MISCJAVA_HOME_CANDIDATES=('/Library/Java/Home' '/usr/java/default' '/usr/lib/jvm/default-java' '/usr/lib/jvm/java-openjdk' '/usr/lib/jvm/jre-openjdk')
+ local MISCJAVA_HOME_CANDIDATES
+ case ${BIGTOP_JAVA_MAJOR} in
+ JAVA_HOME_CANDIDATES=(${JAVA8_HOME_CANDIDATES[@]} ${MISCJAVA_HOME_CANDIDATES[@]} ${OPENJAVA8_HOME_CANDIDATES[@]} ${JAVA11_HOME_CANDIDATES[@]} ${OPENJAVA11_HOME_CANDIDATES[@]})
+ '[' -z '' ']'
+ for candidate_regex in '${JAVA_HOME_CANDIDATES[@]}'
++ ls -rvd /usr/java/jdk1.8.0_181-cloudera
+ for candidate in '`ls -rvd ${candidate_regex}* 2>/dev/null`'
+ '[' -e /usr/java/jdk1.8.0_181-cloudera/bin/java ']'
+ export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ break 2
+ verify_java_home
+ '[' -z /usr/java/jdk1.8.0_181-cloudera ']'
+ echo JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ '[' -n '' ']'
+ source_parcel_environment
+ '[' '!' -z /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh ']'
+ OLD_IFS=' 	
'
+ IFS=:
+ SCRIPT_ARRAY=($SCM_DEFINES_SCRIPTS)
+ DIRNAME_ARRAY=($PARCEL_DIRNAMES)
+ IFS=' 	
'
+ COUNT=1
++ seq 1 1
+ for i in '`seq 1 $COUNT`'
+ SCRIPT=/opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
+ PARCEL_DIRNAME=NGINX-V1.21.1
+ . /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
++ NGINX_DIRNAME=NGINX-V1.21.1
++ export NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
++ NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
+ echo 'Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir'
+ echo 'Using scripts/control.sh as process script'
+ replace_conf_dir
+ echo CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ echo CMF_CONF_DIR=
+ EXCLUDE_CMF_FILES=('cloudera-config.sh' 'hue.sh' 'impala.sh' 'sqoop.sh' 'supervisor.conf' 'config.zip' 'proc.json' '*.log' '*.keytab' '*jceks')
++ printf '! -name %s ' cloudera-config.sh hue.sh impala.sh sqoop.sh supervisor.conf config.zip proc.json '*.log' '*.keytab' '*jceks'
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -type f '!' -path '/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/logs/*' '!' -name cloudera-config.sh '!' -name hue.sh '!' -name impala.sh '!' -name sqoop.sh '!' -name supervisor.conf '!' -name config.zip '!' -name proc.json '!' -name '*.log' '!' -name '*.keytab' '!' -name '*jceks' -exec perl -pi -e 's#\{\{CMF_CONF_DIR}}#/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER#g' '{}' ';'
+ make_scripts_executable
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -regex '.*\.\(py\|sh\)$' -exec chmod u+x '{}' ';'
+ RUN_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ '[' '' == true ']'
+ chmod u+x /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh
+ export COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ exec /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh start
[15/Jul/2021 20:38:41 +0000] 113186 MainThread redactor     INFO     Started launcher: /opt/cloudera/cm-agent/service/csd/csd.sh start
[15/Jul/2021 20:38:41 +0000] 113186 MainThread redactor     ERROR    Redaction rules file doesn't exist, not redacting logs. file: redaction-rules.json, directory: /run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
[15/Jul/2021 20:38:41 +0000] 113186 MainThread redactor     INFO     Re-exec watcher: /opt/cloudera/cm-agent/bin/cm proc_watcher 113196
Thu Jul 15 20:38:42 CST 2021
+ locate_java_home
+ locate_java_home_no_verify
+ JAVA11_HOME_CANDIDATES=('/usr/java/jdk-11' '/usr/lib/jvm/jdk-11' '/usr/lib/jvm/java-11-oracle')
+ local JAVA11_HOME_CANDIDATES
+ OPENJAVA11_HOME_CANDIDATES=('/usr/lib/jvm/jdk-11' '/usr/lib64/jvm/jdk-11')
+ local OPENJAVA11_HOME_CANDIDATES
+ JAVA8_HOME_CANDIDATES=('/usr/java/jdk1.8' '/usr/java/jre1.8' '/usr/lib/jvm/j2sdk1.8-oracle' '/usr/lib/jvm/j2sdk1.8-oracle/jre' '/usr/lib/jvm/java-8-oracle')
+ local JAVA8_HOME_CANDIDATES
+ OPENJAVA8_HOME_CANDIDATES=('/usr/lib/jvm/java-1.8.0-openjdk' '/usr/lib/jvm/java-8-openjdk' '/usr/lib64/jvm/java-1.8.0-openjdk' '/usr/lib64/jvm/java-8-openjdk')
+ local OPENJAVA8_HOME_CANDIDATES
+ MISCJAVA_HOME_CANDIDATES=('/Library/Java/Home' '/usr/java/default' '/usr/lib/jvm/default-java' '/usr/lib/jvm/java-openjdk' '/usr/lib/jvm/jre-openjdk')
+ local MISCJAVA_HOME_CANDIDATES
+ case ${BIGTOP_JAVA_MAJOR} in
+ JAVA_HOME_CANDIDATES=(${JAVA8_HOME_CANDIDATES[@]} ${MISCJAVA_HOME_CANDIDATES[@]} ${OPENJAVA8_HOME_CANDIDATES[@]} ${JAVA11_HOME_CANDIDATES[@]} ${OPENJAVA11_HOME_CANDIDATES[@]})
+ '[' -z '' ']'
+ for candidate_regex in '${JAVA_HOME_CANDIDATES[@]}'
++ ls -rvd /usr/java/jdk1.8.0_181-cloudera
+ for candidate in '`ls -rvd ${candidate_regex}* 2>/dev/null`'
+ '[' -e /usr/java/jdk1.8.0_181-cloudera/bin/java ']'
+ export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ break 2
+ verify_java_home
+ '[' -z /usr/java/jdk1.8.0_181-cloudera ']'
+ echo JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ '[' -n '' ']'
+ source_parcel_environment
+ '[' '!' -z /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh ']'
+ OLD_IFS=' 	
'
+ IFS=:
+ SCRIPT_ARRAY=($SCM_DEFINES_SCRIPTS)
+ DIRNAME_ARRAY=($PARCEL_DIRNAMES)
+ IFS=' 	
'
+ COUNT=1
++ seq 1 1
+ for i in '`seq 1 $COUNT`'
+ SCRIPT=/opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
+ PARCEL_DIRNAME=NGINX-V1.21.1
+ . /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
++ NGINX_DIRNAME=NGINX-V1.21.1
++ export NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
++ NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
+ echo 'Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir'
+ echo 'Using scripts/control.sh as process script'
+ replace_conf_dir
+ echo CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ echo CMF_CONF_DIR=
+ EXCLUDE_CMF_FILES=('cloudera-config.sh' 'hue.sh' 'impala.sh' 'sqoop.sh' 'supervisor.conf' 'config.zip' 'proc.json' '*.log' '*.keytab' '*jceks')
++ printf '! -name %s ' cloudera-config.sh hue.sh impala.sh sqoop.sh supervisor.conf config.zip proc.json '*.log' '*.keytab' '*jceks'
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -type f '!' -path '/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/logs/*' '!' -name cloudera-config.sh '!' -name hue.sh '!' -name impala.sh '!' -name sqoop.sh '!' -name supervisor.conf '!' -name config.zip '!' -name proc.json '!' -name '*.log' '!' -name '*.keytab' '!' -name '*jceks' -exec perl -pi -e 's#\{\{CMF_CONF_DIR}}#/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER#g' '{}' ';'
+ make_scripts_executable
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -regex '.*\.\(py\|sh\)$' -exec chmod u+x '{}' ';'
+ RUN_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ '[' '' == true ']'
+ chmod u+x /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh
+ export COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ exec /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh start
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[15/Jul/2021 20:38:48 +0000] 113229 MainThread redactor     INFO     Started launcher: /opt/cloudera/cm-agent/service/csd/csd.sh start
[15/Jul/2021 20:38:48 +0000] 113229 MainThread redactor     ERROR    Redaction rules file doesn't exist, not redacting logs. file: redaction-rules.json, directory: /run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
[15/Jul/2021 20:38:48 +0000] 113229 MainThread redactor     INFO     Re-exec watcher: /opt/cloudera/cm-agent/bin/cm proc_watcher 113271
Thu Jul 15 20:38:50 CST 2021
+ locate_java_home
+ locate_java_home_no_verify
+ JAVA11_HOME_CANDIDATES=('/usr/java/jdk-11' '/usr/lib/jvm/jdk-11' '/usr/lib/jvm/java-11-oracle')
+ local JAVA11_HOME_CANDIDATES
+ OPENJAVA11_HOME_CANDIDATES=('/usr/lib/jvm/jdk-11' '/usr/lib64/jvm/jdk-11')
+ local OPENJAVA11_HOME_CANDIDATES
+ JAVA8_HOME_CANDIDATES=('/usr/java/jdk1.8' '/usr/java/jre1.8' '/usr/lib/jvm/j2sdk1.8-oracle' '/usr/lib/jvm/j2sdk1.8-oracle/jre' '/usr/lib/jvm/java-8-oracle')
+ local JAVA8_HOME_CANDIDATES
+ OPENJAVA8_HOME_CANDIDATES=('/usr/lib/jvm/java-1.8.0-openjdk' '/usr/lib/jvm/java-8-openjdk' '/usr/lib64/jvm/java-1.8.0-openjdk' '/usr/lib64/jvm/java-8-openjdk')
+ local OPENJAVA8_HOME_CANDIDATES
+ MISCJAVA_HOME_CANDIDATES=('/Library/Java/Home' '/usr/java/default' '/usr/lib/jvm/default-java' '/usr/lib/jvm/java-openjdk' '/usr/lib/jvm/jre-openjdk')
+ local MISCJAVA_HOME_CANDIDATES
+ case ${BIGTOP_JAVA_MAJOR} in
+ JAVA_HOME_CANDIDATES=(${JAVA8_HOME_CANDIDATES[@]} ${MISCJAVA_HOME_CANDIDATES[@]} ${OPENJAVA8_HOME_CANDIDATES[@]} ${JAVA11_HOME_CANDIDATES[@]} ${OPENJAVA11_HOME_CANDIDATES[@]})
+ '[' -z '' ']'
+ for candidate_regex in '${JAVA_HOME_CANDIDATES[@]}'
++ ls -rvd /usr/java/jdk1.8.0_181-cloudera
+ for candidate in '`ls -rvd ${candidate_regex}* 2>/dev/null`'
+ '[' -e /usr/java/jdk1.8.0_181-cloudera/bin/java ']'
+ export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ break 2
+ verify_java_home
+ '[' -z /usr/java/jdk1.8.0_181-cloudera ']'
+ echo JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ '[' -n '' ']'
+ source_parcel_environment
+ '[' '!' -z /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh ']'
+ OLD_IFS=' 	
'
+ IFS=:
+ SCRIPT_ARRAY=($SCM_DEFINES_SCRIPTS)
+ DIRNAME_ARRAY=($PARCEL_DIRNAMES)
+ IFS=' 	
'
+ COUNT=1
++ seq 1 1
+ for i in '`seq 1 $COUNT`'
+ SCRIPT=/opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
+ PARCEL_DIRNAME=NGINX-V1.21.1
+ . /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
++ NGINX_DIRNAME=NGINX-V1.21.1
++ export NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
++ NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
+ echo 'Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir'
+ echo 'Using scripts/control.sh as process script'
+ replace_conf_dir
+ echo CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ echo CMF_CONF_DIR=
+ EXCLUDE_CMF_FILES=('cloudera-config.sh' 'hue.sh' 'impala.sh' 'sqoop.sh' 'supervisor.conf' 'config.zip' 'proc.json' '*.log' '*.keytab' '*jceks')
++ printf '! -name %s ' cloudera-config.sh hue.sh impala.sh sqoop.sh supervisor.conf config.zip proc.json '*.log' '*.keytab' '*jceks'
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -type f '!' -path '/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/logs/*' '!' -name cloudera-config.sh '!' -name hue.sh '!' -name impala.sh '!' -name sqoop.sh '!' -name supervisor.conf '!' -name config.zip '!' -name proc.json '!' -name '*.log' '!' -name '*.keytab' '!' -name '*jceks' -exec perl -pi -e 's#\{\{CMF_CONF_DIR}}#/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER#g' '{}' ';'
+ make_scripts_executable
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -regex '.*\.\(py\|sh\)$' -exec chmod u+x '{}' ';'
+ RUN_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ '[' '' == true ']'
+ chmod u+x /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh
+ export COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ exec /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh start
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[15/Jul/2021 20:38:57 +0000] 113311 MainThread redactor     INFO     Started launcher: /opt/cloudera/cm-agent/service/csd/csd.sh start
[15/Jul/2021 20:38:57 +0000] 113311 MainThread redactor     ERROR    Redaction rules file doesn't exist, not redacting logs. file: redaction-rules.json, directory: /run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
[15/Jul/2021 20:38:57 +0000] 113311 MainThread redactor     INFO     Re-exec watcher: /opt/cloudera/cm-agent/bin/cm proc_watcher 113321
Thu Jul 15 20:38:58 CST 2021
+ locate_java_home
+ locate_java_home_no_verify
+ JAVA11_HOME_CANDIDATES=('/usr/java/jdk-11' '/usr/lib/jvm/jdk-11' '/usr/lib/jvm/java-11-oracle')
+ local JAVA11_HOME_CANDIDATES
+ OPENJAVA11_HOME_CANDIDATES=('/usr/lib/jvm/jdk-11' '/usr/lib64/jvm/jdk-11')
+ local OPENJAVA11_HOME_CANDIDATES
+ JAVA8_HOME_CANDIDATES=('/usr/java/jdk1.8' '/usr/java/jre1.8' '/usr/lib/jvm/j2sdk1.8-oracle' '/usr/lib/jvm/j2sdk1.8-oracle/jre' '/usr/lib/jvm/java-8-oracle')
+ local JAVA8_HOME_CANDIDATES
+ OPENJAVA8_HOME_CANDIDATES=('/usr/lib/jvm/java-1.8.0-openjdk' '/usr/lib/jvm/java-8-openjdk' '/usr/lib64/jvm/java-1.8.0-openjdk' '/usr/lib64/jvm/java-8-openjdk')
+ local OPENJAVA8_HOME_CANDIDATES
+ MISCJAVA_HOME_CANDIDATES=('/Library/Java/Home' '/usr/java/default' '/usr/lib/jvm/default-java' '/usr/lib/jvm/java-openjdk' '/usr/lib/jvm/jre-openjdk')
+ local MISCJAVA_HOME_CANDIDATES
+ case ${BIGTOP_JAVA_MAJOR} in
+ JAVA_HOME_CANDIDATES=(${JAVA8_HOME_CANDIDATES[@]} ${MISCJAVA_HOME_CANDIDATES[@]} ${OPENJAVA8_HOME_CANDIDATES[@]} ${JAVA11_HOME_CANDIDATES[@]} ${OPENJAVA11_HOME_CANDIDATES[@]})
+ '[' -z '' ']'
+ for candidate_regex in '${JAVA_HOME_CANDIDATES[@]}'
++ ls -rvd /usr/java/jdk1.8.0_181-cloudera
+ for candidate in '`ls -rvd ${candidate_regex}* 2>/dev/null`'
+ '[' -e /usr/java/jdk1.8.0_181-cloudera/bin/java ']'
+ export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ break 2
+ verify_java_home
+ '[' -z /usr/java/jdk1.8.0_181-cloudera ']'
+ echo JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
+ '[' -n '' ']'
+ source_parcel_environment
+ '[' '!' -z /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh ']'
+ OLD_IFS=' 	
'
+ IFS=:
+ SCRIPT_ARRAY=($SCM_DEFINES_SCRIPTS)
+ DIRNAME_ARRAY=($PARCEL_DIRNAMES)
+ IFS=' 	
'
+ COUNT=1
++ seq 1 1
+ for i in '`seq 1 $COUNT`'
+ SCRIPT=/opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
+ PARCEL_DIRNAME=NGINX-V1.21.1
+ . /opt/cloudera/parcels/NGINX-V1.21.1/meta/nginx_env.sh
++ NGINX_DIRNAME=NGINX-V1.21.1
++ export NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
++ NGINX_HOME=/opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
+ echo 'Using /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER as conf dir'
+ echo 'Using scripts/control.sh as process script'
+ replace_conf_dir
+ echo CONF_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ echo CMF_CONF_DIR=
+ EXCLUDE_CMF_FILES=('cloudera-config.sh' 'hue.sh' 'impala.sh' 'sqoop.sh' 'supervisor.conf' 'config.zip' 'proc.json' '*.log' '*.keytab' '*jceks')
++ printf '! -name %s ' cloudera-config.sh hue.sh impala.sh sqoop.sh supervisor.conf config.zip proc.json '*.log' '*.keytab' '*jceks'
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -type f '!' -path '/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/logs/*' '!' -name cloudera-config.sh '!' -name hue.sh '!' -name impala.sh '!' -name sqoop.sh '!' -name supervisor.conf '!' -name config.zip '!' -name proc.json '!' -name '*.log' '!' -name '*.keytab' '!' -name '*jceks' -exec perl -pi -e 's#\{\{CMF_CONF_DIR}}#/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER#g' '{}' ';'
+ make_scripts_executable
+ find /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER -regex '.*\.\(py\|sh\)$' -exec chmod u+x '{}' ';'
+ RUN_DIR=/var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER
+ '[' '' == true ']'
+ chmod u+x /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh
+ export COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ COMMON_SCRIPT=/opt/cloudera/cm-agent/service/common/cloudera-config.sh
+ exec /var/run/cloudera-scm-agent/process/1142-nginxcsd-NGINX_WEBSERVER/scripts/control.sh start
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

Copy the log to the text editor to find "nginx: [emergency] bind() to 0.0.0.0:80 failed (98: address already in use)". There are no errors in the first execution. When the second execution starts, the port occupancy error is reported. This just shows that the first implementation was successful

 

In my server, you can clearly see that nginx has indeed started

# ps -ef | grep nginx
root     113182      1  0 20:38 ?        00:00:00 nginx: master process /opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx/sbin/nginx -c /opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx/conf/nginx.conf -p /opt/cloudera/parcels/NGINX-V1.21.1/lib/nginx
root     113183 113182  0 20:38 ?        00:00:00 nginx: worker process
root     115001  74100  0 20:46 pts/2    00:00:00 grep --color=auto nginx
(base) [root@dn5 NGINXCSD-1.0]#

 However, the CM console does not think that the start command of the service is successful

exploer_0-1626353356911.png

So how does the CM console judge whether the service operation is successful?