tar zxvf hadoop-0.20.2.tar.gz cd conf vim core-config.xml
增加以下内容
2 3 4 5 67 8 11fs.default.name 9hdfs://172.16.18.202:9000 1012 15mapred.job.tracker 13172.16.18.202:9001 1416 19dfs.replication 171 18
怎么做授权
172.16.60.96 需要授权guojinyong 到 172.16.60.202 先在202 useradd guojinyong
然后在96上 ssh-keygen -t rsa 一直回车,会有一个id_rsa.pub的文件 scp id_rsa.pub [email protected]:/tmp/ cat /tmp/id_rsa.pub >> /home/guojinyong/.ssh/authorized_keys
这样就okey了.
配置文档 tar -xzvf hive-x.y.z.tar.gz cd hive-x.y.z export HIVE_HOME=`pwd` export PATH=$HIVE_HOME/bin:$PATH
配置hadoop 环境变量 export HADOOP_HOME=/work/guojinyong/hadoop-0.20.2 //假设我的hadoop解压在这里 bin/hive hive> show databases;
ok搞定.
vim /tmp/guojinyong/test/mobile.py
import sys import datetime for line in sys.stdin: line = line.strip() name,num = line.split('\t') str1 = 'ddddd' str2 = 'ggggg' print '\t'.join([name,num,str1,str2])
add file /tmp/guojinyong/test/mobile.py insert into table test select transform (str) using 'python mobile.py' as (name,num,str1,str2) from test_tmp;