标签(空格分隔): 大数据运维专栏
一:datasophon 的介绍
1.1 datasophon 的介绍
DataSophon是近日开源的一款国产自研大数据管理平台,致力于快速实现部署、管理、监控以及自动化运维大数据服务组件和节点的能力,帮助你快速构建起稳定、高效的大数据集群服务。
主要有以下特性:
极易部署,1小时可完成300节点的大数据集群部署
国产化兼容,兼容ARM服务器和常用国产化操作系统
监控指标全面丰富,基于生产实践展示用户最关心的监控指标
灵活便捷的告警服务,可实现用户自定义告警组和告警指标
可扩展性强,用户可通过配置的方式集成或升级大数据组件
datasophon 的官网
https://datasophon.github.io/datasophon-website/
1.2 datasophon 的架构
参考资料:
https://github.com/datasophon/datasophon
1.3 datasophon 封装大数据组件的版本
各集成组件均进行过兼容性测试,并稳定运行于300+个节点规模的大数据集群,日处理数据量约4000亿条。
在海量数据下,各大数据组件调优成本低,平台默认展示用户关心和需要调优的配置。
二:datasophon 的部署安装
2.1 系统安装介绍
操作系统:
centos7.9x64
主机名:
cat /etc/hosts
----
172.16.10.11 flyfish11
172.16.10.12 flyfish12
172.16.10.13 flyfish13
172.16.10.14 flyfish14
172.16.10.15 flyfish15
172.16.10.16 flyfish16
172.16.10.17 flyfish17
-----
本次安装前 4台虚拟机 (flyfish11/flyfish12/flyfish13/flyfish14)
flyfish11 做主节点 其它做worker从节点
DDP部署包下载地址:
参考官网下载
2.2 系统初始化
2.2.1 关闭 firewalld,iptables 与 selinux
所有节点都要配置:
yum install -y firewall* iptable*
(1) 关闭firewalld
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
(2) 关闭iptables
iptables -F
systemctl stop iptables.service
service iptables save
systemctl disable iptables.service
(3) 禁用 selinux
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
setenforce 0
getenforce 0
sestatus
重启机器
reboot
2.2.2 无密钥登录配置
做root用户无密钥认证
ssh-keygen ---一直敲回车到最后
cat id_rsa.pub >> authorized_keys
chmod 600 authorized_keys
将所有的公钥导入authorized_keys 分发到 所有的 机器的.ssh/ 下面
然后测试
2.2.3 所有机器更改CentOS7.9x64的文件句柄数
vim /etc/security/limits.conf
---
* soft nofile 65535
* hard nofile 1029345
* soft nproc unlimited
* hard nproc unlimited
* soft memlock unlimited
* hard memlock unlimited
---
2.2.4 时间同步
所有机器 yum install chrony*
1. flyfish11--flyfish14 同步阿里云的时间服务器:
vim /etc/chrony.conf 增加
----
注释掉相关默认的server
server ntp1.aliyun.com prefer
service chronyd start
chkconfig chronyd on
service chronyd stop
service chronyd start
chkconfig chronyd on
2.2.5 安装MySQL 5.7
wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum -y install mysql57-community-release-el7-11.noarch.rpm
yum -y install mysql-server --nogpgcheck --nogpgcheck #不校验数字签名
启动MySQL
service mysqld start
chkconfig mysqld on
service mysqld status
cat /var/log/mysqld.log |grep password
初始化MySQL:
set global validate_password_policy=0;
set global validate_password_length=1;
set password = password("flyfish225");
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'flyfish225' WITH GRANT OPTION;
flush privileges;
打开my.cnf:vim /etc/my.cnf
在[mysqld]下添加:disable_ssl=skip_ssl
重启MySQL:systemctl restart mysqld.service
创建datasophon数据库相关:
mysql -uroot -pflyfish225
set global validate_password_policy=0;
set global validate_password_length=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;
2.2.6 安装 nginx
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
wget https://nginx.org/download/nginx-1.22.0.tar.gz
Nginx编译安装步骤
tar -zxvf nginx-1.22.0.tar.gz
cd nginx-1.22.0
./configure
make
make install
启动nginx
cd /usr/local/nginx/
sbin/nginx
三: 安装 datasophon
3.1 datasophon 安装软件准备
安装软件准备:
DDP-1.0.0
安装目录
mkdir -p /opt/datasophon/DDP/packages
将DDP-1.0.0目录下的文件下载并上传到/opt/datasophon/DDP/packages目录下:
cd /root/software/datasophon/DDP-1.0.0
cp -ap * /opt/datasophon/DDP/packages/
datasophon-manager-1.0.0.tar.gz上传到服务器,
并解压到/opt/datasophon目录下(该目录可自行选择),
datasophon-manager目录结构如下所示:
cd /root/software/datasophon
tar -zxvf datasophon-manager-1.0.0.tar.gz
mv datasophon-manager-1.0.0 /opt/datasophon/
导入datasophon-manager安装根目录下sql文件夹下datasophon-1.0.0.sql文件,创建数据表:
mysql -uroot -p flyfish225
use datasophon;
source /opt/datasophon/datasophon-manager-1.0.0/sql/datasophon-1.0.0.sql;
show tables;
蒋dist 移动到nginx 默认目录下面
cd /root/software/datasophon
mv dist.zip /usr/local/nginx/
cd /usr/local/nginx/
unzip dist.zip
nginx 配置文件准备:
cd /usr/local/nginx/conf/
cp -ap nginx.conf nginx.conf.bak
vim nginx.conf
--------
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 8888;# 访问端口(自行修改)
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/local/nginx/dist; # 前端解压的 dist 目录地址(自行修改)
index index.html index.html;
}
location /ddh {
proxy_pass http://172.16.10.11: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;
}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
-----
cd /usr/local/nginx
sbin/nginx -t
sbin/nginx -s reload
ps -ef |grep nginx
netstat -nultp |grep 8888
修改数据库配置
cd /opt/datasophon/datasophon-manager-1.0.0/conf
vim application.yml # 主要修改url和password的值
----
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://172.16.10.11:3306/datasophon?useUnicode=true&characterEncoding=utf-8
username: datasophon
password: datasophon
driver-class-name: com.mysql.jdbc.Driver
----
mysql -h172.16.10.11 -udatasophon -pdatasophon
3.2 启动datasopohon 服务
cd /opt/datasophon/datasophon-manager-1.0.0
sh bin/datasophon-api.sh start api #启动
sh bin/datasophon-api.sh stop api #停止
sh bin/datasophon-api.sh restart api #重启
3.3 访问页面配置
访问页面
登录 http://172.16.10.11:8888
默认用户名和密码为admin/admin123
安装:
创建集群
组件版本
3.4 创建集群
进入
配置集群
主机验证
主机分发:
主机分发完成
初始化安装监控组件 三个: AlertManager,Grafana和Prometheus三个组件
DataSophon需要依赖此三个组件实现系统监控告警管理。
分配节点
worker 节点
告警目录配置与端口
告警配置与端口
监控配置完成
进入集群
进入查看总览
主机状况
告警管理
告警指标管理
部署zookeeper
安装HDFS服务
选择HDFS,点击【下一步】。
安装YARN
选择YARN,点击【下一步】。
安装hive
mysql -uroot -pflyfish225
# mysql -uroot -pflyfish225
mysql> create database hive character set utf8;
mysql> grant all privileges on hive.* to 'hive'@'%' identified by 'hive' with grant option;
mysql> grant all privileges on hive.* to 'hive'@'flyfish11' identified by 'hive' with grant option;
mysql> flush privileges;
依次部署其它大数据组件,由于开的是虚拟机配置有所不够,就不按安装其它组件
datasophon 目前只能用于尝试部署大数据组件,很多功能并不完善。生成慎用。