Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于启动 #44

Open
zhaolonghan opened this issue Sep 14, 2021 · 6 comments
Open

关于启动 #44

zhaolonghan opened this issue Sep 14, 2021 · 6 comments

Comments

@zhaolonghan
Copy link

请问老师 我按照文档 去安装启动(docker-compose),但是master启动error,请问是什么原因呢?config.toml这个文件是可以直接使用github上给的,还是需要修改里面的内容呢?

@zhaolonghan
Copy link
Author

[root@HW-north gores]# docker-compose restart
Restarting gores_server_1 ... done
Restarting gores_mysql_1 ... done
Restarting gores_master_1 ... error
Restarting gores_worker_1 ... done
Restarting gores_redis_1 ... done

ERROR: for gores_master_1 Cannot restart container 4b26459a39fe4e282a7e1f0f0a38b96d840e3626af82b40fda38aa579aace52a: oci runtime error: container_linux.go:235: starting container process caused "container init exited prematurely"

@zhenghaoz
Copy link
Collaborator

如果是尝试这个demo,那么config.toml是不需要改的,在项目根目录运行docker-compose up试试。

@zhaolonghan
Copy link
Author

[root@a001-0002 gores]# docker-compose stop
Stopping gores_server_1 ... done
Stopping gores_mysql_1 ... done
Stopping gores_worker_1 ... done
Stopping gores_redis_1 ... done
[root@a001-0002 gores]# ls -l
total 29664
-rw-r--r-- 1 root root 4532 Sep 14 15:06 config.toml
-rw-r--r-- 1 root root 939 Sep 14 15:05 docker-compose.yml
-rw-r--r-- 1 root root 30362341 Sep 8 21:18 github.sql
[root@a001-0002 gores]# docker-compose up
Starting gores_worker_1 ...
Starting gores_master_1 ...
Starting gores_mysql_1 ...
Starting gores_server_1 ...
Starting gores_master_1 ... error

ERROR: for gores_master_1 Cannot start service master: oci runtime error: container_linux.go:235: starting container process caused "container init exited prematurely"
Starting gores_worker_1 ... done

ERROR: for master Cannot start service master: oci runtime error: container_linux.go:235: starting container process caused "container init exited prematurely"

ERROR: Encountered errors while bringing up the project.

老师您好,我有个地方不是很明白,如果没有config.toml,master就能启动成功 但是什么都访问不到,而且会自己生成一个config.toml的文件夹。但是如果我加上这个config.toml,docker-compose就报上面的错误了

@zhaolonghan
Copy link
Author

master_1 | {"level":"info","ts":1631699069.3234115,"caller":"gorse-master/main.go:43","msg":"load config","config":"/etc/config.toml"}
master_1 | {"level":"info","ts":1631699069.3250608,"caller":"master/local_cache.go:46","msg":"load cache","path":"/tmp/gorse-master"}
master_1 | {"level":"warn","ts":1631699069.3251913,"caller":"master/master.go:155","msg":"failed to load local cache","error":"stat /tmp/gorse-master: no such file or directory","errorVerbose":"stat /tmp/gorse-master: no such file or directory\n/go/gorse/master/local_cache.go:50: "}
master_1 | {"level":"fatal","ts":1631699069.3307683,"caller":"master/master.go:194","msg":"failed to init database","error":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)","errorVerbose":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)\n/go/gorse/storage/data/sql.go:71: ","stacktrace":"github.com/zhenghaoz/gorse/master.(*Master).Serve\n\t/go/gorse/master/master.go:194\nmain.glob..func1\n\t/go/gorse/cmd/gorse-master/main.go:49\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:842\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883\nmain.main\n\t/go/gorse/cmd/gorse-master/main.go:60\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:255"}
master_1 | {"level":"info","ts":1631699071.7182999,"caller":"gorse-master/main.go:43","msg":"load config","config":"/etc/config.toml"}
master_1 | {"level":"info","ts":1631699071.719047,"caller":"master/local_cache.go:46","msg":"load cache","path":"/tmp/gorse-master"}
master_1 | {"level":"warn","ts":1631699071.7191122,"caller":"master/master.go:155","msg":"failed to load local cache","error":"stat /tmp/gorse-master: no such file or directory","errorVerbose":"stat /tmp/gorse-master: no such file or directory\n/go/gorse/master/local_cache.go:50: "}
master_1 | {"level":"fatal","ts":1631699071.721038,"caller":"master/master.go:194","msg":"failed to init database","error":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)","errorVerbose":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)\n/go/gorse/storage/data/sql.go:71: ","stacktrace":"github.com/zhenghaoz/gorse/master.(*Master).Serve\n\t/go/gorse/master/master.go:194\nmain.glob..func1\n\t/go/gorse/cmd/gorse-master/main.go:49\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:842\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883\nmain.main\n\t/go/gorse/cmd/gorse-master/main.go:60\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:255"}
master_1 | {"level":"info","ts":1631699076.102329,"caller":"gorse-master/main.go:43","msg":"load config","config":"/etc/config.toml"}
master_1 | {"level":"info","ts":1631699076.1038494,"caller":"master/local_cache.go:46","msg":"load cache","path":"/tmp/gorse-master"}
master_1 | {"level":"warn","ts":1631699076.1039662,"caller":"master/master.go:155","msg":"failed to load local cache","error":"stat /tmp/gorse-master: no such file or directory","errorVerbose":"stat /tmp/gorse-master: no such file or directory\n/go/gorse/master/local_cache.go:50: "}
master_1 | {"level":"fatal","ts":1631699076.1080313,"caller":"master/master.go:194","msg":"failed to init database","error":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)","errorVerbose":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)\n/go/gorse/storage/data/sql.go:71: ","stacktrace":"github.com/zhenghaoz/gorse/master.(*Master).Serve\n\t/go/gorse/master/master.go:194\nmain.glob..func1\n\t/go/gorse/cmd/gorse-master/main.go:49\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:842\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883\nmain.main\n\t/go/gorse/cmd/gorse-master/main.go:60\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:255"}
master_1 | {"level":"info","ts":1631699083.6043985,"caller":"gorse-master/main.go:43","msg":"load config","config":"/etc/config.toml"}
master_1 | {"level":"info","ts":1631699083.6051028,"caller":"master/local_cache.go:46","msg":"load cache","path":"/tmp/gorse-master"}
master_1 | {"level":"warn","ts":1631699083.605169,"caller":"master/master.go:155","msg":"failed to load local cache","error":"stat /tmp/gorse-master: no such file or directory","errorVerbose":"stat /tmp/gorse-master: no such file or directory\n/go/gorse/master/local_cache.go:50: "}
master_1 | {"level":"fatal","ts":1631699083.6071794,"caller":"master/master.go:194","msg":"failed to init database","error":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)","errorVerbose":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)\n/go/gorse/storage/data/sql.go:71: ","stacktrace":"github.com/zhenghaoz/gorse/master.(*Master).Serve\n\t/go/gorse/master/master.go:194\nmain.glob..func1\n\t/go/gorse/cmd/gorse-master/main.go:49\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:842\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883\nmain.main\n\t/go/gorse/cmd/gorse-master/main.go:60\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:255"}
master_1 | {"level":"info","ts":1631699097.721807,"caller":"gorse-master/main.go:43","msg":"load config","config":"/etc/config.toml"}
master_1 | {"level":"info","ts":1631699097.7225494,"caller":"master/local_cache.go:46","msg":"load cache","path":"/tmp/gorse-master"}
master_1 | {"level":"warn","ts":1631699097.722614,"caller":"master/master.go:155","msg":"failed to load local cache","error":"stat /tmp/gorse-master: no such file or directory","errorVerbose":"stat /tmp/gorse-master: no such file or directory\n/go/gorse/master/local_cache.go:50: "}
master_1 | {"level":"fatal","ts":1631699097.7245858,"caller":"master/master.go:194","msg":"failed to init database","error":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)","errorVerbose":"Error 1045: Access denied for user 'root'@'172.18.0.2' (using password: NO)\n/go/gorse/storage/data/sql.go:71: ","stacktrace":"github.com/zhenghaoz/gorse/master.(*Master).Serve\n\t/go/gorse/master/master.go:194\nmain.glob..func1\n\t/go/gorse/cmd/gorse-master/main.go:49\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:842\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883\nmain.main\n\t/go/gorse/cmd/gorse-master/main.go:60\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:255"}
worker_1 | {"level":"error","ts":1631699119.2519853,"caller":"worker/worker.go:126","msg":"failed to get meta","error":"rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: lookup master on 127.0.0.11:53: no such host"","stacktrace":"github.com/zhenghaoz/gorse/worker.(*Worker).Sync\n\t/go/gorse/worker/worker.go:126"}
server_1 | {"level":"error","ts":1631699119.4062195,"caller":"server/server.go:113","msg":"failed to get meta","error":"rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: lookup master on 127.0.0.11:53: no such host"","stacktrace":"github.com/zhenghaoz/gorse/server.(*Server).Sync\n\t/go/gorse/server/server.go:113"}

可能是docker的网卡问题 导致数据库连接不成功。这个就很尴尬了

@zhaolonghan
Copy link
Author

gorse_mysql_1 exited with code 0
[root@cainixihuan gorse]# docker-compose ps
Name Command State Ports

gorse_master_1 /usr/bin/gorse-master -c / ... Up 0.0.0.0:8086->8086/tcp, 0.0.0.0:8088->8088/tcp
gorse_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp, 33060/tcp
gorse_redis_1 docker-entrypoint.sh redis ... Up 0.0.0.0:6379->6379/tcp
gorse_server_1 /usr/bin/gorse-server --ma ... Up 0.0.0.0:8087->8087/tcp
gorse_worker_1 /usr/bin/gorse-worker --ma ... Up 0.0.0.0:8089->8089/tcp
[root@cainixihuan gorse]# curl http://127.0.0.1:8088
curl: (56) Recv failure: Connection reset by peer
[root@cainixihuan gorse]# curl http://loaclhost:8088
curl: (6) Could not resolve host: loaclhost; Unknown error
[root@cainixihuan gorse]#

这样是不是就启动成功了呢?但是为什么我访问不到呢?

@zhenghaoz
Copy link
Collaborator

很奇怪啊,看起来应该是成功了😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants