@zhangyy
2020-04-24T11:03:38.000000Z
字数 4917
阅读 170
大数据平台构建
- 一: CentOS6.8x64 环境初始化
- 二: cdh5.3.x 安装使软件配置
192.168.3.1 master.hadoop.com master
192.168.3.2 slave1.hadoop.com slave1
192.168.3.3 slave2.hadoop.com slave2
1. 关闭iptables
iptables -F
service iptables save
service iptables stop
chkconfig iptables off
2. 关闭selinux
vim /etc/selinx/config
SELINUX=disabled
3. 禁用IPv6 (从新启动系统验证)
# echo "alias net-pf-10 off" >> /etc/modprobe.d/dist.conf
# echo "alias ipv6 off" >> /etc/modprobe.d/dist.conf
2. 做hadoop用户无密钥认证
ssh-keygen ---一直敲回车到最后
cat id_rsa.pub >> authorized_keys
将所有的公钥导入authorized_keys 分发到 所有的 机器的.ssh/ 下面
然后测试
rpm -e --nodeps xxx yyy zzz (包含jdk 的rpm 包)
rpm -ivh jdk-7u79-linux-x64.rpm
vim /etc/profile
增加环境变量
export JAVA_HOME=/usr/java/jdk1.7.0_79
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
export HADOOP_HOME=/opt/cloudera/parcels/CDH
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:${HADOOP_HOME}/bin
设置文件打开数量和用户最大进程数
>> 文件打开数量
$ ulimit -a
>> 用户最大进程数
$ ulimit -u
>> 设置
$ sudo vi /etc/security/limits.conf
内容:
* soft nofile 32728
* hard nofile 1029345
* soft nproc unlimited
* hard nproc unlimited
* soft memlock unlimited
* hard memlock unlimited
1. master:
vim /etc/ntp.conf 增加
restrict 192.168.3.0 mask 255.255.255.0 nomodify notrap
vim /etc/sysconfig/ntpd
echo "SYSNC_HWCLOCK=yes" >> /etc/sysconfig/ntpd
2. slave1,slave2 同步master
crontab -l
*/5 * * * * /usr/sbin/ntpdate 192.168.3.1
3. 同步到blos 时间
hwclock --localtime -w
1. 卸载原有数据库
rpm -qa |grep mysql
rpm -e mysql-libs-* --nodeps
2. 安装新版本的数据库:
rpm -ivh MySQL-server-5.6.31-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.31-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.31-1.el6.x86_64.rpm
rpm -ivh MySQL-embedded-5.6.31-1.el6.x86_64.rpm
rpm -ivh MySQL-shared-5.6.31-1.el6.x86_64.rpm
rpm -ivh MySQL-shared-compat-5.6.31-1.el6.x86_64.rpm
rpm -ivh MySQL-test-5.6.31-1.el6.x86_64.rpm
---启动mysql---
service mysql start
mysql 的 初次使用密码在 : cat .mysql_secret
----更改mysql 密码:
mysql -uroot -p7OR2voJyB72iT4Px
set password = password('123456');
flush privileges;
-----
yum -y install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb
1.mkdir /opt/cloudera-manager
上传已经下载好的CM 5.3.6 软件
cloudera-manager-el6-cm5.3.6_x86_64.tar.gz
去哪里下载:
http://archive.cloudera.com/cm5/cm/5/
2. 解压到/opt/cloudera-manager (所有节点全部配置)
tar -zxvf cloudera-manager-el6-cm5.3.6_x86_64.tar.gz -C /opt/cloudera-manager
----
3. 修改agent 的配置文件config.ini (所有节点全部更改)
cd /opt/cloudera-manager/cm-5.3.6/etc/cloudera-scm-agent
vim config.ini
server_host=master.hadoop.com
4. 创建cloudera-scm 用户用作安装(节点全部配置)
#useradd --system --home=/opt/cloudera-manager/cm-5.3.6/run/cloudera-scm-server --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
mysql 授权用户处理:
mysql -uroot -p123456
---- 先在mysql创建用户名(temp)、密码(temp)
grant all privileges on *.* to 'temp'@'%' identified by 'temp' with grant option;
grant all privileges on *.* to 'scm'@'%' identified by 'scm' with grant option;
grant all privileges on *.* to 'temp'@'master.hadoop.com' identified by 'temp' with grant option;
flush privileges;
拷贝jdbc 到 java的目录
tar -zxvf mysql-connector-java-5.1.42.tar.gz
cd mysql-connector-java-5.1.42
cp mysql-connector-java-5.1.42-bin.jar /usr/share/java/
cd /usr/share/java/
mv mysql-connector-java-5.1.42-bin.jar mysql-connector-java.jar
脚本:scm_prepare_database.sh
/opt/cloudera-manager/cm-5.3.6/share/cmf/schema/scm_prepare_database.sh mysql -h node01.yangyang.com -utemp -ptemp --scm-host node01.yangyang.com scm scm scm
在mysql 中生成数据表scm
1. cloudera-manager-server 节点:
mkdir -p /opt/cloudera/parcel-repo
chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/
mkdir -p /opt/cloudera/parcels
chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcels/
2. cloudera-manager-agent 节点:(所有节点)
mkdir -p /opt/cloudera/parcels
chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcels/
3. 上传文件
CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel.parcel 与 CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel.sha1 (把这个末尾的1去掉) 文件到 /opt/cloudera/parcel-repo
mv CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel.sha1 CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel.sha
chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/
master.hadoop.com 主机
cd /opt/cloudera-manager/cm-5.3.6/etc/init.d
./cloudera-scm-server start
查看启动日志
查看启动结果:
需要通过查看server的启动日志文件
/opt/cloudera-manager/cm-5.3.6/log/cloudera-scm-server
tail -f cloudera-scm-server.log
看到jetty 表示启动成功
查看端口号:
netstat -nultp
看到 7180 表示启动成功
http://master.hadoop.com:7180
用户名: admin 密码:admin
选择免费版本
下一步
启动master.slave1与slave2 节点的agent
master:
cd /opt/cloudera-manager/cm-5.3.6/etc/init.d
./cloudera-scm-agent start
slave1:
cd /opt/cloudera-manager/cm-5.3.6/etc/init.d
./cloudera-scm-agent start
slave2:
cd /opt/cloudera-manager/cm-5.3.6/etc/init.d
./cloudera-scm-agent start
点击:搜索
下一步:
下一步:
下一步:
下一步:
在三台机上面执行:
echo "0" > /proc/sys/vm/swappiness
cat /proc/sys/vm/swappiness
sysctl -p
echo "never" > /sys/kernel/mm/redhat_transparent_hugepage/defrag
vim /etc/rc.d/rc.local
在最后加上:
echo "never" > /sys/kernel/mm/redhat_transparent_hugepage/defrag
---
然后从新运行处理
下一步:
下一步:选择自定义安装:
安装一个hdfs
分配角色
下一步:
点击完成即可。
配置服务器组建,根据配置增加服务