页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。


安装指南


面板
1、系统环境要求
borderColor
组件
#BBBBBB
要求
bgColor
操作系统
#F0F0F0
只支持 64位的Linux系统
borderWidth
建议:
1
CentOS 7或以上
borderStyle
RedHat 7或以上
solid
CPU

目录

建议16核或以上

maxLevel

内存

5

建议64G或128G

硬盘

建议固态硬盘或高速硬盘

空间大小2048G

2、安装介质装备

SmartbiMining介质:

安装介质

文件名

JDK

jdk-8u181-linux-x64.tar.gz

Spark

spark-2.4.0-bin-hadoop2.7.tgz

SmartbiEngine

smartbi-mining-engine-bin.tar.gz

Python

Python节点安装包Anaconda3-2019.10-Linux-x86_64.sh

CentOS7版本:bzip2-1.0.6-13.el7.x86_64.rpm

离线插件包:plugin

3、设置系统环境

3.1 取消打开文件数限制

代码块
linenumberstrue
在/etc/security/limits.conf
文件的末尾加入以下内容:
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

3.2 取消SELINUX

代码块
linenumberstrue
修改/etc/selinux/config中的SELINUX为disabled
SELINUX=disabled

3.3 关闭防火墙

代码块
linenumberstrue
1)CentOS 7.X/Redhat 7.X
systemctl stop firewalld 
 systemctl disable firewalld 
 systemctl status firewalld

3.4 修改主机名

注意

主机名不能使用下划线。

CentOS7:

代码块
linenumberstrue
# hostname 机器名
# echo 机器名 > /etc/hostname

配置主机ip和主机名的映射关系

代码块
linenumberstrue
# echo '服务器对应ip  机器名' >> /etc/hosts

Image Removed

开始部署

1、smartbi-spark单节点部署

spark是做为engine的计算节点来使用的。

  • 如果只有一个节点部署试用,可以不部署spark,只部署数据挖掘引擎服务,然后配置本地模式来使用。
  • 如果有两个及以上的服务器,可以一台部署engine,其他的机器部署spark单机版或者集群来提高性能。
注意

Smartbi数据挖掘服务引擎目前仅支持当前版本(spark-2.4.0-bin-hadoop2.7)。

1.1 安装java

解压jdk到指定目录:

代码块
linenumberstrue
# tar-zxvf


1、Spark安装

1.1 单节点Spark安装

1.1.1 安装JAVA

解压jdk到指定目录:

# tar -zxvf jdk-8u181-linux-x64.tar.gz

-C

/opt

添加环境变量。

代码块
linenumberstrue

#

vi

/etc/profile

在最底下添加下面内容:

代码块linenumberstrue

export

JAVA_HOME=/

usr/local

opt/jdk1.8.0_181

export

JAVA_BIN=$JAVA_HOME/bin

export

CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export

PATH=$PATH:$JAVA_BIN

让配置生效

code

linenumberstrue

#

source

/etc/profile

1.2 安装spark

1)解压及修改配置

#java -version

Image Added

1.

拷贝spark-2.4.0-bin-hadoop2.7.tgz到linux服务器

2. 解压到/opt目录

代码块
linenumberstrue
# tar -zxvf

1.2 安装Spark

解压Spark到安装目录

#tar -zxvf spark-2.4.0-bin-hadoop2.7.tgz

-C

/opt # ln -s

/opt

1.1.3 启动Spark

启动Spark master

#cd /opt/spark-2.4.0-bin-hadoop2.7/

/usr/local/spark

2)启动spark

启动spark主节点

代码块
linenumberstrue
# cd /usr/local/spark/sbin # sh

sbin

# ./start-master.sh

-h

主机名

例如:

主机名为SmartbiSpark,则执行:sh

主机名为smartbi-spark,则执行:./start-master.sh -h

SmartbiSpark

smartbi-spark

启动work节点

Image Added

代码块
linenumberstrue
# cd /usr/local/spark/sbin # sh

启动Spark work

#cd /opt/spark-2.4.0-bin-hadoop2.7/sbin

#./start-slave.sh

spark://master节点的主机名:7077

-c

配置的cpu数

-m

xg

配置得的内存数(g为单位)

注意

Work

节点最低配置问

节点最低配置为 1 8G 内存。 cpu 和内存比值建议为 1:8 ,即一个 cpu 配置 8G

的内存。

的内存

例如:worker节点为16核,128g内存的配置,master的主机名为SmartbiSpark

例如:worker节点为8核,64G内存的配置,master的主机名为smartbi-spark,则执行:

$ sh

# ./start-slave.sh spark://

SmartbiSpark

smartbi-spark:7077 -c

14

6 -m

112g ,2核16G留给操作系统。

3)检查spark

在浏览器中输入:http

48g     #2核16G留给系统

Image Added

1.1.4 检查Spark

在浏览器中输入:http://master节点的ip:

8080,查看集群状态,并在master节点提交任务测试进入/usr/local/spark目录,执行(将命令(
节点的ip)替换为master节点的实际ip或主机名):
代码块
linenumberstrue
# ./bin

8080,查看集群状态,

Image Added

在master节点提交任务测试进入/opt/spark-2.4.0-bin-hadoop2.7/bin目录,执行以下命令(注意将”节点的IP”替换对应的IP或主机名)

#./spark-submit

--class

org.apache.spark.examples.SparkPi

--master

spark://节点的ip:7077

/

usr

opt/

local/spark

spark-2.4.0-bin-hadoop2.7/examples/jars/spark-examples_2.11-2.4.0.jar

100

Image Added

运行得出圆周率Pi的近似值3.14即部署成功。

Image Removed

4)停止spark

代码块
linenumberstrue
# cd /usr/local/spark
# ./stop-all.sh
输入部署spark的节点的密码,停止spark。

5)查看日志

Spark的日志路径:/usr/local/spark/logs

安装部署或者使用中有问题,可能需要根据日志来分析解决。

6)版本更新

Spark仅作为计算节点。为了保证产品兼容性及稳定性,建议使用smartbi推荐的spark版本。目前暂时没有更新版本。

2、安装Python节点

python节点主要用于机器学习的DBSACN算法和自定义模块的python脚本扩展。如果没有用到这两个功能模块,可以不用部署python节点。

2.1 配置环境变量

代码块
linenumberstrue
# echo export PATH=/usr/local/anaconda3/bin:$PATH >>/etc/profile
# source /etc/profile

2.2 安装python

配置本地yum源

参考文档:https://www.jellythink.com/archives/548

安装依赖包

代码块
linenumberstrue
# rpm -ivh bzip2-1.0.6-13.el7.x86_64.rpm
# yum install -y gcc 

安装python主程序

指定安装目录为/opt/anaconda3

代码块
linenumberstrue
# ./Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/anaconda3
# ln -s /opt/anaconda3 /usr/local/anaconda3

安装python插件

进入python的离线插件包plugin目录

代码块
linenumberstrue
# pip install -U pip/pip-19.3.1-py2.py3-none-any.whl
# pip install xgboost/xgboost-0.90-py2.py3-none-manylinux1_x86_64.whl
# pip install lightgbm/lightgbm-2.3.0-py2.py3-none-manylinux1_x86_64.whl
# pip install psycopg2-binary/psycopg2_binary-2.8.4-cp37-cp37m-manylinux1_x86_64.whl
# pip install TextBlob/textblob-0.15.3-py2.py3-none-any.whl
# pip install --no-index --find-links=jieba/ jieba
# pip install --no-index --find-links=mysql-connector/ mysql-connector
# pip install --no-index --find-links=SnowNLP/ SnowNLP
# pip install --no-index --find-links=tensorflow/ tensorflow
# pip install --no-index --find-links=hmmlearn/ hmmlearn

3、smartbi-engine单节点安装

smartbiEngine是数据挖掘的引擎服务。必须配合smartbi大数据分析软件来使用。

3.1 系统设置

参考1.3章节设置系统环境。如果是同一台机器部署,可以忽略此步骤。

3.2 安装java

解压jdk到指定目录

代码块
linenumberstrue
#tar -zxvf jdk-8u181-linux-x64.tar.gz -C /opt

添加环境变量

代码块
linenumberstrue
# echo export JAVA_HOME=/opt/jdk1.8.0_181 >>/etc/profile
# echo export JAVA_BIN=$JAVA_HOME/bin >>/etc/profile
# echo export CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar >>/etc/profile
# echo export PATH=$PATH:$JAVA_BIN >>/etc/profile

让配置生效

代码块
linenumberstrue
#source /etc/profile

3.3 安装引擎 

解压数据挖掘引擎安装包到/opt目录(或其它空间足够的目录),SmartbiMiningEngine-V9.1.xxxx.tar.gz所在目录下执行:

代码块
linenumberstrue
# tar -zxvf SmartbiMiningEngine-V9.1.51256.19453.tar.gz -C /opt
# ln -s /opt/smartbi-mining-engine-bin/ /usr/local/smartbiEngine

3.4 启动引擎 

PS:需先启动sparksmartbi

代码块
linenumberstrue
# cd /usr/local/smartbiEngine/engine/sbin
# sh experiment-daemon.sh start
# sh service-daemon.sh start

3.5 配置引擎 

配置数据挖掘实验 

编辑 /usr/local/smartbiEngine/conf/experiment-application.properties

如下图所示,修改engine.monitor.receive.url和engine.monitor.authentication.url的地址为部署smartbi的主机名(ip)和端口号。 

修改engine.monitor.authentication.user为访问smartbi(具有管理员权限)的帐号 

修改engine.monitor.authentication.password为访问smartbi的密码。密码写明文,在smartbi和数据挖掘实验服务连接成功后,会自动加密为密文。 

建议在smartbi单独创建一个用户帐号(需要管理员权限),提供给数据挖掘引擎使用。可以和数据挖掘服务共用一个帐号。

Image Removed

配置数据挖掘服务 

编辑/usr/local/smartbiEngine/conf/service-application.properties

如下图所示,修改engine.monitor.receive.url和engine.monitor.authentication.url的地址为部署smartbi的主机名(ip)和端口号。 

修改engine.monitor.authentication.user为访问smartbi(具有管理员权限)的帐号 

修改engine.monitor.authentication.password为访问smartbi的密码。密码写明文,在smartbi和数据挖掘实验服务连接成功后,会自动加密为密文。 

建议在smartbi单独创建一个用户帐号(需要管理员权限),提供给数据挖掘引擎使用。可以和数据挖掘实验共用一个帐号。 

Image Removed

数据挖掘其他各配置项说明可以参考wiki文档说明了解。 

挖掘实验配置说明: 挖掘实验

挖掘服务配置项说明: 挖掘服务 

配置完成后重启引擎 

数据挖掘其他各配置项说明可以参考wiki文档说明了解。 

挖掘实验配置说明: 挖掘实验

挖掘服务配置项说明: 挖掘服务 

 

配置完成后重启引擎

3.6 重启引擎

代码块
linenumberstrue
# cd /usr/local/smartbiEngine/engine/sbin
# sh experiment-daemon.sh restart# sh service-daemon.sh restart

3.7 停止引擎 

代码块
linenumberstrue
# cd /usr/local/smartbiEngine/engine/sbin
# sh experiment-daemon.sh restart# sh service-daemon.sh restart 

3.8 验证安装 

代码块
linenumberstrue
# cd /usr/local/smartbiEngine/engine/sbin
# sh  experiment-daemon.sh status
# sh service-daemon.sh status

3.9 日志目录 

引擎启动后,会在/usr/local/smartbiEngine目录下生成logs目录,用来保存启动的引擎日志。 

安装部署或使用中遇到问题,可能需要提供相应的日志文件来分析解决。 

3.10 版本更新 

联系support获取新版本的数据挖掘引擎安装包。 

解压缩后,删除/usr/local/smartbiEngine/engine目录,然后上传新的engine目录。 

ps:数据挖掘引擎安装包版本要和smartbiwar包版本一致。

4、验证部署

访问 smartbi

使用浏览器打开 http://服务器 ip:端口/smartbi/vision/index.jsp,按下图步骤验证安装:

新建示例: 

Image Removed

保存示例: 

Image Removed

运行示例: 

Image Removed

查看示例:整个示例执行没有报错,数据挖掘服务部署成功。 

Image Removed

 

面板
borderColor#BBBBBB
bgColor#F0F0F0
borderWidth1
borderStylesolid
目录maxLevel4

计算节点配置
计算节点配置
1.1.5  计算节点配置

打开系统运维--系统选项–执行引擎--计算节点配置,(具体配置根据实际部署环境修改):

如下图所示,重点配置红框地方,第一个框填写spark master连接地址,其它选项配置策略如下:

  • instances * executor.memory <= spark可分配的内存数 * 0.7(例如 52G * 0.7 = 36)
  • instances * executor.cores <= spark可分配的cpu核数 * 0.7(例如: 32核 * 0.7 = 22)
  • max = executor.instances * executor.cores

默认情况下,executor.memory 配置为8G,除非总的内存比8G还小,根据上面策略,其它选项配置如下

  • instances = spark可分配的内存数 * 0.7 / executor.memory = 52 * 0.7 / 8 = 4
  • cores  = spark可分配的cpu核数 * 0.7 / executor.instances = 32 * 0.7 / 4 = 5
  • max = executor.instances * executor.cores = 4 * 5 = 20

Image Added

注意

给引擎分配的cpu个数、内存大小,不能超过spark服务器拥有的cpu个数、总内存的大小,否则引擎会启动失败。


注意

需采用先部署挖掘引擎在部署Spark的部署逻辑


1.1.6 停止Spark

#cd /opt/spark-2.4.0-bin-hadoop2.7/sbin

#./stop-all.sh

输入部署spark的节点的密码,停止spark。

查看日志

Spark的日志路径:/opt/spark-2.4.0-bin-hadoop2.7/logs

安装部署或者使用中有问题,可能需要根据日志来分析解决。

1.1.7 Spark版本更新

Spark仅作为计算节点。为了保证产品兼容性及稳定性,建议使用smartbi推荐的spark版本。目前暂时没有更新版本。