在尝试运行Docker时,一切似乎都很好,但是当我尝试导航至所需页面时,浏览器(无论是Chrome,Firefox,Edge还是什么)都会返回ERR_CONNECTION_REFUSED。
我是Docker和容器的初学者。在阅读本书时,建议使用Docker以便能够轻松遵循所有示例,而不会浪费太多时间安装依赖项。
因此,我按照与存储库(https://github.com/mikhailklassen/Mining-the-Social-Web-3rd-Edition)相关的视频的Windows 10的所有步骤进行操作,基本上我下载了一个存储库,安装了Docker Tools(无法安装Docker Desktop),提取了Docker映像,分配了一个标签,然后进行了docker-compose。
很多代码在链接的存储库中都可用,这就是我在计算机上看到的:
Creating network "miningthesocialweb3rdeditionmaster_mongo_net" with driver "bridge"
Creating miningthesocialweb3rdeditionmaster_mongodb_1 ... done
Creating miningthesocialweb3rdeditionmaster_mtsw_1 ... done
Attaching to miningthesocialweb3rdeditionmaster_mongodb_1, miningthesocialweb3rdeditionmaster_mtsw_1
mongodb_1 | 2019-05-29T12:02:09.645+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=cf49c3d43275
mongodb_1 | 2019-05-29T12:02:09.842+0000 I CONTROL [initandlisten] db version v3.4.20
mongodb_1 | 2019-05-29T12:02:09.842+0000 I CONTROL [initandlisten] git version: 447847d93d6e0a21b018d5df45528e815c7c13d8
mongodb_1 | 2019-05-29T12:02:09.843+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
mongodb_1 | 2019-05-29T12:02:09.843+0000 I CONTROL [initandlisten] allocator: tcmalloc
mongodb_1 | 2019-05-29T12:02:09.843+0000 I CONTROL [initandlisten] modules: none
mongodb_1 | 2019-05-29T12:02:09.843+0000 I CONTROL [initandlisten] build environment:
mongodb_1 | 2019-05-29T12:02:09.844+0000 I CONTROL [initandlisten] distmod: ubuntu1604
mongodb_1 | 2019-05-29T12:02:09.844+0000 I CONTROL [initandlisten] distarch: x86_64
mongodb_1 | 2019-05-29T12:02:09.844+0000 I CONTROL [initandlisten] target_arch: x86_64
mongodb_1 | 2019-05-29T12:02:09.844+0000 I CONTROL [initandlisten] options: { net: { bindIp: "127.0.0.1,172.16.0.1" } }
mongodb_1 | 2019-05-29T12:02:09.850+0000 I STORAGE [initandlisten]
mongodb_1 | 2019-05-29T12:02:09.850+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
mongodb_1 | 2019-05-29T12:02:09.851+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
mongodb_1 | 2019-05-29T12:02:09.852+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=256M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),verbose=(recovery_progress),
mongodb_1 | 2019-05-29T12:02:12.731+0000 I CONTROL [initandlisten]
mongodb_1 | 2019-05-29T12:02:12.732+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
mongodb_1 | 2019-05-29T12:02:12.732+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
mongodb_1 | 2019-05-29T12:02:12.733+0000 I CONTROL [initandlisten]
mongodb_1 | 2019-05-29T12:02:14.214+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongodb_1 | 2019-05-29T12:02:15.591+0000 I INDEX [initandlisten] build index on: admin.system.version properties: { v: 2, key: { version: 1 }, name: "incompatible_with_version_32", ns: "admin.system.version" }
mongodb_1 | 2019-05-29T12:02:15.592+0000 I INDEX [initandlisten] building index using bulk method; build may temporarily use up to 500 megabytes of RAM
mongodb_1 | 2019-05-29T12:02:15.666+0000 I INDEX [initandlisten] build index done. scanned 0 total records. 0 secs
mongodb_1 | 2019-05-29T12:02:15.669+0000 I COMMAND [initandlisten] setting featureCompatibilityVersion to 3.4
mtsw_1 | [I 12:02:22.986 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
mtsw_1 | [I 12:02:24.864 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
mtsw_1 | [I 12:02:24.865 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
mtsw_1 | [I 12:02:24.868 NotebookApp] Serving notebooks from local directory: /home/jovyan
mtsw_1 | [I 12:02:24.869 NotebookApp] The Jupyter Notebook is running at:
mtsw_1 | [I 12:02:24.869 NotebookApp] http://(30ea4c0dfe6b or 127.0.0.1):8888/?token=d6a4b97b093aa6d1b96b3ab18fdff13395e603830296645b
mtsw_1 | [I 12:02:24.870 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
那是运行中的容器
30ea4c0dfe6b mtsw3e "tini -g -- /opt/con…" 6 hours ago Up 6 hours 0.0.0.0:5000->5000/tcp, 0.0.0.0:8888->8888/tcp miningthesocialweb3rdeditionmaster_mtsw_1
cf49c3d43275 mongo:3.4 "docker-entrypoint.s…" 6 hours ago Up 6 hours 0.0.0.0:27017->27017/tcp miningthesocialweb3rdeditionmaster_mongodb_1
导航到“ http://127.0.0.1:8888/?token=d6a4b97b093aa6d1b96b3ab18fdff13395e603830296645b”时,我得到的是ERR_CONN_REFUSED。
该过程似乎非常容易,所以不要在这里弄错我的意思。我试图找到其他答案,但对于我在这里想要实现的目标似乎太难了。