1.安装前准备
1.1集群规划
主机名 | ip |
ddh1 | 10.16.60.71 |
ddh2 | 10.16.60.72 |
ddh3 | 10.16.60.73 |
1.2配置hostname和hosts
vim /etc/hostname ddh1
vim /etc/hosts 10.16.60.71 ddh1 10.16.60.72 ddh2 10.16.60.73 ddh3
1.3 yum更换阿里云源
# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#清理缓存
# yum clean all
#生成新的缓存
# yum makecache
1.4互联网环境配置时钟同步
互联网环境下,集群内机器都执行
yum -y install ntpdate
ntpdate -u ntp.aliyun.com
# 配置定时任务
vi /etc/crontab
*/10 * * * * /usr/sbin/ntpdate ntp.aliyun.com
1.5内网环境下配置时钟同步
ddh1安装ntpd服务
yum install ntp -y
chkconfig --add ntpd
chkconfig ntpd on
vim /etc/ntp.conf
ddh1添加配置 :
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
#配置10.16.60.0-10.16.60.255网段上的所有机器可以从这台机器上查询和同步时间
restrict 10.16.60.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0 #本地时间
fudge 127.127.1.0 stratum 1 #时间服务器的层次。设为0则为顶级
[root@ddh1 ~]# systemctl start ntpd
[root@ddh1 ~]# systemctl enable ntpd
ddh2和ddh3添加配置:
restrict 10.16.60.0 mask 255.255.255.0 nomodify notrap
server 10.16.60.72 profer #时间服务器地址
ddh2和ddh3执行如下操作:
yum install -y ntpdate
ntpdate ddh1
vim /etc/crontab
*/10 * * * * /usr/sbin/ntpdate ddh1
1.6 关闭selinux
selinux的主要作用就是最大限度地减小系统中服务进程可访问的资源(最小权限原则)
vim /etc/sysconfig/selinux
# SELINUX=enforcing
SELINUX=disabled
1.7 修改文件句柄最大限制
vim /etc/security/limits.conf
# End of file
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
1.8 配置免密登录
#配置免密
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
#集群之间配置免密
ssh-copy-id -i ~/.ssh/id_rsa.pub root@ddh2
ssh-copy-id -i ~/.ssh/id_rsa.pub root@ddh3
1.9 安装mysql并关闭SSL
Mysql系列2:Mysql5.7.42 一键离线安装脚本_shangjg3的博客-CSDN博客
vim /etc/my.cnf
[mysqld]
skip-ssl # 跳过ssl
重启mysql
mysql> SHOW VARIABLES LIKE '%ssl%';
+-------------------------------------+----------+
| Variable_name | Value |
+-------------------------------------+----------+
| have_openssl | DISABLED |
| have_ssl | DISABLED |
1.10 安装jdk
# jdk setting
export JAVA_HOME=/data/base/jdk1.8.0_211
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
2.部署datasophon前后端项目
2.1 数据库初始化
CREATE DATABASE IF NOT EXISTS datasophon DEFAULT CHARACTER SET utf8;
grant all privileges on *.* to datasophon@"%" identified by 'datasophon' with grant option;
GRANT ALL PRIVILEGES ON *.* TO 'datasophon'@'%';
FLUSH PRIVILEGES;
source /opt/datasophon/datasophon-manager-1.1.2/conf/db/migration/1.1.0/V1.1.0_0__DDL_datasophon.sql
source /opt/datasophon/datasophon-manager-1.1.2/conf/db/migration/1.1.0/V1.1.0_1__DML_datasophon.sql
source /opt/datasophon/datasophon-manager-1.1.2/conf/db/migration/1.1.1/V1.1.1_0__DDL_datasophon.sql
source /opt/datasophon/datasophon-manager-1.1.2/conf/db/migration/1.1.1/V1.1.1_1__DML_datasophon.sql
2.2 编译安装nginx
安装依赖
yum install -y --setopt=protected_multilib=false gcc gcc-c++ make cmake automake autoconf gd file bison patch mlocate flex diffutils zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel kernel-devel libtool-libs readline-devel gettext-devel libcap-devel php-mcrypt libmcrypt libmcrypt-devel recode-devel
配置
./configure --user=root --group=root --prefix=/data/base/nginx-1.24.0 --with-stream --with-stream_ssl_preread_module --with-stream_ssl_module --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module
编译
make -j4
安装
make install
2.3 部署前端
将前端tar包上传到/opt/datasophon目录并解压
增加nginx配置
server {
listen 8888;# 访问端口(自行修改)
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /opt/datasophon/dist; # 前端解压的 dist 目录地址(自行修改)
index index.html index.html;
}
location /ddh {
proxy_pass http://ddh1:8081; # 接口地址(自行修改)
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x_real_ipP $remote_addr;
proxy_set_header remote_addr $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_connect_timeout 4s;
proxy_read_timeout 30s;
proxy_send_timeout 12s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
启动nginx
打开访问地址http://10.16.60.71:8888/,验证前端部署成功。
2.4 部署后端
将datasophon-manager-1.1.2.tar.gz上传到/opt/datasophon目录并解压
将大数据组件上传到/opt/datasophon/DDP/packages目录
打开/opt/datasophon/datasophon-manager-1.1.2/conf/application.conf配置数据库连接信息
# mysql
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://localhost:3306/datasophon?useUnicode=true&characterEncoding=utf-8
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
启动后端项目
[root@ddh1 bin]# ./datasophon-api.sh start api
3. 页面安装向导
3.1 创建集群
登录页面输入用户名密码:admin/admin123登录
3.2 为集群安装主机
3.3 主机环境校验
3.4 主机Agent分发
3.5 选择服务
3.6 分配服务Master角色
服务 | 至少几台 |
JournalNode | 3 |
NameNode | 2 |
ZKFC | 2 |
ResourceManager | 2 |