分类: 大数据
2016-04-26 00:43:50
Cloudera-CDH5
环境:
os:Centos7.1 x64
Java version :
cloudera-cdh5 |
|
10.10.3.110 |
cm1 |
10.10.3.111 |
cm2 |
10.10.3.112 |
cm3 |
网站:
系统初始化:
事件同步,root用户互信,JAVA_HOME 关闭防火墙,yum源
卸载以后的openjdk
rpm -aq | grep java
rpm -e java-1.8.0-openjdk-1.8.0.77-0.b03.el7_2.x86_64 --nodeps
NTP时间同步
yum -y install ntp
crontab -e
30 3 * * * /usr/sbin/ntpdate -u 202.120.2.101 && hwclock -w
DB设置(Mariadb)
Server:
yum install -y mariadb mariadb-server mysql-connector-java
[mysqld]
transaction-isolation=READ-COMMITTED
key_buffer = 16M
key_buffer_size = 32M
max_allowed_packet = 32M
thread_stack = 256K
thread_cache_size = 64
query_cache_limit = 8M
query_cache_size = 64M
query_cache_type = 1
max_connections = 550
log_bin=/var/log/mariadb/mysql_binary_log
binlog_format = mixed
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
# InnoDB settings
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 64M
innodb_buffer_pool_size = 4G
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_log_file_size = 512M
[mysqld_safe]
log-error=/var/log/mariadb/mysqld.log
pid-file=/var/run/mariadb/mysqld.pid
systemctl enable mariadb
systemctl start mariadb.service
/usr/bin/mysqladmin -u root password '123123'
创建数据库:
create database amon DEFAULT CHARACTER SET utf8;
grant all on amon.* TO 'amon'@'%' IDENTIFIED BY 'amon_password';
create database rman DEFAULT CHARACTER SET utf8;
grant all on rman.* TO 'rman'@'%' IDENTIFIED BY 'rman_password';
create database metastore DEFAULT CHARACTER SET utf8;
grant all on metastore.* TO 'hive'@'%' IDENTIFIED BY 'hive_password';
create database sentry DEFAULT CHARACTER SET utf8;
grant all on sentry.* TO 'sentry'@'%' IDENTIFIED BY 'sentry_password';
create database nav DEFAULT CHARACTER SET utf8;
grant all on nav.* TO 'nav'@'%' IDENTIFIED BY 'nav_password';
flush privileges;
参考:
http://dev.mysql.com/downloads/connector/j/5.1.html
下载 Repo安装cloudera manager
下载相应的repo文件
安装server和agent
yum安装
yum -y install cloudera-manager-server cloudera-manager-agent
Or
下载rpm包安装:
cloudera-manager-agent-5.7.0-1.cm570.p0.76.el7.x86_64.rpm
cloudera-manager-daemons-5.7.0-1.cm570.p0.76.el7.x86_64.rpm
cloudera-manager-server-5.7.0-1.cm570.p0.76.el7.x86_64.rpm
enterprise-debuginfo-5.7.0-1.cm570.p0.76.el7.x86_64.rpm
安装依赖:(server 端没有依赖)
server:
rpm -vih cloudera-manager-daemons-5.7.0-1.cm570.p0.76.el7.x86_64.rpm cloudera-manager-server-5.7.0-1.cm570.p0.76.el7.x86_64.rpm
数据库导入:
执行命令格式:
/usr/share/cmf/schema/scm_prepare_database.sh database-type [options] database-nameusername password
/usr/share/cmf/schema/scm_prepare_database.sh mysql amon root 123123
/usr/share/cmf/schema/scm_prepare_database.sh mysql rman root 123123
/usr/share/cmf/schema/scm_prepare_database.sh mysql metastore root 123123
/usr/share/cmf/schema/scm_prepare_database.sh mysql sentry root 123123
/usr/share/cmf/schema/scm_prepare_database.sh mysql nav root 123123
agent:
yum install -y psmisc cyrus-sasl-gssapi fuse portmap fuse-libs mod_ssl python-psycopg2 MySQL-python lsb yum -y install cyrus-sasl-plain openssl-devel
rpm -ivh cloudera-manager-daemons-5.7.0-1.cm570.p0.76.el7.x86_64.rpm cloudera-manager-agent-5.7.0-1.cm570.p0.76.el7.x86_64.rpm
cloudera-scm-agent 修改配置文件并同步到其他节点:
vim /etc/cloudera-scm-agent/config.ini
server_host=cm1 (修改为cloudera mananger server hostname)
scp /etc/cloudera-scm-agent/config.ini cm2:/etc/cloudera-scm-agent/
下载相应包:(目标目录:/opt/cloudera/parcel-repo/)
CDH-5.7.0-1.cdh5.7.0.p0.45-el7.parcel
cp CDH-5.7.0-1.cdh5.7.0.p0.45-el7.parcel /opt/cloudera/parcel-repo/
启动master:
systemctl start cloudera-scm-server
查看端口:
netstat -tanp | grep 7180
集群使用parcels方式部署:
web登录:user:admin pass:admin
启动时钟服务:
systemctl enable ntpd ; systemctl start ntpd.service
各服务启动正常的话,否则会飘红!
如下图: