暂无图片
Mogdb 3.0 docker run 很慢,整个过程要15分钟
我来答
分享
章芋文
2022-07-11
Mogdb 3.0 docker run 很慢,整个过程要15分钟
[root@mo-000 /]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (AltArch) 

[root@mo-000 /]# docker pull swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:3.0.0

[root@mo-000 /]# docker run --name mogdb --privileged=true -d -e GS_PASSWORD=Enmo@123 -p 15432:5432  swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:3.0.0


[root@mo-000 /]# docker logs 97f0ae8d404a

                        Message: The supplied GS_PASSWORD is meet requirements.

The files belonging to this database system will be owned by user "omm".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".

fixing permissions on existing directory /var/lib/mogdb/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
Begin init undo subsystem meta.
[INIT UNDO] Init undo subsystem meta successfully.
creating template1 database in /var/lib/mogdb/data/base/1 ... 2022-07-11 01:58:52.343 [unknown] [unknown] localhost 281472866451472 0[0:0#0]  [BACKEND] WARNING:  macAddr is 578/2886795266, sysidentifier is 37923857/153452, randomNum is 3836237676

[root@mo-000 /]# docker ps -a
CONTAINER ID        IMAGE                                                COMMAND                  CREATED             STATUS                    PORTS                     NAMES
97f0ae8d404a        swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:3.0.0   "entrypoint.sh mogdb"    3 minutes ago       Up 2 minutes              0.0.0.0:15432->5432/tcp   mogdb


...
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run gs_initdb.

Success. You can now start the database server of single node using:

    mogdb -D /var/lib/mogdb/data --single_node
or
    gs_ctl start -D /var/lib/mogdb/data -Z single_node -l logfile

[2022-07-11 02:12:48.315][236][][gs_ctl]: gs_ctl started,datadir is /var/lib/mogdb/data 
[2022-07-11 02:12:48.342][236][][gs_ctl]: waiting for server to start...
.0 LOG:  [Alarm Module]can not read GAUSS_WARNING_TYPE env.

0 LOG:  [Alarm Module]Host Name: 97f0ae8d404a 

0 LOG:  [Alarm Module]Host IP: 172.17.0.2 

复制

从日志可以看出,差不多从2022-07-11 01:58:52.343到2022-07-11 02:12:49.473整个环境才初始化完成。

MogDB 2.0应该在1分钟左右,请问如何快速启动一个MogDB 3.0的单实例容器?

我来答
添加附件
收藏
分享
问题补充
6条回答
默认
最新
DarkAthena

我用你的这条docker run命令测的时间,creating template1到gs_ctl start只需要10秒,应该与特定的环境有关

creating template1 database in /var/lib/mogdb/data/base/1 ... 2022-07-12 04:32:03.075 [unknown] [unknown] localhost 139910916118336 0[0:0#0]  [BACKEND] WARNING:  macAddr is 578/2886795268, sysidentifier is 37923857/271689, randomNum is 2330338633

ok

initializing pg_authid ... ok

setting password ... ok

initializing dependencies ... ok

loading PL/pgSQL server-side language ... ok

creating system views ... ok

creating performance views ... ok

loading system objects' descriptions ... ok

creating collations ... ok

creating conversions ... ok

creating dictionaries ... ok

setting privileges on built-in objects ... ok

initialize global configure for bucketmap length ... ok

creating information schema ... ok

loading foreign-data wrapper for distfs access ... ok

loading foreign-data wrapper for hdfs access ... ok

loading foreign-data wrapper for log access ... ok

loading hstore extension ... ok

loading foreign-data wrapper for MOT access ... ok

loading security plugin ... ok

update system tables ... ok

creating snapshots catalog ... ok


                        Message: The supplied GS_PASSWORD is meet requirements.


vacuuming database template1 ... ok

copying template1 to template0 ... ok

copying template1 to postgres ... ok

freezing database template0 ... ok

freezing database template1 ... ok

freezing database postgres ... ok


WARNING: enabling "trust" authentication for local connections

You can change this by editing pg_hba.conf or using the option -A, or

--auth-local and --auth-host, the next time you run gs_initdb.


Success. You can now start the database server of single node using:


    mogdb -D /var/lib/mogdb/data --single_node

or

    gs_ctl start -D /var/lib/mogdb/data -Z single_node -l logfile


[2022-07-12 04:32:13.252][183][][gs_ctl]: gs_ctl started,datadir is /var/lib/mogdb/data 

[2022-07-12 04:32:13.296][183][][gs_ctl]: waiting for server to start...
复制
暂无图片 评论
暂无图片 有用 1
打赏 0
暂无图片
章芋文
题主
2022-07-12
ECS挂载的磁盘过期被冻结了,速度被限制在几kb/s,刚开始没发现。
Kamus

请查看一下日志,是否大量的时间消耗在创建mogila sample database中(包括insert sample data)

暂无图片 评论
暂无图片 有用 0
打赏 0
章芋文

从creating template1 database开始就很慢,这一步大概花了5-8分钟

[INIT UNDO] Init undo subsystem meta successfully.
creating template1 database in /var/lib/mogdb/data/base/1 ... 2022-07-11 01:58:52.343 [unknown] [unknown] localhost 281472866451472 0[0:0#0]  [BACKEND] WARNING:  macAddr is 578/2886795266, sysidentifier is 37923857/153452, randomNum is 3836237676
ok
initializing pg_authid ... ok
setting password ... ok
initializing dependencies ... ok
loading PL/pgSQL server-side language ... ok
creating system views ... ok
creating performance views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
initialize global configure for bucketmap length ... ok
creating information schema ... ok
loading foreign-data wrapper for distfs access ... ok
loading foreign-data wrapper for hdfs access ... ok
loading foreign-data wrapper for log access ... ok
loading hstore extension ... ok
loading foreign-data wrapper for MOT access ... ok
loading security plugin ... ok
update system tables ... ok
creating snapshots catalog ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
freezing database template0 ... ok
freezing database template1 ... ok
freezing database postgres ... ok
复制
暂无图片 评论
暂无图片 有用 0
打赏 0
伊织鸟

我的环境是VMworkstation 12,宿主机Centos 7.6,给了8G内存,使用文中提到的镜像。从加载镜像,到数据库初始化完成,不超过3min。

怀疑会不会是系统本身性能问题导致的,建议可以在创建docker时,看下系统的IO,看看是否有IO延时(iostat -dxt 1 10)

暂无图片 评论
暂无图片 有用 0
打赏 0
JiekeXu
暂无图片

不知道是不是没有加 -v 参数本地化的原因,我这里按照你们官方文档 run 起来很快的。

docker run --name mogdb --privileged=true -d -e GS_PASSWORD=Enmo@123  -v /mogdb:/var/lib/mogdb  -p 15432:5432  swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:3.0.0
复制
暂无图片 评论
暂无图片 有用 0
打赏 0
Kamus

@章芋文

最终定位的原因是什么?

暂无图片 评论
暂无图片 有用 0
打赏 0
章芋文
题主
2022-07-26
磁盘过期冻结,限速几kb/s,续费就好了
回答交流
Markdown


请输入正文
提交
相关推荐
mogdb客户端如何将查询结果输出为excel或html格式?
回答 2
已采纳
postgres\a\t\o/home/mogdb/yyyy.htmlOutputformatisunaligned.Showingonlytuples.postgres\psetformathtml
mogdb中如何实现postgrep sql中convert_empty_string_to_null = on配置的功能
回答 1
MogDB中在创建新的数据库时,可以通过设置DBCOMPATIBILITY参数,来控制空字符串和NULL值的行为。您的需求需要将DBCOMPATIBILITY设置为A。https://docs.mog
opengauss 5.0.0 支持使用sqlalchemy连接吗?
回答 5
大佬sqlalchemy连接opengauss5.0可以指导一下方法
浪潮+飞腾ARM下安装Mogdb2报错
回答 1
已采纳
目前MogDB官网没有发布该版本,openGauss可以自己编译一下。
mogdb5 pg_hba.conf问题
回答 1
你配置的规则是一个网段,而不是限制单个IP
虚拟机安装mogdb2.1提示The cpu instruction rdtscp is missing.
回答 5
已采纳
把install.sh里check那个注释掉试试?
opengauss3.1.0 做数据库主备,能指定数据库吗?
回答 2
已采纳
主备存在的意义就是要让主备数据完全一致,当主库发生故障时备库可以接管服务。同步单个数据库或者表是类似“OGG”的功能,目前是两个实例也就是两个不同的单节点数据库来通过发布订阅功能进行同步。
sysctl.conf
回答 1
已采纳
这要问什么?
MogDB3.0.1在备库构建主备关系时,构建失败,报错:no pg-hba.conf entry for host,但是这个配置文件是有的,请问该如何解决
回答 1
已采纳
A服务器如果需要访问B服务器上的数据库,那么在B服务器上的pghba.conf文件里,需要配置A服务器允许访问。如果你是参考的这个文档https://docs.mogdb.io/zh/mogdb/v3
MogDB3.0主备集群如何手工搭建
回答 1
可以参考一下https://www.modb.pro/doc/58634https://www.modb.pro/doc/52176"target"blank"https://www.modb.pro