页面树结构

版本比较

标识

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


1、安装指南

1.1 系统环境要求

操作系统

只支持 64位的Linux系统

建议

l  CentOS 7或以上

l  RedHat 7或以上

CPU

建议16核或以上

内存

建议64G或128G

硬盘

建议固态硬盘或高速硬盘

空间大小2048G

1.2 安装介质装备

SmartbiMining介质

安装介质

文件名

JDK

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

Hadoop

hadoop-2.7.3.tar.gz

Spark

spark-2.4.0-bin-hadoop2.7.tgz

SmartbiEngine

smartbi-mining-engine-1.0-SNAPSHOT-bin.tar.gz

Python

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

pyhdfs:python的hdfs模块

CentOS6版本:bzip2-1.0.5-7.el6_0.x86_64.rpm

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

 

 

1.3 设置系统环境

1.3.1 取消打开文件数限制

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

1.3.2 取消SELINUX

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

1.3.3 关闭防火墙

代码块
linenumberstrue
1)、CentOS 6.X/Redhat 6.X
service iptables stop
service ip6tables stop
chkconfig iptables off
chkconfig ip6tables off
2)、CentOS 7.X/Redhat 7.X
systemctl stop firewalld 
 systemctl disable firewalld 
 systemctl status firewalld

 

2、开始部署

2.1 smartbi-spark单节点部署

2.1.1 java安装

java安装

解压到指定目录

代码块
linenumberstrue
# tar-zxvf


面板
borderColor#BBBBBB
bgColor#F0F0F0
borderWidth1
borderStylesolid

目录
maxLevel5


1、Spark安装

1.1 单节点Spark安装

1.1.1 安装JAVA

解压jdk到指定目录:

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

-C

/

usr/local

添加环境变量

代码块
linenumberstrue
# vi

opt

添加环境变量。

# vi /etc/profile

在最底下添加下面内容:

代码块
linenumberstrue

export

JAVA_HOME=/

usr

opt/

local/

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

2.1.2 系统设置

修改主机名(主机名不能使用下划线):

       CentOS 6

# hostname 主机名

Image Removed

# vi

让配置生效

# source /etc/

sysconfig/network

修改HOSTNAME的值

Image Removed

CentOS 7:

# hostname 机器名

# echo 机器名 > /etc/hostname

 

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

# echo ‘服务器对应ip  机器名’ >> /etc/hosts

Image Removed

2.1.3 spark安装

2.1.3.1 解压及修改配置

1. 拷贝spark-2.4.0-bin-hadoop2.7.tgz到spark的服务器的/usr/local目录下

2. 在/usr/local目录下执行

# tar

profile

#java -version

Image Added

1.1.2 安装Spark

解压Spark到安装目录

#tar -zxvf spark-2.4.0-bin-hadoop2.7.tgz -C /opt

2

1.1.3

.2 启动spark进入spark的master节点的/usr/local/

启动Spark

启动Spark master

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

sbin目录,执行:$ sh

sbin

# ./start-master.sh -h 主机名

例如:

主机名为SmartbiSpark,则执行:sh

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

SmartbiSpark

 

在spark安装目录的sbin目录下执行:

$ sh

smartbi-spark

Image Added

启动Spark work

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

#./start-slave.sh spark://master节点的主机名:7077 -c 配置的cpu数 -m xg 配置得的内存数(g为单位)

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

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

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

$ sh

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

SmartbiSpark

smartbi-spark:7077 -c

60

6 -m

120g ,4核8G留给操作系统。2

48g     #2核16G留给系统

Image Added

1.1.

3.3

4 检查Spark

在浏览器中输入:

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

7077,查看集群状态,并在master节点提交任务测试,进入/usr/local/

8080,查看集群状态,

Image Added

在master节点提交任务测试进入/opt/spark-2.4.0-bin-hadoop2.

7目录,执行(将命令红色部分替换为master节点的实际ip或主机名):$ ./bin/

7/bin目录,执行以下命令(注意将”节点的IP”替换对应的IP或主机名)

#./spark-submit --class org.apache.spark.examples.SparkPi --master spark://节点的ip:7077 /

usr/local/smartbi-spark

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

运行得出Pi的近似值3.14159即部署成功

Image Removed

2.2 smartbi-engine单节点安装

2.2.1 java安装

       参考spark的java安装章节。如果是同一台机器部署,可以忽略此步骤。

2.2.2 系统设置

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

2.2.3 安装引擎

解压安装包到/usr/local目录(或其它空间足够的目录),在smartbi-mining-engine-1.0-SNAPSHOT-bin.tar.gz所在目录下执行:

代码块
linenumberstrue
$ tar -zxvf smartbi-mining-engine-1.0-SNAPSHOT-bin.tar.gz -C /usr/local
$ ln -s /usr/local/smartbi-mining-engine-1.0-SNAPSHOT-bin /usr/local/engine

# 修改配置,打开/usr/local/engine/conf/experiment-application.properties,按下图修改配置:

Image Removed

打开/usr/local/engine/conf/service-application.properties,按下图修改配置:

Image Removed

2.2.4 启动引擎

执行(注意:需先启动spark和smartbi):

    sh /usr/local/engine/sbin/experiment-daemon.sh start

    sh /usr/local/engine/sbin/service-daemon.sh start

2.2.5 验证安装

sh  /usr/local/engine/sbin/experiment-daemon.sh status

sh  /usr/local/engine/sbin/service-daemon.sh status

2.3 smartbi-pynode部署

2.3.1 安装bzip2

CentOS 6

$ sudo rpm -ivh bzip2-1.0.5-7.el6_0.x86_64.rpm

CentOS 7

$ sudo rpm -ivh bzip2-1.0.6-13.el7.x86_64.rpm

2.3.2 安装

假设Anaconda安装包在/tmp目录,若不是/tmp目录,则将下面命令中的/tmp改为其它目录。

$ /bin/bash /tmp/Anaconda3-5.2.0-Linux-x86_64.sh -b -p /usr/local/anaconda3

2.3.3 配置环境变量

$ vi /etc/profile

在文件最后加入

export PATH=/usr/local/anaconda3/bin:$PATH

$ source /etc/profile

2.4 在smartbi配置smartbi-engine

1、在“系统导航栏”选择“系统运维”,点击“系统选项”

Image Removed

2、进入“系统选项”界面,选择“机器学习配置”,如图进行设置:

Image Removed

3、执行完第二步后,点击右下方的保存按钮,然后重启smartbi。

2.5 验证部署

访问 smartbi

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

1)在“系统导航栏”选择“数据挖掘”,进入“实验管理”界面,选择“案例”页签,点击“波士顿房价预测”案例:

Image Removed

2)点击运行,进行检验。

Image Removed

 

面板
borderColor#BBBBBB
bgColor#F0F0F0
borderWidth1
borderStylesolid
toc

Image Added

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

计算节点配置
计算节点配置
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版本。目前暂时没有更新版本。