页面树结构

版本比较

标识

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

...

注意
title温馨提示

max_server_memory_usage默认值为0,表示不限制内存使用。跟config.xml文件的max_server_memory_usage_to_ram_ratio参数一起使用。默认最大内存是服务器的物理内存的90%。

max_server_memory_usage的配置值不能大于服务器物理内存乘以max_server_memory_usage_to_ram_ratio的值。

max_server_memory_usage的配置值也不能太小,否则可能导致无法执行sql查询

5.1.2、users.xml配置文件

1、设置数据库密码

方法一:设置明文密码

Image Removed

方法二:设置加密密码

生成加密密码串

echo -n "manager" | sha256sum | tr -d '-'
#注意:manager替换成实际的密码

Image Removed

注意:明文密码和加密密码只能二选一

5.2、启动、停止、重启smartbi-mpp

进入部署目录,以下所有操作均在此目录进行

cd smartbi-mpp-22.8.9.24

1、启动smartbi-mpp

sh clickhouse.sh start

Image Removed

查看进程

ps -ef | grep  clickhouse

Image Removed

查看端口监听

./netstat -lntp | grep 8123

Image Removed

本地客户端登录数据库,示例如下,注意替换成实际的服务器地址

cd smartbi-mpp-22.8.9.24

usr/bin/clickhouse-client -h 10.10.35.133

如果有设置数据库的密码,则参考以下命令登录:

cd smartbi-mpp-22.8.9.24

usr/bin/clickhouse-client  --host 10.10.35.133 --port 9000  --user default --password manaer

#manager替换成实际密码

Image Removed

2、重启smartbi-mpp

sh clickhouse.sh restart

Image Removed

3、停止smartbi-mpp

sh clickhouse.sh stop

Image Removed

5.3、卸载smartbi-mpp

进入部署目录,以下所有操作均在此目录进行

cd smartbi-mpp-22.8.9.24

执行卸载脚本

注意:默认卸载不删除数据目录,但避免出现异常,卸载前请备份数据目录:smartbi-mpp-22.8.9.24/var/lib/clickhouse/

sh uninstall.sh

执行卸载脚本时,会提示备份数据目录,需要手工进行备份,卸载脚本不会自动备份数据目录,并需要输入 yes 才会执行卸载操作

Image Removed

卸载完成后,默认数据目录和日志文件目录不会删除,如果需要删除,请手动操作。

5.4、调试方法

有时可能会出现smartbi-mpp启动失败,但是又没有日志的情况,可以使用如下命令启动smartbi-mpp,在前端获取启动日志分析问题

$ cd smartbi-mpp-22.8.9.24
$ usr/bin/clickhouse-server --config-file etc/clickhouse-server/config.xml --pid-file  var/run/clickhouse-server/clickhouse-server.pid

5.5、配置开机启动服务

注意
title注意

需要管理员权限(root或sudo权限),才能配置服务的开机启动

下载开机启动配置文件clickhouse-server.service

使用nodepad++等文本编辑工具编辑开机启动配置文件

Image Removed

如上图所示,配置启动mpp服务的用户名和用户组名称。

mpp的启动命令,需要配置mpp部署的实际路径,并且需要写绝对路径名称。

配置完成后保存文件,并把修改后的文件复制到操作系统的/usr/lib/systemd/system/ 目录

然后以管路员权限执行以下命令

重新加载服务配置文件

# systemctl daemon-reload

启动smartbimpp

# systemctl start clickhouse-server

配置开机启动

# systemctl enable clickhouse-server

查看mpp的状态

# systemctl status clickhouse-server

5.6、smartbi连接高速缓存库

高速缓存库在Smartbi中的配置方法如下:

(1)启动服务器,在浏览器输入Smartbi地址,进行登录;

(2)输入用户名密码,登录平台;

(3)在“系统导航栏”选择 数据连接,在“资源目录区”的高速缓存库更多操作Image Removed,选择 打开,或双击 高速缓存库;

Image Removed

(4)进入“高速缓存库”界面

Image Removed

(5)据实际使用的数据库,修改相应连接属性,连接属性详情请参见 各数据库的连接详情

(6)点击保存,保存配置。

详细说明请参考:高速缓存库

sSmartbi MPP 高速缓存库,列式数据库管理系统,用于抽取数据。

1、安装包说明

普通用户权限部署smartbimpp的安装介质,请联系Smartbi官方获取

smartbi-mpp.xxx.tar.gz安装包与RPM包方式部署有所不同,区别如下:

...

类别

...

tar.gz安装包

...

RPM安装包

...

安装权限要求

...

普通用户

...

root或sudo权限

...

部署目录路径

...

所有文件均在安装目录

...

系统中不同目录

...

启、停、重启

...

进入目录执行脚本

...

执行systemctl命令

...

安装、卸载操作

...

进入目录执行脚本

...

执行rpm命令

2、系统环境要求

...

组件

...

要求

...

操作系统

...

64位Linux操作系统

建议:

 Centos 7或以上

 RedHat 7以上

...

CPU

...

支持SSE 4.2指令集,建议8核或以上

...

内存

...

建议32G以上

...

硬盘

...

部署目录建议200G以上

注:查询CPU是否支持SSE 4.2指令集

grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"

3、系统环境配置(需要管理员权限)

注意

配置系统环境需要root或sudo权限。

3.1 取消打开文件数限制

在/etc/security/limits.conf 文件的末尾加入以下内容(注意: * 不能省略):

* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

在/etc/sysctl.conf中,添加以下内容:

fs.inotify.max_user_watches=524288
fs.inotify.max_user_instances=8192

  保存后,执行以下命令让设置生效

#  sudo sysctl -p /etc/sysctl.conf

3.2 防火墙配置

1、取消SELINUX

#临时关闭selinux

#  setenforce 0

#永久关闭Selinux,需要重启服务器生效

sed -i 's/=enforcing/=disabled/g'  /etc/selinux/config

2、关闭防火墙

1)CentOS 7.X/Redhat 7.X

#  systemctl stop firewalld
#  systemctl disable firewalld
#  systemctl status firewalld

3、开启防火墙

如果需要开启防火墙,则需要开放smartbi-mpp服务使用到的端口:

...

服务名

...

端口

...

说明

...

smartbi-mpp

...

8123

...

JDBC连接端口

开启端口参考如下:

#  firewall-cmd --permanent --add-port=8123/tcp
#  firewall-cmd --reload

4、部署smartbi-mpp

4.1 、准备安装smartbi-mpp

将smartbi-mpp-22.8.9.24.tar.gz安装包上传至服务器,并解压

注意
title注意

由于默认数据目录存放在安装包目录中,请确认目录空间充足,避免磁盘空间不足导致数据库异常

$ tar -zxvf smartbi-mpp-22.8.9.24-x86_64.tar.gz

解压后,目录结果如下:

Image Removed

目录说明:

install.sh:smartbi-mpp安装脚本

uninstall.sh:smartbi-mpp卸载脚本

packages:smartbi-mpp安装包文件

4.2、安装smartbi-mpp

1、进入smartbi-mpp-22.8.9.24目录,执行install.sh脚本

cd smartbi-mpp-22.8.9.24
./install.sh

如下图所示,表示安装完成,

Image Removed

安装过程中的信息,记录在smartbi-mpp-22.8.9.24/var/log/clickhouse-server/install.log文件中。

2、安装完成后,目录结构如下:

Image Removed

目录说明:

clickhouse-client、clickhouse-common-static、clickhouse-server:smartbi-mpp安装包程序

etc:smartbi-mpp配置文件存放目录

usr:smartbi-mpp执行文件存放目录

var:smartbi-mpp数据目录(var/lib/clickhouse)、运行状态(var/run)、日志文件(var/log)存放目录

clickhouse.sh:smartbi-mpp启动、停止、重启脚本

netstat:查看端口工具

5、运维操作

5.1、修改配置文件(可选)

配置文件存放路径:smartbi-mpp-22.8.9.24/etc/clickhouse-server/

配置文件说明:

  • SmartbiMPP配置文件:etc/clickhouse-server/config.xml
  • SmartbiMPP用户配置文件:etc/clickhouse-server/users.xml

5.1.1、config.xml配置文件

1、修改日志存放目录

修改日志目录时,需要给目录添加对应用户的权限,例如,test用户安装smartbi-mpp时,新的日志目录需要修改为test的权限,参考如下

chown -R test.test  <新日志目录>

Image Removed

2、修改默认监听端口

8123:JDBC驱动的连接端口,一般不建议修改

9000:clickhouse-client的连接端口,一般不建议修改

Image Removed

3、修改数据目录

数据存储目录用来存储smartbimpp的数据文件,可以设置其他目录用于存储SMARTBIMPP的数据文件,默认数据数据目录:smartbi-mpp-22.8.9.24/var/lib/clickhouse/

例如,test用户安装smartbi-mpp时,新的数据目录需要修改为test的权限,参考如下

chown -R test.test <新数据目录>     

修改以下配置

Image Removed

Image Removed

Image Removed

Image Removed

4、开启远程访问权限

默认监听本地地址,其他无法提供对外访问,可以开放远程访问

如果需要配置监听ipv4地址,则配置问<listen_host>0.0.0.0</listen_host>

如果需要配置监听ipv6地址,则配置问<listen_host>::</listen_host>

注意:ipv4地址和ipv6地址只能配置一个

Image Removed

5、修改内存配置

22.8版本的clickhouse,修改内存使用的配置文件在smartbi-mpp-22.8.9.24/etc/clickhouse-server/etc/clickhouse-server/config.xml

修改配置文件smartbi-mpp-22.8.9.24/etc/clickhouse-server/etc/clickhouse-server/config.xml

Image Removed

<max_server_memory_usage>0</max_server_memory_usage>

<max_server_memory_usage_to_ram_ratio>0.9</max_server_memory_usage_to_ram_ratio>

注意
title温馨提示

max_server_memory_usage默认值为0,表示不限制内存使用。跟config.xml文件的max_server_memory_usage_to_ram_ratio参数一起使用。默认最大内存是服务器的物理内存的90%。

max_server_memory_usage的配置值不能大于服务器物理内存乘以max_server_memory_usage_to_ram_ratio的值。

max_server_memory_usage的配置值也不能太小,否则可能导致无法执行sql查询

5.1.2、users.xml配置文件

温馨提示

密码不能使用特殊字符&、 小于号< 、大于号>

1、设置数据库密码

方法一:设置明文密码

方法二:设置加密密码

...

echo -n "manager" | sha256sum | tr -d '-'
#注意:manager替换成实际的密码

注意:明文密码和加密密码只能二选一

5.2、启动、停止、重启smartbi-mpp

进入部署目录,以下所有操作均在此目录进行

cd smartbi-mpp-22.8.9.24

...

usr/bin/clickhouse-client  --host 10.10.35.133 --port 9000  --user default --password manaer

#manager替换成实际面#manager替换成实际密码


2、重启smartbi-mpp

sh clickhouse.sh restart

...

3、停止smartbi-mpp

sh clickhouse.sh stop


5.3、卸载smartbi-mpp

进入部署目录,以下所有操作均在此目录进行

cd smartbi-mpp-22.8.9.24

...

卸载完成后,默认数据目录和日志文件目录不会删除,如果需要删除,请手动操作。


5.4、调试方法

有时可能会出现smartbi-mpp启动失败,但是又没有日志的情况,可以使用如下命令启动smartbi-mpp,在前端获取启动日志分析问题

$ cd smartbi-mpp-22.8.9.24
$ usr/bin/clickhouse-server --config-file etc/clickhouse-server/config.xml --pid-file  var/run/clickhouse-server/clickhouse-server.pid


5.5、配置开机启动服务

注意
title注意

需要管理员权限(root或sudo权限),才能配置服务的开机启动

...

# systemctl status clickhouse-server

5.6、smartbi连接高速缓存库

高速缓存库在Smartbi中的配置方法如下:

(1)启动服务器,在浏览器输入Smartbi地址,进行登录;

...