注意:必须是ubuntu18.04,ubuntu20.04版不能安装(parcel无法识别)
准备工作
- 更新系统
sudo apt update -y && sudo apt upgrade -y
- 安装ntp等常用命令
sudo apt install ntp vim tree nload net-tools wget curl -y
- 设置时区
sudo timedatectl set-timezone 'Asia/Shanghai'
- 安装python2
sudo apt install python2 -y
#sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
安装cloudera-scm-agent
- 安装jdk8
sudo apt install openjdk-8-jdk -y
注意:
需编辑
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
注释掉jdk.tls.disabledAlgorithms
相关行
- 下载cloudera-scm-agent、cloudera-scm-daemons并安装
sudo apt install -y ./cloudera-manager-daemons_6.3.1~1466458.ubuntu1804_all.deb \
./cloudera-manager-agent_6.3.1~1466458.ubuntu1804_amd64.deb
配置cloudera-scm-server
- 配置
/var
目录
sudo mkdir -p /var/log/cloudera-scm-server
sudo chown cloudera-scm:cloudera-scm /var/log/cloudera-scm-server
sudo chmod 755 /var/log/cloudera-scm-server
sudo mkdir -p /var/run/cloudera-scm-server
- 配置
/usr
目录
sudo cp cloudera-scm-server.service /lib/systemd/system/cloudera-scm-server.service
sudo ln -s /lib/systemd/system/cloudera-scm-server.service /etc/systemd/system/multi-user.target.wants/cloudera-scm-server.service
- 配置
/opt
目录
sudo mkdir -p /opt/cloudera/csd
sudo chown cloudera-scm:cloudera-scm /opt/cloudera/csd
sudo mkdir -p /opt/cloudera/parcel-repo
sudo chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo
- 配置
/etc
目录
sudo mkdir -p /etc/cloudera-scm-server
sudo cp db.properties /etc/cloudera-scm-server/db.properties
sudo cp log4j.properties /etc/cloudera-scm-server/log4j.properties
sudo cp cloudera-scm-server /etc/default/cloudera-scm-server
配置MySQL
- 安装MySQL
sudo apt install ./mysql-client_5.7.42-1ubuntu18.04_amd64.deb \
./mysql-common_5.7.42-1ubuntu18.04_amd64.deb \
./mysql-server_5.7.42-1ubuntu18.04_amd64.deb \
./mysql-community-client_5.7.42-1ubuntu18.04_amd64.deb \
./mysql-community-server_5.7.42-1ubuntu18.04_amd64.deb
- 修改MySQL配置,并重启
sudo bash -c "cat >> /etc/mysql/mysql.conf.d/mysqld.cnf" <<EOF
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
EOF
sudo sed -i 's/^bind-address.*$/bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf
sudo systemctl restart mysql
- 登录MySQL,修改密码和权限
SET PASSWORD = PASSWORD('YhAS0RPo3tnQq!');
grant all privileges on *.* to 'root'@'%' identified by 'YhAS0RPo3tnQq!';
- 登录MySQL,新建cmf和hive数据库
CREATE DATABASE IF NOT EXISTS cmf DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS hive DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
- 安装MySQL驱动
sudo mkdir -p /usr/share/java
sudo cp mysql-connector-java-5.1.47.jar /usr/share/java/mysql-connector-java.jar
配置cloudera-scm-server
- 编辑/etc/cloudera-scm-server/db.properties,配置数据库,示例如下:
com.cloudera.cmf.db.type=mysql
com.cloudera.cmf.db.host=localhost
com.cloudera.cmf.db.name=cmf
com.cloudera.cmf.db.user=root
com.cloudera.cmf.db.password=YhAS0RPo3tnQq!
com.cloudera.cmf.db.setupType=EXTERNAL
配置parcel
sudo cp CDH-6.3.2-1.cdh6.3.2.p0.1605554-bionic.parcel /opt/cloudera/parcel-repo/CDH-6.3.2-1.cdh6.3.2.p0.1605554-bionic.parcel
sudo cp manifest.json /opt/cloudera/parcel-repo/manifest.json
sudo cp CDH-6.3.2-1.cdh6.3.2.p0.1605554-bionic.parcel.sha /opt/cloudera/parcel-repo/CDH-6.3.2-1.cdh6.3.2.p0.1605554-bionic.parcel.sha
sudo chown cloudera-scm:cloudera-scm -R /opt/cloudera/parcel-repo
启动
sudo service cloudera-scm-server restart
sudo service cloudera-scm-agent restart