container 和宿主机运行完全相同的server 和脚本(包括ip和端口),看起来某些方面会冲突,谁能帮忙分析下?


我在某台宿主机上运行了一个container, container中运行了mysql数据库 A,一个server B, 还有一个脚本 C,C会往数据库A中插数据,会kill和重启B;

然后在宿主机上同时做同样的事情,也跑着A' B' C', 跑的某个时候container会挂掉,exit 编码是137;
数据库访问的ip都配置的是127.0.0.1, container 内部mysql的端口是3306, 宿主机上的mysql的端口也是3306

ps: 关于使用场景和使用规范的问题,已经建议修改了,现在的问题主要是想弄清楚到底什么地方冲突,所以大家不要纠结用法啊,多谢了!
已邀请:

fsfstone

赞同来自:


container挂掉的时候,在container中用strace命令跟踪到的一些信息:
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7353e5f000
read(4, "", 4096) = 0
close(4) = 0
munmap(0x7f7353e5f000, 4096) = 0
unlink("/regression/regression/regression/adserver/tmp/binary/playlist-ads40-20151111070943.log") = 0
openat(AT_FDCWD, "/regression/regression/regression/user_list_dir/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
getdents(4, / 2 entries /, 32768) = 48
getdents(4, / 0 entries /, 32768) = 0
close(4) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(1, "2015-11-11 07:09:45,681 - INFO:e"..., 502015-11-11 07:09:45,681 - INFO:extract lua output
) = 50
stat("/regression/regression/regression/adserver/regression_cmp.log", {st_mode=S_IFREG|0666, st_size=65820, ...}) = 0
open("/regression/regression/regression/adserver/regression_cmp.log", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0666, st_size=65820, ...}) = 0
fstat(4, {st_mode=S_IFREG|0666, st_size=65820, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7353e5f000
read(4, "C2015111107094490step0 = {\"luaou"..., 8192) = 8192
read(4, " : false,\n\t\t\"asset_terms\" : [\n\t\t"..., 4096) = 4096
read(4, "\t\t\t\t\t\t\"3266\"\n\t\t\t\t\t],\n\t\t\t\t\t\"ad_ca"..., 4096) = 4096
read(4, "ription_id\" : \"\",\n\t\t\"has_negativ"..., 4096) = 4096
read(4, "type_flag\" : 0,\n\t\t\"targeted_budg"..., 4096) = 4096
read(4, "FAULT\",\n\t\"soft_reserve\" : false,"..., 4096) = 4096
read(4, "ance_level\" : 0,\n\t\"gmt_offset\" :"..., 4096) = 4096
read(4, "t\" : {},\n\t\t\"rbb_compositional\" :"..., 4096) = 4096
read(4, "\t\"id\" : \"3210\",\n\t\t\t\t\"name\" : \"re"..., 4096) = 4096
read(4, "_rule_id\" : [],\n\t\"ad_unit\" : {\n\t"..., 4096) = 4096
read(4, "0-10\",\n\t\t\"end_date\" : \"2037-12-3"..., 4096) = 4096
read(4, "e\" : \"GUARANTEED\",\n\t\t\t\t\"physical"..., 4096) = 4096
read(4, "n_class\" : \"display\",\n\t\t\"time_po"..., 4096) = 4096
read(4, "32\",\n\t\t\t\"advertiser_id\" : \"32\",\n"..., 4096) = 4096
read(4, "\",\n\t\t\t\t\"base_ad_unit\" : \"3\",\n\t\t\t"..., 4096) = 4096
read(4, "yad_1\nfilling 1 inplayer slots\n\t"..., 4096) = 284
read(4, "", 4096) = 0
close(4) = 0
munmap(0x7f7353e5f000, 4096) = 0
unlink("/regression/regression/regression/adserver/regression_cmp.log") = 0
select(0, NULL, NULL, NULL, {1, 0}

tuxknight

赞同来自:


用法也不吐槽了。你的container是怎么跑起来的,用的什么镜像这些还是得交代一下的吧。

fsfstone

赞同来自:


container 就是直接docker run

镜像和宿主机都是redhat7的,多谢

要回复问题请先登录注册