将所有需要的机器安装如下格式配置到hosts文件中:
1.1.1.1 foo-1.example.com foo-1
2.2.2.2 foo-2.example.com foo-2
3.3.3.3 foo-3.example.com foo-3
4.4.4.4 foo-4.example.com foo-4
使用如下命令生成公钥,并且copy给所有节点,包括自身
ssh-keygen (一直回车即可)
ssh-copy-id
注:也可以做成脚本,请自行网上查找。
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
sysctl vm.swappiness=0
echo "vm.swappiness=0" > /etc/sysctl.conf
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
chmod +x /etc/rc.d/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag" > /etc/rc.d/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
mkdir /mnt/cdrom
mount -o loop os/CentOS-7-x86_64-Everything-1804.iso /mnt/cdrom/
cd /etc/yum.repo.d/
mkdir repo_bak
mv Centos-* repo_bak/
[os]
name=os
baseurl=file:///mnt/cdrom
gpgcheck=0
[cm]
name=cm
baseurl=http:///cm/cdh
gpgcheck=0
[mysql]
name=mysql
baseurl=http:///mysql
gpgcheck=0
yum install httpd
yum install createrepo
cd /var/www/html
mkdir -p cm/cdh
mkdir -p cm/parcel
mkdir mysql
mkdir os
cp -rf /mnt/cdrom/* os/
cp /root/cdh/* cm/cdh/
cp /root/parcel/* cm/parcel
cp /root/mysql/* mysql/
cd /var/www/html/
createrepo cm
createrepo mysql
createrepo os
[os]
name=os
baseurl=http:///os
gpgcheck=0
ssh "mkdir /etc/yum.repo.d/repo_bak"
ssh "mv /etc/yum.repo.d/Centos-* /etc/yum.repo.d/repo_bak"
scp /etc/yum.repo.d/*.repo :/etc/yum.repo.d/
yum install oracle-j2sdk1.7-*
rpm -qa | grep mariadb
rpm -e --nodeps <上述命令显示的rpm包> ----移除已有的mariadb
yum install MySQL-*
service mysql start
mysql -uroot -p
set password for 'root'@'localhost'=password('root'); ----修改默认的root密码
CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY 'amon';
GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'rman';
GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'hue';
GRANT ALL ON hive.* TO 'hive'@'%' IDENTIFIED BY 'hive';
GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'sentry';
GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY 'nav';
GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY 'navms';
GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie';
mkdir /usr/share/java
cp mysql-connector-java-5.1.47.jar /usr/share/java/mysql-connector-java.jar
yum install cloudera-manager-daemons cloudera-manager-server
/usr/share/cmf/schema/scm_prepare_database.sh --scm-host <安装cm的节点> -h <数据库的安装节点> mysql cm cm cm
systemctl start cloudera-scm-server
查看启动信息:
tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
启动成功标志:
INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
浏览器访问以下地址:
http://:7180