MatrixOne从入门到实践——部署MatrixOne

前两章节我们简单介绍了MatrixOne和源码编译了MatrixOne。本章节将使用不同的部署方式,来部署MatrixOne的服务。

注意:不同版本的MO,启动所使用的的命令不一样,请执行相应版本的启动命令!

源码部署

源码编译

源码编译直通车:MatrixOne从入门到实践——源码编译

上一章节讲了MatrixOne的源码编译,在编译完成之后,会在当前目录生成一个二进制文件:mo-service

目录结构如下所示:

drwxr-xr-x.  4 root root      4096 Sep  6 14:32 cgo
drwxr-xr-x. 3 root root 24 Sep 6 14:32 cmd
-rw-r--r--. 1 root root 3371 Sep 6 14:11 CODE_OF_CONDUCT.md
-rw-r--r--. 1 root root 2597 Sep 6 14:32 CODEOWNERS
-rw-r--r--. 1 root root 3704 Sep 6 14:11 CONTRIBUTING.md
drwxr-xr-x. 5 root root 38 Sep 6 14:11 docs
drwxr-xr-x. 4 root root 4096 Sep 6 19:06 etc
-rw-r--r--. 1 root root 6079 Sep 6 19:07 go.mod
-rw-r--r--. 1 root root 70341 Sep 6 14:32 go.sum
-rw-r--r--. 1 root root 11309 Sep 6 14:11 LICENSE
drwxr-xr-x. 2 root root 76 Sep 6 14:11 LICENSES
-rw-r--r--. 1 root root 5322 Sep 6 14:32 Makefile
-rwxr-xr-x. 1 root root 68334672 Sep 6 19:07 mo-service
-rw-------. 1 root root 624590427 Sep 8 16:24 nohup.out
drwxr-xr-x. 6 root root 102 Sep 6 14:32 optools
drwxr-xr-x. 27 root root 4096 Sep 6 14:32 pkg
drwxr-xr-x. 2 root root 201 Sep 6 19:06 proto
-rw-r--r--. 1 root root 11791 Sep 6 14:32 README_CN.md
-rw-r--r--. 1 root root 31404 Sep 6 14:32 README.md
drwxr-xr-x. 6 root root 65 Sep 6 19:13 store
drwxr-xr-x. 5 root root 50 Sep 6 19:06 test

部署

./mo-service -cfg ./etc/cn-standalone-test.toml

启动成功后会有一下日志显示:

{"level":"INFO","time":"2022/09/08 16:27:14.821702 +0800","caller":"frontend/session.go:842","msg":"dbName mo_catalog tableNames [mo_database mo_tables mo_columns mo_user mo_account mo_role mo_user_grant mo_role_grant mo_role_priv]"}
{"level":"INFO","time":"2022/09/08 16:27:14.821934 +0800","caller":"frontend/mysql_cmd_executor.go:1921","msg":"time of Exec.Build : 536.76µs","span":{"TraceId":"0b15b180-2f50-11ed-923c-000c29a35f3c","SpanId":"0000000000000000"}}
{"level":"INFO","time":"2022/09/08 16:27:14.822689 +0800","caller":"compile/scope.go:44","msg":"\t:2 filter(typ:<id:10 size:1 > f:<func:<obj:73014444032 > args:<typ:<id:10 size:1 > f:<func:<obj:12 obj_name:\"=\" > args:<typ:<id:61 width:100 > col:<col_pos:1 name:\"mo_tables.reldatabase\" > > args:<typ:<id:61 width:10 size:4 > c:<sval:\"mo_catalog\" > > > > args:<typ:<id:10 size:1 > f:<func:<obj:4294967308 obj_name:\"<>\" > args:<typ:<id:61 width:100 > col:<name:\"mo_tables.relname\" > > args:<typ:<id:61 width:23 size:4 > c:<sval:\"%!%mo_increment_columns\" > > > > > ) -> projection(typ:<id:61 width:100 > col:<name:\"mo_tables.relname\" > ) -> projection(typ:<id:61 width:100 > col:<name:\"mo_tables.relname\" > ) -> pipe connector"}
{"level":"INFO","time":"2022/09/08 16:27:14.822737 +0800","caller":"compile/scope.go:44","msg":":0 union all -> sql output"}
{"level":"DEBUG","time":"2022/09/08 16:27:14.822785 +0800","caller":"moengine/helper.go:41","msg":"try set 18 txn access info to t0(true) u0(true) r0(true), ","span":{"TraceId":"00000000-0000-0000-0000-000000000000","SpanId":"0000000000000000"}}
{"level":"INFO","time":"2022/09/08 16:27:14.823203 +0800","caller":"frontend/mysql_cmd_executor.go:2004","msg":"time of Exec.Run : 1.150387ms"}
{"level":"INFO","time":"2022/09/08 16:27:14.823247 +0800","caller":"frontend/mysql_cmd_executor.go:2277","msg":"----close mce"}
{"level":"INFO","time":"2022/09/08 16:27:14.823469 +0800","caller":"frontend/server.go:38","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823528 +0800","caller":"frontend/server.go:39","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823536 +0800","caller":"frontend/server.go:40","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823542 +0800","caller":"frontend/server.go:41","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823548 +0800","caller":"frontend/server.go:42","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823557 +0800","caller":"frontend/server.go:43","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823563 +0800","caller":"frontend/server.go:44","msg":"Server Listening on : 0.0.0.0:6001 "}
{"level":"INFO","time":"2022/09/08 16:27:14.823569 +0800","caller":"frontend/server.go:45","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823575 +0800","caller":"frontend/server.go:46","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823580 +0800","caller":"frontend/server.go:47","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823585 +0800","caller":"frontend/server.go:48","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823590 +0800","caller":"frontend/server.go:49","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"INFO","time":"2022/09/08 16:27:14.823600 +0800","caller":"frontend/server.go:50","msg":"++++++++++++++++++++++++++++++++++++++++++++++++"}
{"level":"DEBUG","time":"2022/09/08 16:27:14.823632 +0800","caller":"v2@v2.0.3-0.20220812142536-dfcb3d33cfdc/application.go:190","msg":"application started","listen-address":"0.0.0.0:6001"}
{"level":"INFO","time":"2022/09/08 16:27:14.823772 +0800","caller":"morpc/client.go:299","msg":"gc inactive backends task started"}
{"level":"DEBUG","time":"2022/09/08 16:27:14.823872 +0800","caller":"v2@v2.0.3-0.20220812142536-dfcb3d33cfdc/application.go:246","msg":"application accept loop started","listen-address":"0.0.0.0:6001"}

此时看见 application accept loop started,代表程序已经启动成功,但是此时是在前台启动的程序,当前界面会一直打印日志,因此,可以选择如下命令来启动mo-service:

nohup ./mo-service -cfg ./etc/cn-standalone-test.toml &

日志就会输出在当前目录下的nohup.out文件中。

二进制包部署

从 0.3.0 版本开始,就可以直接下载二进制包,然后在 X86_64 Linux 环境或者 X86_64 的 MacOS 环境中运行 MatrixOne。

下载二进制包

解压并部署

解压我们上一步下载的压缩包

unzip mo-server-v0.5.1-linux-amd64.zip
# 如提示没有unzip 命令,请使用下列命令安装
yum install -y unzip

解压完成后会有一个二进制文件,如下所示

[root@node01 matrixone]# unzip mo-server-v0.5.1-linux-amd64.zip
Archive: mo-server-v0.5.1-linux-amd64.zip
inflating: mo-server
inflating: system_vars_config.toml
[root@node01 matrixone]# ll
total 53200
-rwxr-xr-x. 1 root root 38715328 Aug 19 10:35 mo-server
-rw-r--r--. 1 root root 15747914 Aug 19 10:35 mo-server-v0.5.1-linux-amd64.zip
-rw-r--r--. 1 root root 10755 Aug 19 10:35 system_vars_config.toml

准备部署MO的服务

./mo-server ./system_vars_config.toml

启动后,有如下日志,就说明启动成功

{"level":"INFO","time":"2022/09/08 16:54:58.592942 +0800","caller":"frontend/mysql_cmd_executor.go:1639","msg":"time of Exec.Build : 10.615µs"}
{"level":"INFO","time":"2022/09/08 16:54:58.592967 +0800","caller":"frontend/mysql_cmd_executor.go:1763","msg":"time of Exec.Run : 9.16µs"}
{"level":"INFO","time":"2022/09/08 16:54:58.592982 +0800","caller":"frontend/mysql_cmd_executor.go:1769","msg":"time of SendResponse 76ns"}
{"level":"INFO","time":"2022/09/08 16:54:58.592996 +0800","caller":"frontend/session.go:537","msg":"commit autocommit only"}
{"level":"INFO","time":"2022/09/08 16:54:58.593004 +0800","caller":"frontend/session.go:84","msg":"switch from 2 to 3"}
{"level":"INFO","time":"2022/09/08 16:54:58.593014 +0800","caller":"frontend/session.go:608","msg":"clean tae txn"}
{"level":"INFO","time":"2022/09/08 16:54:58.593020 +0800","caller":"frontend/session.go:84","msg":"switch from 3 to 0"}
{"level":"INFO","time":"2022/09/08 16:54:58.593164 +0800","caller":"frontend/session.go:452","msg":"start txn autocommit if needed"}
{"level":"INFO","time":"2022/09/08 16:54:58.593175 +0800","caller":"frontend/session.go:375","msg":"current txn state 0"}
{"level":"INFO","time":"2022/09/08 16:54:58.593181 +0800","caller":"frontend/session.go:457","msg":"need create new txn"}
{"level":"INFO","time":"2022/09/08 16:54:58.593187 +0800","caller":"frontend/session.go:438","msg":"start txn by autocommit"}
{"level":"INFO","time":"2022/09/08 16:54:58.593198 +0800","caller":"frontend/session.go:84","msg":"switch from 0 to 2"}
{"level":"INFO","time":"2022/09/08 16:54:58.593205 +0800","caller":"frontend/mysql_cmd_executor.go:1529","msg":"start autocommit txn in default"}
{"level":"INFO","time":"2022/09/08 16:54:58.593219 +0800","caller":"frontend/mysql_cmd_executor.go:1639","msg":"time of Exec.Build : 4.645µs"}
{"level":"INFO","time":"2022/09/08 16:54:58.593238 +0800","caller":"frontend/mysql_cmd_executor.go:1763","msg":"time of Exec.Run : 4.643µs"}
{"level":"INFO","time":"2022/09/08 16:54:58.593252 +0800","caller":"frontend/mysql_cmd_executor.go:1769","msg":"time of SendResponse 64ns"}
{"level":"INFO","time":"2022/09/08 16:54:58.593265 +0800","caller":"frontend/session.go:537","msg":"commit autocommit only"}
{"level":"INFO","time":"2022/09/08 16:54:58.593272 +0800","caller":"frontend/session.go:84","msg":"switch from 2 to 3"}
{"level":"INFO","time":"2022/09/08 16:54:58.593279 +0800","caller":"frontend/session.go:608","msg":"clean tae txn"}
{"level":"INFO","time":"2022/09/08 16:54:58.593286 +0800","caller":"frontend/session.go:84","msg":"switch from 3 to 0"}
{"level":"DEBUG","time":"2022/09/08 16:54:58.593295 +0800","caller":"metric/metric.go:159","msg":"[Metric] init metrics tables: create cost 4 ms"}
{"level":"INFO","time":"2022/09/08 16:54:58.593382 +0800","caller":"metric/metric.go:104","msg":"[Metric] metrics scrape endpoint is ready at http://0.0.0.0:7001/metrics"}
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
Server Listening on : 0.0.0.0:6001
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
{"level":"info","ts":"2022-09-08 16:54:58.593","logger":"goetty","caller":"goetty@v1.13.0/application.go:96","msg":"application started","listen-address":"0.0.0.0:6001"}
{"level":"info","ts":"2022-09-08 16:54:58.593","logger":"goetty","caller":"goetty@v1.13.0/application.go:155","msg":"application accept loop started","listen-address":"0.0.0.0:6001"}

同理,我们可以使用后台启动的方式,将日志输出到文件中去

nohup ./mo-server ./system_vars_config.toml &

Docker部署

安装Docker

在进行docker部署之前,请先检查机器上是否有docker的环境,使用如下命令检查:

docker version

如果有以下输出,就说明具有docker的环境,并且docker的服务也启动着

[root@node01 matrixone]# docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-209.git7d71120.el7.centos.x86_64
Go version: go1.10.3
Git commit: 7d71120/1.13.1
Built: Wed Mar 2 15:25:43 2022
OS/Arch: linux/amd64 Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-209.git7d71120.el7.centos.x86_64
Go version: go1.10.3
Git commit: 7d71120/1.13.1
Built: Wed Mar 2 15:25:43 2022
OS/Arch: linux/amd64
Experimental: false

如果出现以下内容,说明具有docker环境,但是docker服务没有启动

[root@node01 matrixone]# docker version
Client:
Version: 1.13.1
API version: 1.26
Package version:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

直接执行以下命令启动docker即可

systemctl start docker

如果出现以下情况,说明docker没有安装

[root@node01 matrixone]# docker version
-bash: /usr/bin/docker: No such file or directory

需要安装,然后启动服务

yum install -y docker
# 安装完成后使用
systemctl start docker

部署MO环境

  • 拉取matrixone镜像

    使用如下命令拉取最新的matrixone的镜像文件

    docker pull matrixorigin/matrixone:latest

    如果需要拉取固定版本的镜像,请更换最后的版本描述即可,例如拉取0.5.1

    docker pull matrixorigin/matrixone:0.5.1

    拉取成功后,使用docker image 命令可以查看到我们拉取的镜像文件

    [root@node01 matrixone]# docker images
    REPOSITORY TAG IMAGE ID CREATED SIZE
    docker.io/matrixorigin/matrixone 0.5.1 c92ab76b7376 2 weeks ago 117 MB
    docker.io/matrixorigin/matrixone latest c92ab76b7376 2 weeks ago 117 MB
  • 运行镜像文件

    这里因为我们需要将容器内的端口映射到主机上,便于我们外部去和MO通信,同时我们还需要将数据目录挂载在我们本机上,所以我们在启动镜像的时候,需要添加这些操作,具体命令如下:

    docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:latest
    # 或者
    docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:0.5.1
    来启动不同版本的镜像

    如果需要挂载数据目录,请使用以下命令启动

    docker run -d -p 6001:6001 -v ${path_name}/system_vars_config.toml:/system_vars_config.toml:ro -v ${path_name}/store:/store:rw --name matrixone matrixorigin/matrixone:0.5.1
  • 检查是否成功

    启动对应镜像之后,需要查看对应容器是否启动成功,使用以下命令查看容器状态

    docker ps -a

    例如这里,容器启动有问题就会有下面的提示:

    CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                     PORTS               NAMES
    f7f0bf405b06 matrixorigin/matrixone:latest "/mo-server /syste..." 2 minutes ago Exited (2) 2 minutes ago matrixone

    此时,我们需要查看对应日志:

    docker logs f7f0bf405b06

    如果遇到启动不了的问题,需要升级docker,升级步骤如下:

    # 卸载老版本docker
    yum remove docker docker-common docker-selinux docker-engine
    # 安装相关依赖
    yum install -y yum-utils device-mapper-persistent-data lvm2
    # 设置docker yum源
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

    配置好源之后就可以查看对应的docker 版本了

    # 查看对应版本
    yum list docker-ce --showduplicates | sort -r

    如下所示:

    [root@node01 matrixone]# yum  list  docker-ce  --showduplicates |  sort -r
    * updates: mirrors.ustc.edu.cn
    This system is not registered with an entitlement server. You can use subscription-manager to register.
    : manager
    Loading mirror speeds from cached hostfile
    Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
    Installed Packages
    * extras: mirrors.bupt.edu.cn
    docker-ce.x86_64 3:20.10.9-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.9-3.el7 @docker-ce-stable
    docker-ce.x86_64 3:20.10.8-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.7-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.6-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.5-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.4-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.3-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.2-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.17-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.16-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.15-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.14-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.1-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.13-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.12-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.11-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.10-3.el7 docker-ce-stable
    docker-ce.x86_64 3:20.10.0-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.9-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.8-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.7-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.6-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.5-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.3-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.15-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.14-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.1-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.13-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.12-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.11-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.10-3.el7 docker-ce-stable
    docker-ce.x86_64 3:19.03.0-3.el7 docker-ce-stable
    docker-ce.x86_64 3:18.09.9-3.el7 docker-ce-stable
    docker-ce.x86_64 3:18.09.8-3.el7 docker-ce-stable

    我们选择最新的版本下载

    yum  install  -y --setopt=obsoletes=0 docker-ce-20.10.9-3.el7

    下载完成之后,启动docker,然后重新pull镜像,启动容器即可。

    命令如下:

    # pull镜像
    docker pull matrixorigin/matrixone:0.5.1
    # 启动容器
    docker run -d -p 6001:6001 --name mo0.5.1 matrixorigin/matrixone:0.5.1

    查看是否启动成功

    # 查看状态
    docker ps -a
    # 输出如下:
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    bd58ac4181d2 matrixorigin/matrixone:0.5.1 "/mo-server /system_…" 5 minutes ago Up 5 minutes 0.0.0.0:6001->6001/tcp, :::6001->6001/tcp mo0.5.1

MatrixOne从入门到实践03——部署MatrixOne的更多相关文章

  1. MatrixOne从入门到实践01——初识MatrixOne

    初识MatrixOne 简介 MatrixOrigin 矩阵起源 是一家数据智能领域的创新企业,其愿景是成为数字世界的核心技术提供者. 物理世界的数字化和智能化无处不在.我们致力于建设开放的技术开源社 ...

  2. MatrixOne从入门到实践02——源码编译

    MatrixOne从入门到实践--源码编译 ​ 在部署MatrixOne前,我们可能会比较纠结使用哪个版本合适,MatrixOne在github上有各个版本的Releases,包含源码包和适用于Lin ...

  3. MatrixOne从入门到实践08——SSB性能测试

    MatrixOne从入门到实践--SSB性能测试 SSB 星型模式基准测试是 OLAP 数据库性能测试的常用场景,通过本篇教程,您可以了解到如何在 MatrixOne 中实现 SSB 测试. 测试环境 ...

  4. MatrixOne从入门到实战04——MatrixOne的连接和建表

    MatrixOne从入门到实战--MatrixOne的连接和建表 前景回顾 前几篇文章,为大家介绍了MatrixOne这个产品,以及编译.部署MatrixOne的服务. 直通车: MatrixOne从 ...

  5. 设置应用程序的样式并对其进行部署——《Python编程从入门到实践》

    我们将使用应用程序django-bootstrap3为Web应用程序设计样式.我们将把项目"学习笔记"部署到Heroku,这个网站能让我们们将项目推送到其服务器,让任何有网络连接的 ...

  6. Docker 从入门到实践(一)Docker 简介

    读前须知:本教程大部分都是[Docker 从入门到实践 ]一书的知识,有兴趣可以直接观看书籍.同时,借鉴书籍的知识,如有侵权,请告知我,我会删除处理.谢谢. 一.什么是 Docker? Docker ...

  7. odoo:开源 ERP/CRM 入门与实践 -- 上海嘉冰信息技术公司提供咨询服务

    odoo:开源 ERP/CRM 入门与实践 看了这张图,或许你对odoo有了一些兴趣. 这次Chat就是和大家一起交流开源ERP/CRM系统:odoo 对以下读者有帮助:研发.产品.项目.市场.服务. ...

  8. git入门与实践【转】

    转自:http://www.cnblogs.com/shenhaocn/archive/2011/03/13/1982957.html 什么是版本控制 要了解什么是git,首先需要了解什么是版本控制( ...

  9. Django入门项目实践(下)

    5.设置应用程序的样式 安装django-bootstrap3. # untitled/untitled/settings.py # ··· INSTALLED_APPS = [ 'django.co ...

随机推荐

  1. 常用的函数式接口Consumer接口练习字符串拼接输出

    题目 下面的字符串数组当中有多条信息,请按照格式"姓名: XX 性别: XX"的格式将信息打印出来,要求将 打印姓名的动作为第一个Consumer接口的Lambda实例,将打印性别 ...

  2. PHP生成器yield使用示例

    <?php function getLines($file) { $f = fopen($file, 'r'); try { while ($line = fgets($f)) { yield ...

  3. 心动不如行动,基于Docker安装关系型数据库PostgrelSQL替代Mysql

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_171 最近"全栈数据库"的概念甚嚣尘上,主角就是PostgrelSQL,它最近这几年的技术发展不可谓不猛,覆盖 ...

  4. 1. MGR简介 | 深入浅出MGR

    GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 1. 为什么是MGR MGR是MySQL Group Replication的缩写,即MySQL组复制. 在以往,我们一般 ...

  5. Java源码分析 | Object

    本文基于 OracleJDK 11, HotSpot 虚拟机. Object 定义 Object 类是类层次结构的根.每个类都有 Object 类作为超类.所有对象,包括数组等,都实现了这个类的方法. ...

  6. C# using()的本质

    " 程序世界没有秘密,所有答案都在源码里 " 01.点明观点 C#中,非托管资源使用之后必须释放,而using()是使用非托管资源的最佳方式,可以确保资源在代码块结束之后被正确释放 ...

  7. HBase 安装与配置及常用Shell命令

    HBase 安装与配置 首要配置 配置时间同步(所有节点上执行) yum -y install chrony vi /etc/chrony.conf #写入(7版本用server:8版本用pool): ...

  8. KingbaseES 中select distinct on 语句

    用法 SELECT DISTINCT ON ( expression [, ...] ) 把记录根据[, -]的值进行分组,分组之后仅返回每一组的第一行. 需要注意的是,如果不指定ORDER BY子句 ...

  9. python3实现:进程遇Error定时重启

    import os import time # 停止HFish def stopHFish(): # while True: try: # 找到HFish进程号 HFish_id = int(os.p ...

  10. IDEA 修改注释的颜色