通过管理台体验长安链无法访问localhost
【问题分类】
- 疑惑
【问题描述】
通过管理台体验长安链无法访问localhost,报错cm_mgmt_server_1 | panic: dial tcp 172.20.0.2:3306: connect: connection refused
【系统信息】
- chainmaker-go version * : [v2.3.0]
- **OS & version * :centOS7.6
- **docker镜像 version:20.10.7
一、软硬件环境 4核8G 硬盘:100G 操作系统 centos7.6 4vCPU 8GiB
二、操作步骤 1、按照文档《通过管理台体验长安链》 https://docs.chainmaker.org.cn/v2.3.0_alpha/html/quickstart/%E9%80%9A%E8%BF%87%E7%AE%A1%E7%90%86%E5%8F%B0%E4%BD%93%E9%AA%8C%E9%93%BE.html
部署docker管理平台并部署4个docker链节点,docker版本为20.10.7或以上 docker-compose 版本为1.29.2或以上
`[root@****** management-backend]# docker-compose up
Starting management-backend_cm_db_1 ... done
Starting management-backend_cm_mgmt_server_1 ... done
Starting management-backend_cm_mgmt_web_1 ... done
Attaching to management-backend_cm_db_1, management-backend_cm_mgmt_server_1, management-backend_cm_mgmt_web_1
cm_db_1 | 2022-10-06 01:32:46+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.39-1.el7 started.
cm_db_1 | 2022-10-06 01:32:46+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
cm_db_1 | 2022-10-06 01:32:46+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.39-1.el7 started.
cm_db_1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
cm_db_1 | 2022-10-06T01:32:46.979891Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
cm_db_1 | 2022-10-06T01:32:46.982001Z 0 [Note] mysqld (mysqld 5.7.39) starting as process 1 ...
cm_db_1 | 2022-10-06T01:32:46.985777Z 0 [Note] InnoDB: PUNCH HOLE support available
cm_db_1 | 2022-10-06T01:32:46.985811Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
cm_db_1 | 2022-10-06T01:32:46.985815Z 0 [Note] InnoDB: Uses event mutexes
cm_db_1 | 2022-10-06T01:32:46.985819Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
cm_db_1 | 2022-10-06T01:32:46.985823Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
cm_db_1 | 2022-10-06T01:32:46.985826Z 0 [Note] InnoDB: Using Linux native AIO
cm_db_1 | 2022-10-06T01:32:46.986163Z 0 [Note] InnoDB: Number of pools: 1
cm_db_1 | 2022-10-06T01:32:46.986299Z 0 [Note] InnoDB: Using CPU crc32 instructions
cm_db_1 | 2022-10-06T01:32:46.988290Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
cm_db_1 | 2022-10-06T01:32:46.997104Z 0 [Note] InnoDB: Completed initialization of buffer pool
cm_db_1 | 2022-10-06T01:32:46.999886Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
cm_db_1 | 2022-10-06T01:32:47.012015Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
cm_db_1 | 2022-10-06T01:32:47.024741Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
cm_db_1 | 2022-10-06T01:32:47.024789Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
cm_db_1 | 2022-10-06T01:32:47.386550Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
cm_db_1 | 2022-10-06T01:32:47.387962Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
cm_db_1 | 2022-10-06T01:32:47.387980Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
cm_db_1 | 2022-10-06T01:32:47.389082Z 0 [Note] InnoDB: Waiting for purge to start
cm_db_1 | 2022-10-06T01:32:47.439227Z 0 [Note] InnoDB: 5.7.39 started; log sequence number 12568833
cm_db_1 | 2022-10-06T01:32:47.439994Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
cm_db_1 | 2022-10-06T01:32:47.440163Z 0 [Note] Plugin 'FEDERATED' is disabled.
cm_db_1 | 2022-10-06T01:32:47.442228Z 0 [Note] InnoDB: Buffer pool(s) load completed at 221006 1:32:47
cm_mgmt_server_1 | Load handler[AddChain] -> [*chain_management.AddChainHandler]
cm_mgmt_server_1 | Load handler[GetConsensusList] -> [*chain_management.GetConsensusListHandler]
cm_mgmt_server_1 | Load handler[GetCertNodeList] -> [*chain_management.GetCertNodeHandler]
cm_mgmt_server_1 | Load handler[AddUser] -> [*user.AddUserHandler]
cm_mgmt_server_1 | Load handler[ResetPassword] -> [*user.ResetPasswordHandler]
cm_mgmt_server_1 | Load handler[UpgradeContract] -> [*contract_management.UpgradeContractHandler]
cm_mgmt_server_1 | Load handler[GetRuntimeTypeList] -> [*contract_management.GetRuntimeTypeListHandler]
cm_mgmt_server_1 | Load handler[DownloadCert] -> [*ca.DownLoadCertHandler]
cm_mgmt_server_1 | Load handler[GetInvokeRecordList] -> [*contract_invoke.GetInvokeRecordListHandler]
cm_mgmt_server_1 | Load handler[GetAuthRoleList] -> [*overview.GetAuthRoleListHandler]
cm_mgmt_server_1 | Load handler[AutoReportLogFile] -> [*log_report.AutoReportLogFileHandler]
cm_mgmt_server_1 | Load handler[ModifyChainAuth] -> [*overview.ModifyChainAuthHandler]
cm_mgmt_server_1 | Load handler[GetContractManageList] -> [*contract_management.GetContractManageListHandler]
cm_mgmt_server_1 | Load handler[GetInvokeContractList] -> [*contract_invoke.GetInvokeContractListHandler]
cm_mgmt_server_1 | Load handler[GetAuthList] -> [*overview.GetAuthListHandler]
cm_mgmt_server_1 | Load handler[ReportLogFile] -> [*log_report.ReportLogFileHandler]
cm_mgmt_server_1 | Load handler[Logout] -> [*user.LogoutHandler]
cm_mgmt_server_1 | Load handler[InvokeContract] -> [*contract_invoke.InvokeContractHandler]
cm_mgmt_server_1 | Load handler[SubscribeChain] -> [*chain_management.SubscribeChainHandler]
cm_mgmt_server_1 | Load handler[DownloadChainConfig] -> [*chain_management.DownloadChainConfigHandler]
cm_mgmt_server_1 | Load handler[GetChainDetail] -> [*overview.GetChainDetailHandler]
cm_mgmt_server_1 | Load handler[GetLogList] -> [*log_report.GetLogListHandler]
cm_mgmt_server_1 | Load handler[UploadFile] -> [*ca.UploadHandler]
cm_mgmt_server_1 | Load handler[UnFreezeContract] -> [*contract_management.UnFreezeContractHandler]
cm_mgmt_server_1 | Load handler[ContractDetail] -> [*contract_management.ContractDetailHandler]
cm_mgmt_server_1 | Load handler[GetAuthOrgList] -> [*overview.GetAuthOrgListHandler]
cm_mgmt_server_1 | Load handler[DisableUser] -> [*user.DisableUserHandler]
cm_mgmt_server_1 | Load handler[GetCaptcha] -> [*user.CaptchaHandler]
cm_mgmt_server_1 | Load handler[GetNodeDetail] -> [*node.GetNodeDetailHandler]
cm_mgmt_server_1 | Load handler[GetVoteDetail] -> [*vote.GetVoteDetailHandler]
cm_mgmt_server_1 | Load handler[InstallContract] -> [*contract_management.InstallContractHandler]
cm_mgmt_server_1 | Load handler[GetInvokeRecordDetail] -> [*contract_invoke.GetInvokeRecordDetailHandler]
cm_mgmt_server_1 | Load handler[ImportCert] -> [*ca.ImportCertHandler]
cm_mgmt_server_1 | Load handler[GetContractDetail] -> [*explorer.GetContractDetailHandler]
cm_mgmt_server_1 | Load handler[GetTxDetail] -> [*explorer.GetTxDetailHandler]
cm_mgmt_server_1 | Load handler[GetNodeList] -> [*node.GetNodeListHandler]
cm_mgmt_server_1 | Load handler[GeneralData] -> [*overview.GeneralDataHandler]
cm_mgmt_server_1 | Load handler[GetCertUserList] -> [*chain_management.GetCertUserListHandler]
cm_mgmt_server_1 | Load handler[GetTxList] -> [*explorer.GetTxListHandler]
cm_mgmt_server_1 | Load handler[GetVoteManageList] -> [*vote.GetVoteManageListHandler]
cm_mgmt_server_1 | Load handler[FreezeContract] -> [*contract_management.FreezeContractHandler]
cm_mgmt_server_1 | Load handler[ModifyChainConfig] -> [*overview.ModifyChainConfigHandler]
cm_mgmt_server_1 | Load handler[PullErrorLog] -> [*log_report.PullErrorLogHandler]
cm_mgmt_server_1 | Load handler[GenerateCert] -> [*ca.GenerateCertHandler]
cm_mgmt_server_1 | Load handler[GetCertOrgList] -> [*chain_management.GetCertOrgListHandler]
cm_mgmt_server_1 | Load handler[ReInvokeContract] -> [*contract_invoke.ReInvokeContractHandler]
cm_mgmt_server_1 | Load handler[GetCert] -> [*ca.GetCertHandler]
cm_mgmt_server_1 | Load handler[ModifyPassword] -> [*user.ModifyPasswordHandler]
cm_mgmt_server_1 | Load handler[GetBlockDetail] -> [*explorer.GetBlockDetailHandler]
cm_mgmt_server_1 | Load handler[DownloadLogFile] -> [*log_report.DownloadLogFileHandler]
cm_mgmt_server_1 | Load handler[DeleteChain] -> [*chain_management.DeleteChainHandler]
cm_mgmt_server_1 | Load handler[Login] -> [*user.LoginHandler]
cm_mgmt_server_1 | Load handler[GetUserList] -> [*user.GetUserListHandler]
cm_mgmt_server_1 | Load handler[EnableUser] -> [*user.EnableUserHandler]
cm_mgmt_server_1 | Load handler[GetBlockList] -> [*explorer.GetBlockListHandler]
cm_mgmt_server_1 | Load handler[GetCertList] -> [*ca.GetCertListHandler]
cm_mgmt_server_1 | Load handler[HomePageSearch] -> [*explorer.HomePageSearchHandler]
cm_mgmt_server_1 | Load handler[GetOrgList] -> [*organization.GetOrgListHandler]
cm_mgmt_server_1 | Load handler[Vote] -> [*vote.VoteHandler]
cm_mgmt_server_1 | Load handler[GetContractList] -> [*explorer.GetContractListHandler]
cm_mgmt_server_1 | Load handler[RevokeContract] -> [*contract_management.RevokeContractHandler]
cm_mgmt_server_1 | Load handler[ModifyContract] -> [*contract_management.ModifyContractHandler]
cm_mgmt_server_1 | Load handler[GetChainList] -> [*chain_management.GetChainListHandler]
cm_mgmt_server_1 | [env]:
cm_mgmt_server_1 | env is empty, set default: space
cm_mgmt_server_1 | {
cm_mgmt_server_1 | "DBConf": {
cm_mgmt_server_1 | "Database": "chainmaker_dev",
cm_mgmt_server_1 | "Host": "cm_db",
cm_mgmt_server_1 | "Passwd": "Baec&chainmaker",
cm_mgmt_server_1 | "Port": "3306",
cm_mgmt_server_1 | "User": "chainmaker"
cm_mgmt_server_1 | },
cm_mgmt_server_1 | "LogConf": null,
cm_mgmt_server_1 | "WebConf": {
cm_mgmt_server_1 | "Address": "0.0.0.0",
cm_mgmt_server_1 | "AgentPort": 22301,
cm_mgmt_server_1 | "CaptchaConf": {
cm_mgmt_server_1 | "Height": 80,
cm_mgmt_server_1 | "Length": 4,
cm_mgmt_server_1 | "NoiseCount": 5,
cm_mgmt_server_1 | "Width": 200
cm_mgmt_server_1 | },
cm_mgmt_server_1 | "CrossDomain": true,
cm_mgmt_server_1 | "ErrmsgLang": 1,
cm_mgmt_server_1 | "LoadPeriodSeconds": 60,
cm_mgmt_server_1 | "Password": "a123456",
cm_mgmt_server_1 | "Port": 9999,
cm_mgmt_server_1 | "ReportUrl": "https://bugreport.chainmaker.org.cn:8000/v1/reportLogs",
cm_mgmt_server_1 | "SessionAge": 86400
cm_mgmt_server_1 | }
cm_mgmt_server_1 | }
cm_mgmt_web_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
cm_mgmt_web_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
cm_mgmt_web_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
cm_mgmt_web_1 | 10-listen-on-ipv6-by-default.sh: Getting the checksum of /etc/nginx/conf.d/default.conf
cm_mgmt_web_1 | 10-listen-on-ipv6-by-default.sh: error: /etc/nginx/conf.d/default.conf differs from the packaged version
cm_mgmt_server_1 | panic: dial tcp 172.20.0.2:3306: connect: connection refused
cm_mgmt_server_1 |
cm_mgmt_server_1 | goroutine 1 [running]:
cm_mgmt_server_1 | management_backend/src/db/connection.InitDbConn(0xc0003422d0)
cm_mgmt_server_1 | /cm-mgmt/src/db/connection/connection.go:43 +0x2a5
cm_mgmt_server_1 | main.main()
cm_mgmt_server_1 | /cm-mgmt/src/main.go:44 +0xa5
cm_db_1 | 2022-10-06T01:32:47.447124Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
cm_db_1 | 2022-10-06T01:32:47.447143Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
cm_db_1 | 2022-10-06T01:32:47.447148Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
cm_db_1 | 2022-10-06T01:32:47.447151Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
cm_db_1 | 2022-10-06T01:32:47.447953Z 0 [Warning] CA certificate ca.pem is self signed.
cm_db_1 | 2022-10-06T01:32:47.448009Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
cm_db_1 | 2022-10-06T01:32:47.448282Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
cm_db_1 | 2022-10-06T01:32:47.448325Z 0 [Note] IPv6 is available.
cm_db_1 | 2022-10-06T01:32:47.448336Z 0 [Note] - '::' resolves to '::';
cm_db_1 | 2022-10-06T01:32:47.448359Z 0 [Note] Server socket created on IP: '::'.
cm_db_1 | 2022-10-06T01:32:47.453454Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
cm_db_1 | 2022-10-06T01:32:47.462945Z 0 [Note] Event Scheduler: Loaded 0 events
cm_db_1 | 2022-10-06T01:32:47.463163Z 0 [Note] mysqld: ready for connections.
cm_db_1 | Version: '5.7.39' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
cm_mgmt_web_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
cm_mgmt_web_1 | /docker-entrypoint.sh: Configuration complete; ready for start up`
无法访问localhost
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information