暂无图片
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


请输入正文
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏