标签:
IP |
FUQD |
HOSTNAME |
ROLE |
192.158.59.99 |
cdh01.cap.com |
cdh01 |
NameNode |
192.158.59.100 |
cdh02.cap.com |
cdh02 |
SecondaryNameNode |
192.158.59.101 |
cdh03.cap.com |
cdh03 |
DataNode |
虚拟机用户名密码:root/cloudera
Cloudera相关的用户名密码:username/cloudera
版本VMware-workstation-full-10.0.2-1744117.1398244508
版本CentOS-6.7-x86_64
# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.59.99 cdh01.cap.com cdh01
192.168.59.100 cdh02.cap.com cdh02
192.168.59.101 cdh03.cap.com cdh03
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=cdh01.cap.com
NETWORKING_IPV6=no
GATEWAY=192.168.59.2
hostname #查看主机名
uname -a #检查与hostname显示的是否一致
ifconfig #查看ip以及使用的网卡
ping *****.cap.com #检查与hostname中配置的是否一致
ssh-keygen -t rsa #一路回撤确定
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
#scp ~/.ssh/authorized_keys root@cdh02:~/.ssh/ #先装一台原始机,后面使用该机的clone版,因此本手册没有复制场景
service iptables status #查看运行状态
service iptables stop #临时关闭
chkconfig iptables off #设置重启后不随机启动
chkconfig --list iptables #检查设置是否生效
vi /etc/selinux/config
SELINUX=disabled #禁止
echo 0 > /proc/sys/vm/swappiness
service ntpd status #查看运行状态
#yum -y install ntp
service ntpd start #启动
#systemctl start ntpd.service #CentOS7命令
chkconfig ntpd on #设置随机启动
#systemctl enable ntpd.service #CentOS7命令
chkconfig --list ntpd #检查配置是否生效
service sshd status #查看运行状态
service sshd start #启动
chkconfig sshd on #设置随机启动
chkconfig --list sshd #检查配置是否生效
visudo -f /etc/sudoers
Defaults requiretty
注释成
#Defaults requiretty
#Defaults !visiblepw
改成
Defaults visiblepw
yum install gcc-c++
yum install python-setuptools
yum install python-devel.x86_64
easy_install psutil==2.1.3 (依赖python-devel,需要先安装)
#easy_install -m psutil (卸载已安装的模块)
easy_install avro
easy_install supervisor
easy_install guppy
注:查看已安装的包先执行python然后执行help(‘modules‘),easy_install使用可参考
http://www.cnblogs.com/feong/p/5148171.html
vi /etc/udev/rules.d/70-persistent-net.rules #只保留最后两条,并把最后一条的网卡改成"eth0"
mv /etc/sysconfig/network-scripts/ifcfg-Auto_eth1 /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:54:7C:9A
TYPE=Ethernet
UUID=52b164e5-39ca-4b09-b8d2-622046871b29
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.59.99
NETMASK=255.255.255.0
GATEWAY=192.168.59.2
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
DNS1=8.8.8.8
DNS2=8.8.4.4
yum install telnet
l 已配置cdh01,再克隆虚拟机2台,分别为cdh02和cdh03
l 启动cdh02和cdh03,修改network和对应的IP
wget https://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin
chmod u+x cloudera-manager-installer.bin
sudo ./cloudera-manager-installer.bin
进入192.168.59.00:7180界面,进行在线安装,如果下载网速小于1Mbps,则耗时可能较长
用户名/密码:admin/admin
l 执行下列命令,上传文件
su hdfs
hadoop fs -mkdir /hff
hadoop fs -ls /
hadoop fs -put wyp.txt /hff
注:文件需要放在/根目录下
hadoop fs -text /hff/wyp.txt
注:hadoop命令参考 http://www.cnblogs.com/feong/p/5148361.html
l 执行如下命令,导入数据
hive
create table t_wyp(id int, name string, age int, tel string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘\t‘ STORED AS TEXTFILE;
load data local inpath ‘wyp.txt‘ into table t_wyp;
注:文件需要放在/根目录下
select * from t_wyp;
dfs -ls /user/hive/warehouse;
手动创建,并赋予指定用户权限,如:
chown yarn:hadoop hadoop-cmf-yarn-NODEMANAGER-cdh03.cap.com.log.out
可以查看日志,并改名或者删除/fns目录
cd /var/run/cloudera-scm-agent/process/27-hdfs-NAMENODE-format/logs/
可以先检查一下是否已经创建了tmp,如果已经创建了则改名或者删除
hadoop fs –ls / #查看已创建目录
hadoop fs -mv /tmp /tmp_bak #重命名文件夹
标签:
原文地址:http://www.cnblogs.com/feong/p/5166591.html