'2013/05'에 해당되는 글 3건

  1. 2013.05.24 apache 재시작 스크립트
  2. 2013.05.06 Hadoop(하둡)
  3. 2013.05.02 Correctable or Uncorrectable Memory (DIMM) Errors
posted by 은이종 2013. 5. 24. 15:56
간단하게 http stop 후 start하는 스크립트
start 후 http 데몬이 0인지 체크해서, 다시 시작하는 설정

내용상의 
/app/apache/bin/startHttpd.sh는
apachectl start가 포함되어있는 스크립트이다
(apache 데몬 소유 권한떄문에 스크립트를 만들어서 구동)

---------------------------------------------------------
#!/bin/bash
date

DAEMON=http
COUNT=$(ps acx | grep -c $DAEMON)

/app/apache/bin/startHttpd.sh stop

while [ 1 ]
do
COUNT=$(ps acx | grep -c $DAEMON)
if [ "$COUNT" -ne "0" ]; then
echo $COUNT
sleep 1
else
break;
fi
done

/app/apache/bin/startHttpd.sh
sleep 1

COUNT=$(ps acx | grep -c $DAEMON)
### http daemon check ###
if [ "$COUNT" -eq "0" ]; then
echo "$DAEMON is no running. "
echo "$DAEMON is re-start."
/app/apache/bin/startHttpd.sh
fi

echo "Apache restart done!"

-----------------------------------------------------


/app/apache/bin/startHttpd.sh 
posted by 은이종 2013. 5. 6. 19:40


1. 하둡 배경

하둡은 HDFS, MapReduce를 소프트웨어로 구현한 것으로 아파치 Top-Level 프로젝트입니다. 

코어는 Java, C/C++, Python등을 지원하는데요. 기본적으로 JDK는 설치되어 있어야 Hadoop을 구동할 수 있습니다. 


OS : CentOS 6.2 x64
JDK 설치

http://www.oracle.com/technetwork/java/javase/archive-139210.html
 

jdk-6u33-linux-x64.bin 로 설치 진행


/usr/local/ 파일이동
chmod 755
./jdk-6u33-linux-x64.bin
 설치


환경변수 설정

vi /etc/profile


export JAVA_HOME=/usr/local/jdk1.6.0_33

export PATH=$PATH:$JAVA_HOME/bin

export CLASSPATH="." 

source /etc/profile

설치확인
java
javac
java -version



2. 하둡 설치
 

http://ftp.daum.net/apache/hadoop/common/hadoop-1.0.4/ 

현재 1.0.4버전으로 테스트

wget 
http://ftp.daum.net/apache/hadoop/common/hadoop-1.0.4/hadoop-1.0.4-bin.tar.gz 


압축을  /usr/local/에 풀고 설정 진행

/usr/local/hadoop-1.0.4 



ㅇ환경변수 설정

vi /etc/profile

export JAVA_HOME=/usr/local/jdk1.6.0_33

export HADOOP_INSTALL=/usr/local/hadoop-1.0.4

export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_INSTALL/bin

export CLASSPATH="."



source /etc/profile
 

ㅇ하둡 동작 확인

[root@HadoopMaster /]# hadoop version

Hadoop 1.0.4

Subversion https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.0 -r 1393290

Compiled by hortonfo on Wed Oct  3 05:13:58 UTC 2012

From source with checksum fe2baea87c4c81a2c505767f3f9b71f4

 

3. 하둡 기본 동작

하둡은 다음의 세가지 방식 중 한가지로 동작합니다. 

Standalone mode
- 데몬 프로세스가 동작하지 않고 모두 단독의 JVM 내에서 동작한다. 테스트하고 디버그가 쉽기 때문에 개발에 적합하다. 
Pseudo-distributed mode
- 하둡 데몬 프로세스가 로컬 컴퓨터에서 동작하므로 클러스터를 시뮬레이션 할 수 있다. 
Fully distributed mode
- 하둡 데몬 프로세스가 여러 컴퓨터로 구성된 그룹에서 동작한다. 


이 중에서 Standalone mode는 아무것도 설정해 줄 것이 없으므로(...)


Pseudo-distributed mode로 설정

환경설정

vi /usr/local/hadoop-1.0.4/conf

[출처] [빅데이터] (1) HADOOP 설치 및 환경설정|작성자hadoop-env.sh 설정

JAVA 및 하둡 경로 추가


export JAVA_HOME=/usr/local/jdk1.6.0_33

export HADOOP_INSTALL=/usr/local/hadoop-1.0.4



*SUPPRESS와 관련된 것은 나중에 하둡을 실행할 때 경고메시지를 보지 않기 위함이다.

아래의 xml파일들은 <configuration>태그안에 각각의 내용을 넣어주면 된다.
[core-site.xml : HDFS와 맵리듀스에 공통적으로 사용하는 IO 등을 설정] 
#vi core-site.xml

        <property>
                <name>fs.default.name</name>
                <value>hdfs://localhost:9000</value>
        </property>

 

[hdfs-site.xml : 네임노드, 보조네임노드, 데이터 노드 등 HDFS 데몬을 설정]

#vi hdfs-site.xml

*자신의 설정에 맞도록 수정해야함.

        <property>
                <name>dfs.name.dir</name>
                <value>/home/csock/hadoop/hadoop-1.0.4/dfs/name</value>

        </property>

 

        <property>
                <name>dfs.data.dir</name>
                <value>/home/csock/hadoop/hadoop-1.0.4/dfs/data</value>

        </property>

 

[mapred-site.xml : Job Tracker와 Task Tracker 등 맵리듀스 데몬을 설정] 

#vi mapred-site.xml

 

        <property>

                <name>mapred.job.tracker</name>

                <value>localhost:9001</value>

        </property>


        <property>

                <name>mapred.system.dir</name>

                <value>/home/csock/hadoop/hadoop-1.0.4/mapred/system</value>

        </property>


        <property>

                <name>mapred.local.dir</name>

                <value>/home/csock/hadoop/hadoop-1.0.4/mapred/local</value>

        </property>



[masters : 마스터 목록을 설정]
#vi masters
localhost

 

 

[출

처] [하둡

a] 설치하기|작성자 카르마

 

[slaves : 슬레이브 목록을 설정]
#vi slaves
localhost

여기까지가 conf 디렉토리 내의 설정파일을 수정하는 과정이다.
다음은 SSH를 이용하여 각각의 노드들이 상호작용하는데 문제가 없도록 SSH키를 등록하는 과정이다.

[SSH 설정 : 서로다른 노드에 패스워드없이 로그인 할 수 있도록 설정]
키 생성
#ssh-keygen -t rsa

키 복사
#cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

확인 - 비밀번호를 물어보지 않는다면 성공한 것이다.
#ssh localhost

여기까지 SSH설정이 끝났으면 마무리하는 단계인 네임노드 포멧을 해야 한다.

[네임노드 포멧]
#hadoop namenode -format

모든 하둡 설정을 마쳤다. 다음은 실제 하둡을 실행하는 방법이다.
-HDFS와 맵리듀스를 함께 시작
#start-all.sh
-HDFS와 맵리듀스를 함께 중지
#stop-all.sh

-HDFS만 시작
#start-dfs.sh
-HDFS만 중지
#stop-dfs.sh

-맵리듀스만 시작
#start-mapred.sh
-맵리듀스만 중지
#stop-mapred.sh

모든 과정이 정상적으로 이루어졌다면 start-all.sh를 실행했을 때, 각각의 프로세스 번호가 출력된다. 만약 잘못되었다면 logging이라는 메시지와 함께 로그가 담긴 파일명을 출력한다.

해당 로그는 하둡이 설치된 디렉토리 /home/csock/hadoop/hadoop-1.0.4/logs에 있으며
*.log파일을 열어보면 에러메시지 등을 확인 할 수 있다. 
주의해야 할 점은 *.log파일은 append되기 때문에 가장 최근 로그를 확인하고 싶으면 아래쪽으로 내려서 확인해야 한다.

하둡이 시작되면 웹브라우저에서 현재 상태를 모니터링 할 수 있다.
맵리듀스 모니터링  http://localhost:50030     
HDFS 모니터링      http://localhost:50070 


다음은 하둡을 이용하여 예제를 테스트해 보는 과정이다.
하둡에서 사용하는 HDFS는 아래와 같이 hadoop dfs명령을 통해 일반 리눅스와 같이 제어할 수 있다.

하둡의 기본 예제가 들어있는 jar파일이 하둡이 설치된 가장 바깥쪽 디렉토리에 있기 때문에 해당 경로로 이동한다.
#cd /home/csock/hadoop/hadoop-1.0.4/

mkdir명령을 이용하여 input이라는 디렉토리를 HDFS에 생성한다.
#hadoop dfs -mkdir input

현재 디렉토리에 기본적으로 들어있는 CHANGES.txt파일을 HDFS의 input디렉토리에 넣는다.
#hadoop dfs -put CHANGES.txt input/

단어개수를 세는 예제파일을 실행한다.(wordcount)
#hadoop jar hadoop-examples-1.0.4.jar wordcount input output
*여기서 hadoop-examples-1.0.4.jar에 있는 wordcount예제를 실행하는데, 입력으로는 아까 생성한 input디렉토리에 있는 모든 파일을 넣고, 프로그램을 실행한 결과파일들은 output디렉토리에 담긴다.

예제를 실행한 후 모니터링 시스템을 이용하여 현재 상태를 모니터링 할 수 있다.

예제를 실행한 결과를 확인하는 방법은 아래와 같다.
#hadoop dfs -ls output
-rw-r--r--   3 csock supergroup          0 2013-02-06 20:54 /user/csock/output/_SUCCESS
drwxr-xr-x   - csock supergroup          0 2013-02-06 20:53 /user/csock/output/_logs
-rw-r--r--   3 csock supergroup     160967 2013-02-06 20:54 /user/csock/output/part-r-00000

여기서 part-r-00000이라고 된 파일이 예제를 실행한 결과가 저장된 파일이다. cat을 이용하여 내용을 보면 실제 결과를 확인할 수 있다.
#hadoop dfs -cat output/part-r-00000


*start-all.sh를 이용하여 시작했는데 로그에 Safe모드 어쩌고 라고 나올 경우 아래의 명령어를 입력한 뒤 start하면 된다.
#hadoop dfsadmin -safemode leave

*만약 로그에 연결오류 등이 발생할 경우 해당 포트에 대한 방화벽 설정을 풀어주어야 한다. 


이상으로 하둡의 기본적인 설치 및 환경설정 방법을 설명하였다. 
다음 포스트에서는 실제 다수의 서버를 이용하여 분산처리모드(Fully distributed mode)로 설정하는 방법을 다룰 예정이다.


posted by 은이종 2013. 5. 2. 17:06


Scenario:

Correctable Memory Error Threshold Exceeded (Slot x, Memory Module y) .

Corrected Memory Error Threshold Passed (Slot x, Memory Module y) .

Uncorrectable Memory Error detected by ROM-based memory validation .

Uncorrectable Memory Error (Slot x, Memory Module y) .

Solution

NOTE: Most of the Correctable and Uncorrectable Memory Errors can be solved with a BIOS update. Refer to servers BIOS release notes for fixes.

What is correctable memory error?

Correctable errors can be detected and corrected if the chipset and DIMM support this functionality. Correctable errors are generally single-bit errors. Most of the ProLiant servers are capable of detecting and correcting single-bit errors. In addition, ProLiant servers with Advanced ECC support can detect and correct some multi-bit errors.

Correctable errors can be classified as "hard" and "soft" errors.

  • Hard error typically indicates a problem with the DIMM.

  • Although hard correctable memory errors are corrected by the system and will not result in system downtime or data corruption, but still they indicate a problem with the hardware.

  • Hard error will typically cause a DIMM to exceed HP’s correctable error threshold and the user is warned about hard correctable errors.

  • Soft errors do not indicate any issue with the DIMM.

  • A soft error occurs when the data and/or ECC bits on the DIMM are incorrect, but the error will not continue to occur once the data and/or ECC bits on the DIMM have been corrected.

  • Soft error will not typically cause a DIMM to exceed HP’s correctable error threshold and is not notified about soft errors which do not indicate any issue with the hardware.

    The user is warned about a DIMM exceeding the correctable error threshold in multiple ways.

  • DIMM LEDs on the front panel or on the system board or on memory board.

  • Integrated Management Logs.

  • SNMP Traps if configured.

  • System Management Homepage and System Insight Manager.

What is uncorrectable memory error?

While correctable errors do not affect the normal operation of the system, uncorrectable memory errors will immediately result in a system crash or shutdown of the system when not configured for Mirroring or RAID AMP modes.

Uncorrectable errors are always multi-bit memory errors. The internal Health LED will indicate a critical condition, and on most systems, the LEDs next to the failed DIMMs will be illuminated. In addition, the error will be logged if the Systems Management Driver is loaded. Uncorrectable memory errors can typically be isolated down to a failed Bank of DIMMs, rather than the DIMM itself.


Possible solutions:

Most of the Correctable and Uncorrectable Memory Errors can be solved with a BIOS update. Refer to server’s BIOS release notes for fixes.

Run Insight Diagnostics and replace the faulty part.

If diagnostics is not an option, swap with a known good memory module, to make sure the DIMM slot on the system board or memory board is good.

After swapping with known good part or after performing diagnostics, the faulty part has to be replaced.

'기타' 카테고리의 다른 글

OpenStack  (0) 2013.07.17
RAID + JBOD  (0) 2013.07.04
서비스 무정지 DNS 기관 이전 시 작업순서  (0) 2013.03.28
POC, Pilot, BMT 약어 설명  (0) 2013.02.20
Filezilla (파일질라) Client 관련 오류  (0) 2013.01.29