質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

1回答

1558閲覧

node.jsから、Aerospike接続について

leonardo

総合スコア10

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2016/04/20 10:00

node.jsでAerospikeへの接続を試みています。
MacOS(El capitan)では正常に読み込み書き込みを確認できています。

Amazon EC2上では以下の様なエラーがでて動作しません。
エラー位置はAerospike接続したあとの、kinesis接続の箇所ですが、
エラーメッセージの内容はAerospikeになっています。

{ [AerospikeError: uv_tcp_connect failed: unknown error] name: 'AerospikeError', message: 'uv_tcp_connect failed: unknown error', code: -6, func: 'as_uv_connect', file: 'src/main/aerospike/as_event_uv.c', line: 585 } /home/services/jenkins/worker/USER/routes/kinesis.js:28 if (error) throw error; ^ AerospikeError: uv_tcp_connect failed: unknown error at Function.AerospikeError.fromASError (/home/services/jenkins/worker/USER/node_modules/aerospike/lib/aerospike_error.js:113:10) at Client.DefaultCallbackHandler [as callbackHandler] (/home/services/jenkins/worker/USER/node_modules/aerospike/lib/client.js:72:72) at /home/services/jenkins/worker/USER/node_modules/aerospike/lib/client.js:825:10 at Client.get (/home/services/jenkins/worker/USER/node_modules/aerospike/lib/client.js:824:18) at null._onTimeout (/home/services/jenkins/worker/USER/routes/kinesis.js:27) at Timer.listOnTimeout [as ontimeout] (timers.js:121:15) npm ERR! weird error 8 npm ERR! not ok code 0

接続をしているコードは以下のとおりです。

var aerospike = require('aerospike'); var config = require('../config/databases.json'); var Key = aerospike.Key; var StartingSequenceNumber = null; aws.config.update({ region: config.aws.region, accessKeyId: config.aws.accessKeyId, secretAccessKey: config.aws.secretAccessKey }); var kinesis = new aws.Kinesis({ region: config.aws.region }); aerospike.connect({ hosts: config.aerospike.host, policies: { timeout: config.aerospike.timeout } }, function(error, client) { if (error) throw error; var key = new Key(config.aerospike.namespace, config.aerospike.setname, "StartingSequenceNumber"); client.put(key, { seq: "123456789" }, function(error) { if (error) console.log(error); }); client.get(key, function (error, record) { if (error) throw error; console.log(record); kinesis.describeStream({ StreamName: config.kinesis.stream }, function(error, result) { if(error) throw error; console.log(result); }); }); });

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

node.jsのバージョンが0.1系だったのが問題でした。よくある間違いですみません。

投稿2017/01/03 03:26

leonardo

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問