[root@localhost ~]# vim /etc/rc.d/rc.local # 在最后一行添加如下内容 if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi # 赋予rc.local具有可执行权限 [root@localhost ~]# chmod +x /etc/rc.d/rc.local [root@localhost ~]# sh /etc/rc.d/rc.local # 检查 [root@localhost ~]# cat /sys/kernel/mm/transparent_hugepage/defrag always madvise [never] [root@localhost ~]# cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never]
CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON metastore.* TO 'hive'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY 'passwd'; CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY 'passwd'; # 导入数据库 [root@lion ~]# mysql -uroot -p < cdh.sql # 扩展数据库架构和CDH6有区别 [root@lion ~]# cp /usr/share/java/mysql-connector-java.jar /usr/share/cmf/lib/ [root@lion ~]# sh /usr/share/cmf/schema/scm_prepare_database.sh mysql scm scm Enter SCM password: JAVA_HOME=/usr/java/jdk1.8.0_202-amd64 Verifying that we can write to /etc/cloudera-scm-server Creating SCM configuration file in /etc/cloudera-scm-server Executing: /usr/java/jdk1.8.0_202-amd64/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/usr/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db. [ main] DbCommandExecutor INFO Successfully connected to database. All done, your SCM database is configured correctly! # 启动服务 [root@lion parcel-repo]# cd /opt/cloudera/parcel-repo/ [root@lion parcel-repo]# sha1sum CDH-5.16.2-1.cdh5.16.2.p0.8-el7.parcel awk '{ print $1 }' > CDH-5.16.2-1.cdh5.16.2.p0.8-el7.parcel.sha [root@lion ~]# chkconfig cloudera-scm-server on [root@lion ~]# systemctl start cloudera-scm-server # 检查结果 [root@lion ~]# netstat -tlnp grep 7180 tcp 0 0 0.0.0.0:7180 0.0.0.0:* LISTEN 3907/java