- Apache Ambari 기본 설치 

- root 계정이 아닌 계정으로 설치. 이부분이 아주.........xx했음

- http://www.dbility.com/272 참고 아주 잘되어 있음 


Ambari Build


▶ 사전 설치

  • maven 3.5 설치 이상 필수

$ sudo yum install rpm-build

$ sudo yum install python-devel

$ sudo yum install git

$ sudo yum install npm


(1)  Ambari Build

  1. Ambari Download


$ wget http://apache.tt.co.kr/ambari/ambari-2.6.2/apache-ambari-2.6.2-src.tar.gz

$ tar -zxvf apache-ambari-2.6.2-src.tar.gz



  1. Ambari Build

     (상당한 시간이 걸림 1시간 ~ 2시간)

$  cd apache-ambari-2.6.2-src

$  mvn versions:set -DnewVersion=2.6.2.0.0

$  pushd ambari-metrics

$  mvn versions:set -DnewVersion=2.6.2.0.0

$  popd

$  mvn -B clean install rpm:rpm -DnewVersion=2.6.2.0.0 -DskipTests -Dpython.ver="python >= 2.6"



     3) Ambari Build 정상 유무 확인


$  cd ambari-server/target/rpm/ambari-server/RPMS/x86_64

$  ambari-server-2.6.2.0-0.x86_64.rpm  

$  cd ~/apache-ambari-2.6.2-src/ambari-agent/target/rpm/ambari-agent/RPMS/x86_$ $ ambari-agent-2.6.2.0-0.x86_64.rpm

  

   4) Ambari Build 중 예외 (난 안나옴)

a) * jms , jmx관련 에러 발생시에만 아래와 같이 대응 필요

$ vi jms-1.1.pom.xml


<?xml version="1.0" encoding="UTF-8"?>

<project>

 <modelVersion>4.0.0</modelVersion>

 <groupId>javax.jms</groupId>

 <artifactId>jms</artifactId>

 <version>1.1</version>

 <name>Java Message Service</name>

 <description>

   The Java Message Service (JMS) API is a messaging standard that allows application components based on the Java 2 Platform, Enterprise Edition (J2EE) to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous.

 </description>

 <url>http://java.sun.com/products/jms</url>

 <distributionManagement>

   <downloadUrl>http://java.sun.com/products/jms/docs.html</downloadUrl>

 </distributionManagement>

 <licenses>

   <license>

     <name>The Apache Software License, Version 2.0</name>

     <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>

     <distribution>repo</distribution>

   </license>

 </licenses>

</project>

:wq!


$ mvn install:install-file -Dfile=jms-1.1.pom -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar

$ vi jmxtools-1.2.1.pom.xm


<?xml version="1.0" encoding="UTF-8"?>

<project>

  <modelVersion>4.0.0</modelVersion>

 <groupId>com.sun.jdmk</groupId>

 <artifactId>jmxtools</artifactId>

 <version>1.2.1</version>

 <distributionManagement>

   <status>deployed</status>

 </distributionManagement>

 <licenses>

   <license>

     <name>The Apache Software License, Version 2.0</name>

     <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>

     <distribution>repo</distribution>

   </license>

 </licenses>

</project>

$ vi jmxri-1.2.1.pom.xml

<?xml version="1.0" encoding="UTF-8"?>

<project>

 <modelVersion>4.0.0</modelVersion>

 <groupId>com.sun.jmx</groupId>

 <artifactId>jmxri</artifactId>

 <version>1.2.1</version>

 <distributionManagement>

   <status>deployed</status>

 </distributionManagement>

 <licenses>

   <license>

     <name>The Apache Software License, Version 2.0</name>

     <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>

     <distribution>repo</distribution>

   </license>

 </licenses>

</project>

:wq!


$  mvn install:install-file -Dfile=jmxtools-1.2.1.pom -DgroupId=com.sun.jdmk -DartifactId=jmxtools -Dversion=1.2.1 -Dpackaging=jar

$  mvn install:install-file -Dfile=jmxri-1.2.1.pom -DgroupId=com.sun.jmx -DartifactId=jmxri -Dversion=1.2.1 -Dpackaging=jar




(2)  Ambari Server Install


▶ 사전 설치

  • root 계정으로 설치 하지 않는경우, non-root 계정 준비 (ex : 1. sudo 2. NOPASSWD (sudo권한을 가지면서 패스워드 입력이 필요 없어야 함))

  • 다른 문서를 보면 visudo를 이용해서 패스별로 설정하던데.. 보안이슈를 좀 유도리있게 적용해서 하는게 속편하다 root면 만고땡이지만. 실무에서 그게 어찌 쉽게 되던가.

  • Mysql jar Download

$ wget -P /usr/share/java/ http://central.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar  



  1. Ambari Server install

$ sudo yum localinstall ambari-server-2.6.2.0-0.x86_64.rpm  


  1. Ambari Server Setting

java 버전은 기본 제공하는 버전 추천 : 최신 java 로 설치시 ssl 관련해서 후에 문제가 됨

$ sudo -s

$ vi .bashrc // root 에 추가

export buildNumber=2.6.2.0.0   // 추가

$ source .bashrc

$ exit

$ vi .bashrc

export buildNumber=2.6.2.0.0   // 추가

$ source .bashrc

$ sudo -E ambari-server setup // -E 옵션이 포인트


Using python  /usr/bin/python

Setup ambari-server

Checking SELinux...

SELinux status is 'disabled'

Customize user account for ambari-server daemon [y/n] (n)? y    

//root 계정이외 non root 계정으로 진행하기 위해서 Yes

Enter user account for ambari-server daemon (root):nonroot        //적당한 계정명 설정

Adjusting ambari-server permissions and ownership...

Checking firewall status...

Checking JDK...

[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8

[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7

[3] Custom JDK

======================================================================

Enter choice (1): 3

WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.

WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.

Path to JAVA_HOME: /usr/java/default/

Validating JDK on Ambari Server...done.

Checking GPL software agreement...

GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html

Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? n

Completing setup...

Configuring database...

Enter advanced database configuration [y/n] (n)? y

Configuring database...

======================================================================

Choose one of the following options:

[1] - PostgreSQL (Embedded)

[2] - Oracle

[3] - MySQL / MariaDB

[4] - PostgreSQL

[5] - Microsoft SQL Server (Tech Preview)

[6] - SQL Anywhere

[7] - BDB

======================================================================

Enter choice (1): 3

Hostname (localhost): mysql에 설치되어있는 서버

Port (3306):

Database name (ambari): db명

Username (ambari): db유저

Enter Database Password (bigdata): passwd 특수기호 안됨

Configuring ambari database...

Configuring remote database connection properties...

WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

Proceed with configuring remote database connection properties [y/n] (y)?

Extracting system views...

.

Adjusting ambari-server permissions and ownership...

Ambari Server 'setup' completed successfully.


  1. Mysql 설정

Mysql 에서 계정 생성 및 권한은 기타 다른 블로그 참조

$ source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql


  1. ambari properties setting

$ sudo vi /etc/ambari-server/conf/ambari.properties


server.jdbc.driver.path=/usr/share/java/mysql-connector-java-6.0.6.jar  //추가  

server.jdbc.url=jdbc:mysql://xxxxxxxxx:3306/ambari?serverTimezone=UTC //추가



  1. ambari server start

$ ambari-server start


(3)  Ambari Agent Install


  1. Ambari Agent install

$ sudo yum localinstall ambari-agent-2.6.2.0-0.x86_64.rpm  

$ sudo -s

$ vi .bashrc

export buildNumber=2.6.2.0.0   // 추가

$ source .bashrc

$ exit

$ vi .bashrc

export buildNumber=2.6.2.0.0   // 추가

$ source .bashrc


  1. Ambari Setup File Update

원래라면 계정을 ambari server 계정이 그대로 적용되어야 할거 같지, 왠일인지
root 로 계속 진행되어 임의로 agent 를 setup하는 코드를 수정
- 원인을 아시는분 공유 부탁드립니다.

$ vi /usr/lib/ambari-server/lib/ambari_server/setupAgent.py


313   expected_hostname = args[0]

314   passPhrase = args[1]

315   hostname = args[2]

316   user_run_as = "nonroot"  // server 에서 setup 하는 코드를 수정해서 non-root 설정을 유지 시킨다.  ambar-servet setup 에서 작성한 user 명

317

318   projectVersion = ""



메세지 : 
 INFO [main] org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor: SqoopOutputFormatLoadExecutor::SqoopRecordWriter is closed
 FATAL [main] org.apache.hadoop.mapred.YarnChild: Error running child : java.lang.NoSuchMethodError: org.joda.time.LocalDate.parse(Ljava/lang/String;)Lorg/joda/time/LocalDate;


1. jar 파일을 못찾아서 생기는 경우임 , 유저가 추가한 jar 파일에게 우선순위를 주기 위한 작업

mapred-site.xml 에 아래와 같이 추가 

    <property>
        <name>mapreduce.job.user.classpath.first</name>
        <value>true</value>
    </property>


2. maven pom.xml 이나 해당 jar 를 추가 하거나 별도로 joda-time-2.4.jar 구함

<dependency>
   <groupId>org.apache.sqoop</groupId>
   <artifactId>connector-sdk</artifactId>
   <version>${sqoop.version}</version>
</dependency>


3. 추가 했을때 딸려오는  joda-time-2.4.jar 를 sqoop/shell/lib 에 추가 한 sqoop client 와 server 를 재시작



참고 : org.apache.hadoop.mapred.YarnChild: Error running child : java.lang.NoSuchMethodError


'Sqoop' 카테고리의 다른 글

Sqoop2 운영  (0) 2016.08.02
Sqoop2 설치  (0) 2016.08.02
  1. tez를 위와 같이 버전에 맟추어 재빌드 
  2. /tez-ui-0.8.2.war  를 풀어 확인 한다 ex) tez-ui8 
  3. tomcat 재기동 
  4. tez-ui가 정상적으로 동작하는지 확인
  5. tez dist 폴더 밑에 존재하는  jar 를 확인
    • tez-api-0.8.2.jar
    • tez-common-0.8.2.jar
    • tez-dag-0.8.2.jar
    • tez-mapreduce-0.8.2.jar
    • tez-runtime-internals-0.8.2.jar
    • tez-runtime-library-0.8.2.jar
    • tez-yarn-timeline-history-with-acls-0.8.2.jar
  6. hdfs 에 tez-0.8.2.tar.gz  를 put
  7.  $PIG_HOME/lib/h2/ 밑의 아래 jar들을 버전업된 파일들로 교체 (이타이밍에 job이 돌면 fail 남으로 주의)
    • tez-api-0.8.2.jar
    • tez-common-0.8.2.jar
    • tez-dag-0.8.2.jar
    • tez-mapreduce-0.8.2.jar
    • tez-runtime-internals-0.8.2.jar
    • tez-runtime-library-0.8.2.jar
    • tez-yarn-timeline-history-with-acls-0.8.2.jar
  8. tez-site.xml 를 수정 (tez-site.xml 을 배포 하지 않아도 바로 적용됨 주의)  
  9. tomcat ui 폴더를 이동  tez-ui8 에 풀고 tez-ui로 이동등 ) tomcat 재기동
  10. 작업의 완료는 job돌때 나오는 tez version 으로 확인 가능 
  11. namenode , resoucemanager를 재시작할 필요가 없다. 

  • pig .0.15.0 의 경우 기본이 tez 0.7을 지원 하고 tez 0.8.2 와 큰 인터페이스 차이가 없기 때문에 무리 없이 적용가능 


-  Exception while waiting for Tez client to be ready : tez 가 이미 동작중이라는 에러의 경우 jar파일이 아직 다 정리 되지 않은 케이스 
   (실행시에 물고 올라가는 jar들에 중복이 있거나 잘못 올라 가고 있는것  pig-env.sh 를 수정하면 발생..

   확인은 bin/pig 를 디버그 모드를 수정한뒤에 실제로 올가는 jar파일들은 확인)

- 기존에 tez 로 작동 하는것들 중에서 에러가 발생하는 케이스가 나온다. 버전 차이가 나는듯.

'Hadoop > Pig' 카테고리의 다른 글

Tez 설치  (0) 2016.08.03
Pig & Tez Error  (0) 2016.08.03
Pig 재빌드  (0) 2016.08.03
pig centos 하일라이팅  (0) 2016.08.03

1.  tez  complie 및 tar.gz 생성 
     git clone https://github.com/apache/tez
     cd tez
     pom.xml 을 수정
<hadoop.version>2.7.1</hadoop.version>
<pig.version>0.15.0</pig.version>
     mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true  (pig 0.15.0 의 경우  tez 0.7.0 , hadoop 2.6.0 기본 변경이 필요한 경우 수정하여 재Build )

2. Hadoop 적용
$hadoop fs -mkdir /apps/tez
$hadoop fs -put tez-dist/target/tez-0.7.0.tar.gz /apps/tez    (tez lib 들은 hdfs 에 존재해야 함)
mkdir ~/programs/tez
~/programs/tez/tez-site.xml
  • tez-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
  <property>
     <name>tez.lib.uris</name>
        <value>${fs.defaultFS}/user/xxxx/apps/tez-0.7.0.tar.gz</value>
  </property>
 
<property>
    <description>URL for where the Tez UI is hosted</description>
    <name>tez.tez-ui.history-url.base</name>
    <value>http://xxxxx:8080/tez-ui/</value>
  </property>
  <property>
    <name>tez.allow.disabled.timeline-domains</name>
    <value>true</value>
  </property>
  <property>
    <description>Enable Tez to use the Timeline Server for History Logging</description>
    <name>tez.history.logging.service.class</name>
    <value>org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService</value>
  </property>

</configuration>
  • vi .bashrc

export TEZ_HOME=~/programs/tez
export PIG_CLASSPATH=$TEZ_HOME/*:$TEZ_HOME/lib/*:~/programs/config/tez

  • tez-ui

shell>tar -zxvf apache-tomcat-7.0.50.tar.gz
shell>ln -s ../packages/apache-tomcat-7.0.50/
shell>cd webapps
shell>mkdir tez-ui
shell>cd tez-ui
shell>cp ~/packages/tez-0.7.0/tez-ui-0.7.0.war .
shell>jar xvf tez-ui-0.7.0.war
shell>cd scripts
shell>vi config.js

App.setConfigs({

  /* Environment configurations */
  envDefaults: {
    version: "0.7.0",
    /*
     * By default TEZ UI looks for timeline server at http://localhost:8188, uncomment and change
     * the following value for pointing to a different domain.
     */
     timelineBaseUrl: 'http://xxxxxx:0000',

    /*
     * By default RM web interface is expected to be at http://localhost:8088, uncomment and change
     * the following value to point to a different domain.
     */
     RMWebUrl: 'http://xxxxxx:0000',
  },

vi .bashrc 에 아래내용을 추가
export TEZ_HOME=~/programs/tez
export PIG_CLASSPATH=$TEZ_HOME/*:$TEZ_HOME/lib/*:~/programs/config/tez

  • yarn-site.xml
<property>
  <description>Indicate to clients whether Timeline service is enabled or not. If enabled, the TimelineClient library used by end-users will post entities and events to the Timeline server.</description>
  <name>yarn.timeline-service.enabled</name>
  <value>true</value>
</property>
<property>
  <description>The hostname of the Timeline service web application.</description>
  <name>yarn.timeline-service.hostname</name>
  <value>master.xxxxxxxx</value>
</property>
<property>
  <description>Enables cross-origin support (CORS) for web services where cross-origin web response headers are needed. For example, javascript making a web services request to the timeline server.</description>
  <name>yarn.timeline-service.http-cross-origin.enabled</name>
  <value>true</value>
</property>
<property>
  <description>Publish YARN information to Timeline Server</description>
  <name>yarn.resourcemanager.system-metrics-publisher.enabled</name>
  <value>true</value>
</property>
      <property>
       <description>The http address of the Timeline service web application.</description>
       <name>yarn.timeline-service.webapp.address</name>
       <value>master.xxxxxx:0000</value>
     </property>
<property>
   <description>The https address of the Timeline service web application.</description>
  <name>yarn.timeline-service.webapp.https.address</name>
  <value>master.xxxxxx:0000</value>
</property>
  • tez-ui 기동
tomcat/bin/startup.sh

참고:

pig/lib/h2/ 밑에 tez 관련 jar 파일들 이 존재


'Hadoop > Pig' 카테고리의 다른 글

tez 0.7.0 에서 0.8.2 로 업그레이드  (0) 2016.08.03
Pig & Tez Error  (0) 2016.08.03
Pig 재빌드  (0) 2016.08.03
pig centos 하일라이팅  (0) 2016.08.03

1. Tez  모드로 pig 실행시 plan관련 error
  org.apache.tez.dag.api.TezUncheckedException: org.apache.pig.impl.plan.VisitorException: ERROR 0: java.lang.NullPointerException

대응

  • tez 0.7.0 에서 parallelism default 값이 true 로 되어 있음 해당값을 false 로 처리 
          pig -Dpig.tez.auto.parallelism=false -x tez

2. Script  Parsing Error

예약어 관련 에러 
datetime 

대응


'Hadoop > Pig' 카테고리의 다른 글

tez 0.7.0 에서 0.8.2 로 업그레이드  (0) 2016.08.03
Tez 설치  (0) 2016.08.03
Pig 재빌드  (0) 2016.08.03
pig centos 하일라이팅  (0) 2016.08.03
If you are using Hadoop 0.23.X or 2.X, please add -Dhadoopversion=23 in your ant command line in the previous steps

Hadoop 2.X 의 경우 -Dhadoopversion=23 를 붙여 재 빌더
shell>ant -Dhadoopversion=23


Pig 와 Hive의 차이


'Hadoop > Pig' 카테고리의 다른 글

tez 0.7.0 에서 0.8.2 로 업그레이드  (0) 2016.08.03
Tez 설치  (0) 2016.08.03
Pig & Tez Error  (0) 2016.08.03
pig centos 하일라이팅  (0) 2016.08.03

파일 위치 : /usr/share/vim/vim72/syntax/pig.vim


파일 생성 : vi ~/.vimrc
파일 내용 : 

augroup filetypedetect
  au BufNewFile,BufRead *.pig set filetype=pig syntax=pig
augroup END

pig.vim : https://github.com/vim-scripts/pig.vim/blob/master/syntax/pig.vim


                                  


'Hadoop > Pig' 카테고리의 다른 글

tez 0.7.0 에서 0.8.2 로 업그레이드  (0) 2016.08.03
Tez 설치  (0) 2016.08.03
Pig & Tez Error  (0) 2016.08.03
Pig 재빌드  (0) 2016.08.03

sqoop2 의 경우 해당 데이터가 "","" 형태로 되어 있다. 

즉 mr 이나 pig로 돌린 결과 값이 위와 같은 형태로 되어야 한다는.. 말.

기본 tab인 형태를 강제로 바꾸기 위해서 아래의 코드를 사용하여 수정하여 사용


https://github.com/dfsklar/pigplay/blob/master/udf/com/yahoo/pigudf/SimpleTextStorer.java

'Sqoop' 카테고리의 다른 글

Sqoop2 date type 연동 에러  (0) 2016.08.10
Sqoop2 설치  (0) 2016.08.02

1. 기본설치는 http://www.gooper.com/ss/bigdata/270747 문서를 참조 삼아 설치하면된다. 


해당 문서를 참조하여 Hadoop 2.7.1 Sqoop2 1.99.6을 운영중임



2. 해당 문서에 추가 적 내용은 

Sqoop 설치 폴더에서 


/server/conf/sqoop.properties 에 아래 와 같은 내용을 추가 

org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/home/zumse/programs/config/hadoop/



3. 해당 문서와 함께 참고한 사이트는 아래와 같음



'Sqoop' 카테고리의 다른 글

Sqoop2 date type 연동 에러  (0) 2016.08.10
Sqoop2 운영  (0) 2016.08.02


이클립스 종료 후  

아래와 같이 svn.simple 을 삭제하고도 안된다면. 

%APPDATA%\Subversion\auth\svn.simple


.keyring 파일을 찾아서 삭제하면된다. 

Ubuntu: Delete “.keyring” file at “eclipse/configuration/org.eclipse.core.runtime” 

$rm `find -name .keyring`



'Eclipse' 카테고리의 다른 글

웹 화면 설계용 툴  (0) 2013.11.08
Eclipse 3.7 + Svn  (0) 2011.12.01
이클립스 메모리 관리  (0) 2011.07.12
eclipse 3.6 HeliosにVisualEditor을 인스톨  (0) 2011.02.11
Eclipse + Tomcat6.0 + postgres8.3  (0) 2010.08.06

+ Recent posts