配置Hadoop,hive,spark,hbase ————待整理

五一一天在家搭建好了集群,要上班了来不及整理,待下周周末有时间好好整理整理一个完整的搭建hadoop生态圈的集群的系列

  1. 若出现license information(license not accepted),即说明需要同意许可信息,输入1-回车-2-回车-c-回车-c回车,即可解决。

1.关闭防火墙
Centos7的防火墙与以前版本有很大区别,CentOs7这个版本的防火墙默认是使用的firewall,与之前的版本使用iptables不一样。
关闭防火墙:sudo systemctl stop firewalld.service
关闭开机启动:sudo systemctl disable firewalld.service
查看防火墙的状态:systemctl status firewalld

firewalld常用命令:https://xiaoguo.net/wiki/centos-7-firewalld.html

2.永久关闭selinux
查看SELinux的状态:/usr/sbin/sestatus -v 或者 /usr/sbin/getenforece
临时关闭SELinux:setenforece 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
永久关闭selinux:修改/etc/selinux/config文件,将SELINUX=enforcing 改为SELINUX=disabled,重启机器即可sudo reboot

3.搭建单机伪分布式
参考:http://www.aboutyun.com/thread-12798-1-1.html
多次hdfs namenode -format会导致namenode的clusterID和datanode的clusterID不一致,长传不了文件

5.设置静态IP
集群Ip需要设置为静态ip,不然这个ip可能会变。
修改对应网卡的配置:vim /etc/sysconfig/network-scripts/ifcfg-eth0
设置: BOOTPROTO="static" #将dhcp改为static
ONBOOT="yes" #开机启用本设置
IPADDR=192.168.7.106 #静态ip地址
GATEWAY=192.168.7.1 #默认网关
NETMASK=255.255.255.0 #子网掩码
DNS1=192.168.7.1 #DNS 配置
重启网络服务:service network restart
查看改动后的效果:ip addr #Centos7后不再使用ifconfig而是用ip 命令查看网络信息

使用sudo时user is not in sudoers file 的解决

解决办法:
以root用户修改/ete/sudoer 文件属性为root可修改,并在root ALL 行下添加 oracle ALL(类似root行)
[root@DBA2 etc]# chmod u+w sudoers
[root@DBA2 etc]# vi sudoers
添加 oracle    ALL=(ALL)    ALL
 
将sudoer属性改回原值:
[root@DBA2 etc]# chmod u-w sudoers
[root@DBA2 etc]# ll sudoers
-r--r----- 1 root root 3402 Sep  4 10:40 sudoers
 
再试试sudo的命令,可以使用了;
[oracle@DBA2 ~]$ sudo ps -ef|grep dbw
[sudo] password for oracle:
oracle    3140    1  0 09:28 ?        00:00:06 ora_dbw0_orcl2
oracle  19299 17065  0 10:41 pts/2    00:00:00 grep dbw

  1. 修改配置文件主机名
    hostname  name
    vim /etc/hostname

  2. 免密码登录 http://www.360doc.com/content/16/0831/21/19351147_587364587.shtml

  3. 卸载centos7 自带的OpenJDK http://blog.csdn.net/xiegh2014/article/details/52343438

  4. hadoop http://www.open-open.com/lib/view/open1435761287778.html

  5. hadoop 环境变量 http://blog.sina.com.cn/s/blog_a001e5980102vqk2.html

完全卸载mysql http://blog.csdn.net/typa01_kk/article/details/49057073
8. 安装mysql http://www.centoscn.com/mysql/2016/0315/6844.html
9. 设置 mysql root 密码 http://blog.csdn.net/xyang81/article/details/51759200
10. 安装scala和spark http://blog.csdn.net/ling811/article/details/51897799

  1. Hbase http://www.cnblogs.com/sdksdk0/p/5605013.html
  2. Hbase http://www.cnblogs.com/machong/p/6141990.html
原文地址:https://www.cnblogs.com/evilKing/p/6793287.html