CDH优化&服务安装
MySQL
MySQL安装包下载 选择Linux - Generic平台和5.6版本下载
或者直接下载5.6.34版本卸载旧mysql
rpm -qa | grep mysql
rpm -e --nodeps mysql-libs-5.1.73-5.el6_6.x86_64
- 安装
##解压到/usr/local/mysql
cd /usr/local/mysql
rpm -ivh MySQL-server-5.6.34-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-client-5.6.34-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-devel-5.6.34-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-embedded-5.6.34-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-shared-5.6.34-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-shared-compat-5.6.34-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-test-5.6.34-1.linux_glibc2.5.x86_64.rpm
- 启动mysql并修改密码
查看初始密码
service mysql start
netstat -ntlp|grep 3306
cat /root/.mysql_secret
#登录
mysql -u root -p mysql
#使用以下命令设置root的新密码
mysql> SET PASSWORD = PASSWORD('root');
mysql> quit
- 创建数据库并授权
#hive
mysql>create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
#activity monitor
mysql>create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
#activity oozie
mysql>create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
#hue
mysql>create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
#授权root用户在主节点拥有所有数据库的访问权限---'root' 对应刚才设置的root的密码。
mysql>grant all privileges on *.* to 'root'@'heimdall01.test.hadoop.com' identified by 'root' with grant option;
mysql>flush privileges;
- mysql-connect.jar放到下面目录下
/opt/cloudera/parcels/CDH/lib/hive/lib
/opt/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3-el6/lib/hive/lib
/usr/share/java/
HDFS
- 最大传输线程数:8192
- DataNode等日志目录:放到挂在的1T硬盘上/data/var/log/hadoop-hdfs
- DataNode等最大日志文件备份:3
- Balancer的java堆栈大小:512M
- DateNode的java堆栈大小:512M
- 用于缓存的最大内存:1G
客户端java堆大小:512M
所有的日志目录均放在挂载盘(/data)
最大日志文件备份数:3- hdfs文件目录权限设置
for host in `cat h.slaves`; do
ssh $host groupadd supergroup
ssh $host usermod -g supergroup mapred
ssh $host usermod -g supergroup hbase
ssh $host usermod -g supergroup yarn
done
##hdfs启动用户即为超级用户
sudo -u hdfs hadoop fs -chmod 775 /
sudo -u hdfs hadoop fs -chown heimdall /user
...
YARN
- ApplicationMaster Java最大堆栈:820M
- Map任务内存:512M
- Reduce任务内存:1G
- Map任务的最大堆栈:410M
- Reduce任务的最大堆栈:820M
- JobHistory Server的Java堆栈大小:1G
- 容器虚拟CPU内核:8
- ResourceManager的Java堆栈大小:1G
- 容器内存增量:512M
- 最大容器内存:2G
- 最大容器虚拟CPU内核数:32