标签:lan connect 登录 creat restart 使用 acl openssl ESS
机器名 | 服务 |
---|---|
hadoop1 | 主节点 |
hadoop2 | data、task |
hadoop3 | data、task |
服务 | 版本 |
---|---|
cdh | 5.15.2 |
cm | 5.15.2 |
jdk | 1.8 |
不直接建议使用root用户,所以此处新建 hadoop用户
# 添加用户组
groupadd hadoop
# 添加用户
useradd -m -g hadoop hadoop
# 配置密码
passwd hadoop
visudo
# 在最后增加
hadoop ALL=(ALL) NOPASSWD:ALL
vim /etc/sysconfig/network
# 增加或修改
HOSTNAME=hadoop1
# 此配置需要重启才可以生效
shutdown -r now
127.0.0.1 hadoop1 s1
127.0.0.2 hadoop2 s2
127.0.0.3 hadoop3 s3
注意: /etc/hosts 中绝对不可以出现带有下划线的host名称,否则agent会启动不起来。
为了便于维护,各机器使用相同的ssh key
# 在主节点生成公钥,一路回车即可
ssh-keygen -t rsa
# 生成一个authorized_keys文件
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
# 文件权限
chmod 600 ~/.ssh/authorized_keys
# 将生成的id_rsa.pub和authorized_keys拷贝到其它节点,必须保证上面所需的权限
scp -r ~/.ssh hadoop@hadoo2:~/
scp -r ~/.ssh hadoop@hadoop3:~/
# 如果没有scp,则安装
yum install openssh-clients
vim /etc/security/limits.d/90-nproc.conf
# 修改
soft nproc 65535
vim /etc/security/limits.conf
# 增加
soft nproc 65535
hard nproc 65535
# 查看
rpm -qa | grep java
或 rpm -qa | grep jdk
# 卸载
rpm -e --nodeps 包名
安装:
rpm -ivh jdk-8u211-linux-x64.rpm
此命令需要切换到root用户下完成
echo "JAVA_HOME=/usr/java/latest/" >> /etc/environment
生产环境建议使用RDS或配置主从服务放置出现单点故障,此处直接使用yum安装
# 安装
yum install mysql-server
yum install mysql-connector-java
# 启动
service mysqld start
/sbin/chkconfig mysqld on
# 设置开机启动
chkconfig mysqld on 设置开机启动
# 设置root密码:
mysqladmin -u root password '123456'
# hive
CREATE USER 'hive'@'127.0.0.1' IDENTIFIED BY '******';
CREATE DATABASE IF NOT EXISTS hive default charset utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON `hive`.* TO 'hive'@'127.0.0.1';
# activity monitor
CREATE USER 'monitor'@'127.0.0.1' IDENTIFIED BY '******';
CREATE DATABASE IF NOT EXISTS monitor default charset utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON `monitor`.* TO 'monitor'@'127.0.0.1';
# oozie
CREATE USER 'oozie'@'127.0.0.1' IDENTIFIED BY '******';
CREATE DATABASE IF NOT EXISTS oozie default charset utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON `oozie`.* TO 'oozie'@'127.0.0.1';
# hue
CREATE USER 'hue'@'127.0.0.1' IDENTIFIED BY '******';
CREATE DATABASE IF NOT EXISTS hue default charset utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON `hue`.* TO 'hue'@'127.0.0.1';
# 刷新权限
flush privileges;
过程中如果出现找不到的包,可以通过 sudo yum whatprovides xxx,确定rpm包
sudo yum -y install bind-utils portmap fuse-libs httpd mod_ssl python-psycopg2 MySQL-python
sudo yum -y install libxml2-devel libxslt-devel
sudo yum -y install cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi
sudo yum -y install fuse redhat-lsb-core-4.0-7.el6.centos.x86_64
sudo yum -y install openssl-devel
cloudera-manager-daemons-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm
cloudera-manager-server-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm
cloudera-manager-agent-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm
# 主节点
sudo rpm -ivh cloudera-manager-daemons-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm cloudera-manager-server-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm cloudera-manager-agent-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm
# 从节点
sudo rpm -ivh cloudera-manager-daemons-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm cloudera-manager-agent-5.15.2-1.cm5152.p0.2.el6.x86_64.rpm
vim /etc/default/cloudera-scm-server
# 加入
export JAVA_HOME="/usr/java/latest"
vim /etc/default/cloudera-scm-agent
# 加入
export JAVA_HOME="/usr/java/latest"
sudo cp mysql-connector-java-5.1.43-bin.jar /usr/share/cmf/lib/
rpm安装脚本目录在/usr/share/cmf/schema/scm_prepare_database.sh
脚本所需参数:数据库类型、数据库主机名或ip、数据库端口、建库用户名、密码、cmserver主机名、数据库的管理用户名、密码
sudo -E /usr/share/cmf/schema/scm_prepare_database.sh mysql -hlocalhost -P3306 -uroot -p'123456' --scm-host 127.0.0.1 cloudera cm '123456'
看到下面的内容,则配置成功
?
sudo vim /etc/cloudera-scm-agent/config.ini
# 修改
server_host=hadoop1
sudo useradd --system --home=/var/run/cloudera-scm-server/ -create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
CDH parcels下载地址
GPLEXTRAS parcels下载地址
CDH-5.15.2-1.cdh5.15.2.p0.3-el6.parcel
CDH-5.15.2-1.cdh5.15.2.p0.3-el6.parcel.sha1
GPLEXTRAS-5.7.6-1.cdh5.7.6.p0.6-el6.parcel
GPLEXTRAS-5.7.6-1.cdh5.7.6.p0.6-el6.parcel.sha1
# 启动服务端
sudo -E /etc/init.d/cloudera-scm-server start
# 启动Agent服务
sudo -E /etc/init.d/cloudera-scm-agent start
略
?
?
?
?
?
?
?
?
都不是什么大问题,按提示,修改后点击“重新运行”,每个节点上都设置一下:
第一个警告:
# 切换到root用户执行
echo 10 > /proc/sys/vm/swappiness
# 添加或修改sysctl.conf
vim /etc/sysctl.conf
vm.swappiness = 0
第二个警告:
# 执行:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
# 编辑rc.local加入上面两行
vim /etc/rc.local
?
?
?
标签:lan connect 登录 creat restart 使用 acl openssl ESS
原文地址:https://www.cnblogs.com/remainsu/p/cdh-5152-li-xian-an-zhuang.html