小编Mar*_*ust的帖子

无法从EC2实例连接到RDS实例

从EC2实例i-78a8df00,我正在尝试连接到RDS实例mysql.************.us-east-1.rds.amazonaws.com.他们都在美国东部地区.我将EC2实例的安全组(sg-********)添加到RDS安全组,但这没有帮助.它似乎是防火墙/ DNS问题,因为它在运行此命令时超时:

ubuntu@ip-10-195-189-237:~$ mysql -h mysql.************.us-east-1.rds.amazonaws.com
Run Code Online (Sandbox Code Playgroud)

ERROR 2003(HY000):无法连接到'mysql上的MySQL服务器.************.us-east-1.rds.amazonaws.com'(110)

我可以使用与上面相同的行从本地计算机连接到RDS实例.我尝试了各种论坛解决方案,但那些没有帮助.

mysql amazon-ec2 amazon-web-services amazon-rds

42
推荐指数
6
解决办法
5万
查看次数

如何在React的recompose的生命周期方法中设置state?

我在我的React项目中使用重构 https://github.com/acdlite/recompose/

这是一个很棒的图书馆.我正在使用该compose实用程序作为容器组件,将状态向下作为道具传递给表示组件,如下所示:

const enhance = compose(
  lifecycle({
    componentDidMount() {
      myCall
        .getResponse([productId])
        .then(products => {
          setIsReady(true);
        });
    },
  }),
  withState('isAvailable', 'setIsAvailable', false),
  withState('isReady', 'setIsReady', false),
  mapProps(({
    setIsAvailable,
    setIsReady,
    ...state,
  }) => ({
    onLogoutTouchTap: () => {
      ...
Run Code Online (Sandbox Code Playgroud)

请注意其中的setIsReady(true)电话componentDidMount.这是我想要做的,但是lifecycle/componentDidMount无权访问setIsReady.如何componentDidMount通过重构来完成更新状态的预期结果?

javascript lifecycle reactjs recompose

15
推荐指数
1
解决办法
4239
查看次数

谷歌计算引擎工具gcloud非常慢

我尝试下载并使用gcloud bash工具来管理我的帐户,但是我使用该工具所做的一切都非常慢.MINUTES需要回复键入的命令.

是否可能需要在我的路由器或其他东西上打开防火墙以使其快速运行,就像它应该的那样?例如,此视频中的"安装..."行https://youtu.be/4y4-xn4Vi04?t=1m21s - 您会发现它们在几秒钟内完成了教程.在我的机器上完成这需要10多分钟.

我正在使用更新的Macbook Air,而所有其他互联网/等等都非常快.AT&T Uverse(30mbps/3mbps)的互联网连接速度很快.所有其他浏览都快速而且很好,我唯一能解决的问题是这个gcloud工具.

谢谢!标记

att google-compute-engine google-cloud-platform gcloud

13
推荐指数
2
解决办法
4972
查看次数

uwsgi破管 - django,nginx

我随机(并且一直)在uwsgi中得到一根破损的管道......如下所示.知道是什么导致这个或我如何调试?

我在django(tastypie),uwsgi,nginx,并在aws上运行m3.medium(ubuntu 14.04).

[pid: 1516|app: 0|req: 548/1149] 10.0.0.204 () {42 vars in 1039 bytes} [Wed Jun 18 16:11:11 2014] GET /api/v1/clock/?format=json => generated 1298 bytes in 20 msecs (HTTP/1.1 200) 4 headers in 119 bytes (1 switches on core 0)
[pid: 1517|app: 0|req: 594/1150] 10.0.0.204 () {42 vars in 1039 bytes} [Wed Jun 18 16:11:12 2014] GET /api/v1/clock/?format=json => generated 1298 bytes in 15 msecs (HTTP/1.1 200) 4 headers in 119 bytes (1 switches on core 0)
[pid: 1516|app: 0|req: …
Run Code Online (Sandbox Code Playgroud)

python django nginx uwsgi tastypie

8
推荐指数
1
解决办法
7913
查看次数

在Kubernetes上使用Nginx SSL代理运行Meteor应用程序

我在Google Cloud上使用Kubernetes部署了Meteor应用程序,配置了Nginx作为SSL终止.一切正常.

但是,似乎如果两个不同的客户端连接到两个不同的SSL容器,则更新不会在相应的应用程序上显示最多10秒,这使得Websockets看起来不起作用,但轮询正在生效.我已确认所有客户端都与Websockets连接,但由于更新不会立即传播,因此Nginx可能未配置为与Meteor应用程序正确通信.

这是我的SSL/Nginx服务:

apiVersion: v1 kind: Service metadata: name: frontend-ssl labels: name: frontend-ssl spec: ports: - name: http port: 80 targetPort: 80 - name: https port: 443 targetPort: 443 selector: name: frontend-ssl type: LoadBalancer loadBalancerIP: 123.456.123.456 sessionAffinity: ClientIP

这是流星服务:

apiVersion: v1 kind: Service metadata: name: frontend labels: name: frontend spec: ports: - port: 3000 targetPort: 3000 selector: name: flow-frontend type: LoadBalancer loadBalancerIP: 123.456.123.456 sessionAffinity: ClientIP

对于SSL终止,我使用Kubernetes建议的SSL设置与Websockets添加分开https://github.com/markoshust/nginx-ssl-proxy

ssl proxy nginx meteor kubernetes

8
推荐指数
1
解决办法
825
查看次数

升级到ElCapitán后,Meteor应用程序未在iOS模拟器中运行

升级到ElCapitán为我的Meteor应用程序后,我遇到了无法通过Xcode iOS模拟器登录的问题.我重新安装了Xcode,但这似乎没有帮助.

然后我从我的Meteor应用程序(cordova-plugin-statusbar@1.0.1,ionic-plugin-keyboard@1.0.4)中删除了我的cordova插件,清除了.meteor/local/cordova-plugins,然后去重新测试我的应用程序:

Marks-MacBook-Air:meteor markshust$ meteor run ios-device --settings settings/dev.json --verbose
Adding platform iOS to Cordova project
=> Errors executing Cordova commands:

   While adding platform iOS to Cordova project:
   Cordova error: CordovaError: Failed to fetch platform ios
   Probably this is either a connection problem, or platform spec is incorrect.
   Check your connection and platform name/version/URL.
   Error: version not found: cordova-ios@3.9.2
   at /Users/markshust/.meteor/packages/meteor-tool/.1.1.10.12lm5ls++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/cordova/platform.js:270:25
   at _rejected (/Users/markshust/.meteor/packages/meteor-tool/.1.1.10.12lm5ls++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:797:24)
   at /Users/markshust/.meteor/packages/meteor-tool/.1.1.10.12lm5ls++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:823:30
   at Promise.when (/Users/markshust/.meteor/packages/meteor-tool/.1.1.10.12lm5ls++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:1035:31)
   at Promise.promise.promiseDispatch (/Users/markshust/.meteor/packages/meteor-tool/.1.1.10.12lm5ls++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:741:41)
   at /Users/markshust/.meteor/packages/meteor-tool/.1.1.10.12lm5ls++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:557:44
   at flush (/Users/markshust/.meteor/packages/meteor-tool/.1.1.10.12lm5ls++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:108:17)
   at process._tickCallback …
Run Code Online (Sandbox Code Playgroud)

xcode ios cordova meteor

2
推荐指数
1
解决办法
3129
查看次数

django/tastypie基本身份验证适用于开发,而非生产

我正在用django/tastpie构建一个RESTful api.在我的开发(本地)环境中运行时,一切都很好,并且可以正确验证.

Marks-MacBook-Pro:~ mshust$ curl http://127.0.0.1:8000/api/v1/speedscreen/ -H 'Authorization: Basic bXNodXN0MToyMjY3' -v
* About to connect() to 127.0.0.1 port 8000 (#0)
        *   Trying 127.0.0.1...
        * connected
        * Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
                > GET /api/v1/speedscreen/ HTTP/1.1
                > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
                > Host: 127.0.0.1:8000
                > Accept: */*
                > Authorization: Basic bXNodXN0MToyMjY3
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Date: Thu, 09 Aug 2012 01:36:05 GMT
< Server: WSGIServer/0.1 Python/2.7.2
< Content-Type: …
Run Code Online (Sandbox Code Playgroud)

authentication django rest basic-authentication tastypie

1
推荐指数
1
解决办法
1553
查看次数