[Bug 기록] hadoop 시작 실패: hadoop-config.sh: Syntax error: word unexpected (expecting ")")

4009 단어 BUG 레코드

버그 배경


어떤 설정도 수정하지 않은 상태에서hadoop을 다시 시작합니다
biglucky@localhost>sh start-all.sh 
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
start-all.sh: 112: /opt/hadoop-2.7.1/sbin/../libexec/hadoop-config.sh: Syntax error: word unexpected (expecting ")")

"Syntax error: word unexpected (expecting")"와 같은 이상을 알렸습니다. 그 동안 설정을 수정한 적이 없습니다.그래서 각종 자료를 찾아서 sudoshstart-all을 사용합니다.sh 등 이런 명령도 오류가 발생할 수 있습니다.

해결 방법


1. bash 실행

bash start-all.sh 

2. 직접 실행

>start-all.sh

결과


나중에 start-all을 직접 실행하는 것을 발견했다.sh 스크립트는 오류가 발생하지 않습니다.

biglucky@localhost>start-all.sh 
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hadoop-2.7.1/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/kael/CDH/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Starting namenodes on [ubuntu]
ubuntu: starting namenode, logging to /opt/hadoop-2.7.1/logs/hadoop-kael-namenode-ubuntu.out
ubuntu: SLF4J: Class path contains multiple SLF4J bindings.

총결산


1.bash와sh는 다르다: 일반적으로sh는bash의'자집'이다(자집이 아닌 부분, 구체적인 차이는'Thingsshhas that bash does not'참조).


(1)sh는 일반적으로bash의 소프트 링크로 설정한다.


일반적인 linux 운영체제에서 sh를 사용하는 것은 bash의posix를 여는 표준 모드와 실행과 같다
bash --posix

(2)sh와 bash의 차이는 bash의posix 표준 모델과 bash의 차이에 해당하는데 그 중에서 let 절취 문자열 등이 있다.


"Sh"는 하나의 프로그램이 아니라 하나의 표준(POSIX)입니다. 이런 표준은 어느 정도에 스크립트의 크로스 시스템성(크로스 유닉스 시스템)을 보장합니다.

좋은 웹페이지 즐겨찾기