|
|
@ -85,9 +85,12 @@ ClickHouse也内置了许多机器学习算法,例如基于梯度下降的线 |
|
|
|
### 二)登录数据仓库。Clickhouse数据仓库的登录有很多方式,比如用clickhouse客户端登录,用JDBC(在Java中使用)或者ODBC(在C/C++中使用)访问,用clickhouse-driver(在Python中使用)访问。本实验我们完成clickhouse客户端和clickhouse-driver两种方式。其余方式同学们以后可以自行尝试。 |
|
|
|
|
|
|
|
#### 1)使用Clickhouse客户端登录。创建一个最低配置的Centos云主机,选择按流量计费,20M带宽,云主机按小时付费。登录云主机以后运行以下命令,下载Clickhouse安装包。 |
|
|
|
|
|
|
|
因为网络原因,我们使用阿里云的镜像安装 |
|
|
|
|
|
|
|
``` |
|
|
|
wget https://packages.clickhouse.com/rpm/lts/clickhouse-client-22.3.6.5.noarch.rpm |
|
|
|
wget https://packages.clickhouse.com/rpm/lts/clickhouse-common-static-22.3.6.5.x86_64.rpm |
|
|
|
wget https://mirrors.aliyun.com/clickhouse/rpm/lts/clickhouse-client-22.3.6.5.noarch.rpm |
|
|
|
wget https://mirrors.aliyun.com/clickhouse/rpm/lts/clickhouse-common-static-22.3.6.5.x86_64.rpm |
|
|
|
``` |
|
|
|
##### 安装 |
|
|
|
``` |
|
|
@ -101,6 +104,7 @@ clickhouse-client --host=<下图任一节点IP地址> --port=9000 --user=admin - |
|
|
|
<kbd> |
|
|
|
<img src="img/assignment5/adress.jpg"> |
|
|
|
</kbd> |
|
|
|
|
|
|
|
> 登录后将看到如下界面 |
|
|
|
<kbd> |
|
|
|
<img src="img/assignment5/login.jpg"> |
|
|
@ -161,11 +165,13 @@ SELECT * FROM ck_test.regression; |
|
|
|
sudo yum install python3 |
|
|
|
sudo yum install python3-pip |
|
|
|
``` |
|
|
|
安装clickhouse-driver |
|
|
|
安装clickhouse-driver,这里我们需要用阿里云镜像安装 |
|
|
|
``` |
|
|
|
pip3 install clickhouse-driver |
|
|
|
pip3 install --user -i https://mirrors.aliyun.com/pypi/simple clickhouse-driver |
|
|
|
``` |
|
|
|
|
|
|
|
可能会报未找到 gcc 命令的错误,运行 `sudo yum install -y gcc` 就好~ |
|
|
|
|
|
|
|
##### 2.1)安装完毕后运行python3,然后import clickhouse_driver,若没有报错,则说明clickhouse_driver安装成功。 |
|
|
|
<kbd> |
|
|
|
<img src="img/assignment5/run_python.jpg"> |
|
|
|