我想通过redis的接口从nodejs点燃连接apache 在点燃配置中,我在config-default.xml中添加了以下xml定义:
<property name="connectorConfiguration">
<bean class="org.apache.ignite.configuration.ConnectorConfiguration">
<property name="host" value="localhost"/>
<property name="port" value="6379"/>
</bean>
</property>
并运行ignite.bat(win7 64bit中的测试平台)
console message seeming running fine:
[15:59:09] To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}
[15:59:09]
[15:59:09] Ignite node started OK (id=b58f9f35)
[15:59:09] Topology snapshot [ver=1, servers=1, clients=0, CPUs=4, heap=1.0GB]
测试nodejs代码时如:
var redis = require("redis");
var client = redis.createClient({detect_buffers: true});
client.get("test", function (err, reply) {
if(err == null){
console.log('reply:'+reply);
}
else{
console.log('error:'+err);
}
});
client.quit();
在nodejs中收到错误消息
vents.js:183
throw er; // Unhandled 'error' event
^
AbortError: Ready check failed: Stream connection ended and command aborted. It might have been processed.
at RedisClient.flush_and_error (d:\APP\nodejs\mcanserver\node_modules\redis\index.js:362:23)
at RedisClient.connection_gone (d:\APP\nodejs\mcanserver\node_modules\redis\index.js:597:14)
at Socket.<anonymous> (d:\APP\nodejs\mcanserver\node_modules\redis\index.js:293:14)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Waiting for the debugger to disconnect...
AbortError
和点燃控制台中的错误:
[16:08:59,809][SEVERE][grid-nio-worker-tcp-rest-0-#36][GridTcpRestProtocol] Fail
ed to process selector key [ses=GridSelectorNioSessionImpl [worker=ByteBufferNio
ClientWorker [readBuf=java.nio.HeapByteBuffer[pos=14 lim=14 cap=8192], super=Abs
tractNioClientWorker [idx=0, bytesRcvd=0, bytesSent=0, bytesRcvd0=0, bytesSent0=
0, select=true, super=GridWorker [name=grid-nio-worker-tcp-rest-0, igniteInstanc
eName=null, finished=false, hashCode=1424564915, interrupted=false, runner=grid-
nio-worker-tcp-rest-0-#36]]], writeBuf=null, readBuf=null, inRecovery=null, outR
ecovery=null, super=GridNioSessionImpl [locAddr=/127.0.0.1:6379, rmtAddr=/127.0.
0.1:18970, createTime=1527667738762, closeTime=0, bytesSent=0, bytesRcvd=14, byt
esSent0=0, bytesRcvd0=14, sndSchedTime=1527667738762, lastSndTime=1527667738762,
lastRcvTime=1527667738762, readsPaused=false, filterChain=FilterChain[filters=[
GridNioCodecFilter [parser=GridTcpRestParser [jdkMarshaller=JdkMarshaller [], ro
uterClient=false], directMode=false]], accepted=true]]]
java.lang.IllegalArgumentException: No enum constant org.apache.ignite.internal.
processors.rest.protocols.tcp.redis.GridRedisCommand.INFO
at java.lang.Enum.valueOf(Unknown Source)
at org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRe
disCommand.valueOf(GridRedisCommand.java:26)
at org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRe
disMessage.command(GridRedisMessage.java:124)
at org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRe
disNioListener.onMessage(GridRedisNioListener.java:132)
at org.apache.ignite.internal.processors.rest.protocols.tcp.GridTcpRestN
ioListener.onMessage(GridTcpRestNioListener.java:193)
at org.apache.ignite.internal.processors.rest.protocols.tcp.GridTcpRestN
ioListener.onMessage(GridTcpRestNioListener.java:94)
at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onM
essageReceived(GridNioFilterChain.java:279)
at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessa
geReceived(GridNioFilterAdapter.java:109)
我需要帮助才能知道发生了什么?以及如何修复此错误,谢谢。
答案 0 :(得分:1)
我担心您的客户端使用Apache Ignite未实现的命令INFO。是否可以尝试替代客户端或memcached客户端?请注意,后者具有二进制和文本形式,只支持其中一种形式。
答案 1 :(得分:0)
node.js redis客户端遇到了同样的问题。.的确,Apache Ignite不支持INFO操作,节点redis客户端使用它来检查Redis是否准备好服务查询。它关闭:
redis.createClient({no_ready_check: true});