我使用数字海洋的液滴,我想通过我的工作台访问我的数据库。早些时候,我使用的是Google的计算引擎,设置相同,比如将绑定地址更改为服务器的私有ip,然后创建具有相同ip作为主机的用户。示例
my.cnf
port = 3306
bind-address = 10.223.0.1
mysql用户
CREATE USER 'adam'@'10.223.0.1' IDENTIFIED BY 'abc@123';
GRANT ALL PRIVILEGES ON *.* TO 'adam'@'10.223.0.1' WITH
所以我决定用两个液滴来建立我的项目,一个MongoDB图像液滴和一个NodeJS图像液滴。我这样做是为了便于将来扩展两个液滴,其他应用程序也可能在将来连接到DB,都是在Ubuntu18.04上。
我得到的错误是:
Could not connect to the database: { MongooseServerSelectionError: connection timed out
at new MongooseServerSelectionError (/root/eternal-peace-code/node_modules/mongoose/lib/error/server
我想设置自动部署从一个gitlab分支到一个数字海洋液滴。我用液滴创造了一个跑步者和执行git克隆人。但现在我无法配置我的gitlab-ci.yml,以便从分支"dev“自动部署到液滴。
我的gitlab-ci.yml:
image: python:3.5
staging:
type: deploy
only:
- dev
script:
# there must be some kind of connection to the droplet to further code executed already on server
- git pull
#