Redis Enterprise Clustering Command Error 'CLUSTER' - redis

We just installed Redis Enterprise and set some configuration on the database.
We create a simple script becase on our app the cluster command doesn't work, and that's correct it doesn't work:
var RedisClustr = require('redis-clustr');
var redis = new RedisClustr({
servers: [
{
host: 'URL',
port: 18611
}
],
redisOptions: {
password: 'ourpassword'
}
});
redis.get('KSHJDK', function(err, res) {
console.log(res, err);
});
Error on the shell:
undefined Error: couldn't get slot allocation'
at tryClient (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/src/RedisClustr.js:194:17)
at /Users/machine/Sites/redis-testing/node_modules/redis-clustr/src/RedisClustr.js:205:16
at Object.callbackOrEmit [as callback_or_emit] (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/lib/utils.js:89:9)
at RedisClient.return_error (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/index.js:706:11)
at JavascriptRedisParser.returnError (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/index.js:196:18)
at JavascriptRedisParser.execute (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis-parser/lib/parser.js:572:12)
at Socket.<anonymous> (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis/index.js:274:27)
at Socket.emit (events.js:321:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:273:9) {
errors: [
ReplyError: ERR command is not allowed
at parseError (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis-parser/lib/parser.js:193:12)
at parseType (/Users/machine/Sites/redis-testing/node_modules/redis-clustr/node_modules/redis-parser/lib/parser.js:303:14) {
command: 'CLUSTER',
args: [Array],
code: 'ERR'
}
]
}
Are we missing something on the configuration?
We don't know if its an error con the clustering or on Redis Enterprise.

Redis Enterprise supports two clustering flavors.
With regular OSS cluster you need a cluster aware client like the one you use.
The one you are using is for non-cluster aware clients, you should use it with regular client (as if you are connecting to a single Redis process).

Related

I used Google Cloud Platform App Engine and Google Cloud SQL, Sequelize, but Error: connect ETIMEDOUT error

The server is intended to be deployed via GCP, React is deployed as a separate instance.
I use Sequelize, Node, Express, MySQL.
Cloud SQL confirmed that Sequelize and DB were well linked through workbench.
I once distributed it through APP Engine, so I added Cloud SQL-related settings, and if there was no problem, I decided that it would be possible to call the desired data.
The deployment was successful through gcloud app deployment and tried to verify that the desired API was called well, but 500 errors were constantly occurring.
I don't know where to fix it, can you give me a tip?
config/config.js
require('dotenv').config();
module.exports = {
development: {
username: "root",
password: process.env.SEQUELIZE_PASSWORD,
database: "DBName",
host: "SQL Instance Public IP Address",
dialect: "mysql",
timezone: "+09:00"
},
test: {
username: "root",
password: null,
database: "database_test",
host: "127.0.0.1",
dialect: "mysql"
},
production: {
username: "root",
password: process.env.SEQUELIZE_PASSWORD,
database: "DBName",
host: "SQL Instance Public IP Address",
dialect: "mysql",
timezone: "+09:00",
logging: false
},
}
server.js
const express = require('express')
const cors = require('cors')
const dotenv = require('dotenv')
const Test = require('./Routes/Test')
const { sequelize } = require('./models')
dotenv.config()
const app = express()
app.set("PORT", process.env.PORT || 8080)
sequelize.sync({force: false})
.then(() => {console.log('db Oneline')})
.catch((err) => {console.error(err)})
app.use(cors({origin: "*"}))
app.use(express.json())
app.use('/test',Test)
app.listen(app.get('PORT'), () => {
console.log(app.get("PORT"), 'Online')
})
In server.js, /test aims to receive this data from the front desk in a get request.
app.yaml
runtime: nodejs
env: flex
service: default
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
env_variables:
SQL_USER: "root"
SQL_PASSWORD: "root password entered when SQL was created"
SQL_DATABASE: "Instance ID"
INSTANCE_CONNECTION_NAME: "logintest-b314a:asia-northeast3:Instance ID"
beta_settings:
cloud_sql_instances: "logintest-b314a:asia-northeast3:Instance ID"
Error Messages from Error Reporting
SequelizeConnectionError: connect ETIMEDOUT
at ConnectionManager.connect (/app/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:102:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
parent: Error: connect ETIMEDOUT
at Connection._handleTimeoutError (/app/node_modules/mysql2/lib/connection.js:189:17)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7) {

how to configure nest/Bull redis connection

I am using BullModule in nest.js.
when I connect to a local redis it works:
const REDIS = {
host: 'localhost',
};
#Module({
imports: [
TaskTypesModule,
TasksModule,
ScheduleModule.forRoot(),
BullModule.forRoot({
// #ts-ignore
redis: REDIS,
}),
],
controllers: [AppController],
providers: [AppService, PrismaService],
})
export class AppModule {}
But when I connect to a remote system
const REDIS = {
host: process.env.REDIS_ENDPOINT,
port: process.env.REDIS_PORT,
password: process.env.REDIS_PASSWORD,
};
with env file
REDIS_USERNAME=default
REDIS_PASSWORD=p----------------------S
REDIS_ENDPOINT=redis-1xxxxx4.c261.us-east-1-4.ec2.cloud.redislabs.com
REDIS_PORT=1xxxxx4
it doesn't write to the redis queue; by way of comparison, I can connect via redisight:
redsight connection
So - bottom line - how to configure the redis node for a remote connection in Bull?
For what I have tested, bull settings never accept a redis port different than its default, 6379.
Maybe the env file hasn't been loaded yet. You can try adding import 'dotenv/config' at the top of this file.

TronBox compile issue

I've installed the latest tronbox (2.7.5) using npm
Created a new project using command tronbox init
In file tronbox.js I've updated the compiler version to 0.4.25 (see the file below).
When compiling using the command tronbox compile --compile-all --reset I'm getting:
Windows error:
And then the following message in my terminal:
Error: Error parsing C:/dev/temp/contracts/Migrations.sol: Command failed: tronbox --download-compiler 0.4.25
at checkExecSyncError (child_process.js:575:11)
at execSync (child_process.js:612:13)
at getWrapper (C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\TronSolc.js:1:1717)
at Object.parseImports (C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Compile\parser.js:1:2345)
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Compile\profiler.js:1:4981
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\index.js:1:1727
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\node_modules\async\internal\onlyOnce.js:12:16
at next (C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\node_modules\async\whilst.js:68:18)
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\index.js:1:1495
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\fs.js:1:1685
I added this line to the top of my tronbox.js file:
console.log('Running tronbox compile');
and noticed that once compiling the output is written twice on my screen:
I'm not sure it relates but for some reason, it runs twice.
Any idea? Is this a tronbox issue?
const port = process.env.HOST_PORT || 9090
module.exports = {
networks: {
mainnet: {
// Don't put your private key here:
privateKey: process.env.PRIVATE_KEY_MAINNET,
/*
Create a .env file (it must be gitignored) containing something like
export PRIVATE_KEY_MAINNET=4E7FECCB71207B867C495B51A9758B104B1D4422088A87F4978BE64636656243
Then, run the migration with:
source .env && tronbox migrate --network mainnet
*/
userFeePercentage: 100,
feeLimit: 1e8,
fullHost: 'https://api.trongrid.io',
network_id: '1'
},
shasta: {
privateKey: process.env.PRIVATE_KEY_SHASTA,
userFeePercentage: 50,
feeLimit: 1e8,
fullHost: 'https://api.shasta.trongrid.io',
network_id: '2'
},
nile: {
privateKey: process.env.PRIVATE_KEY_NILE,
fullNode: 'https://httpapi.nileex.io/wallet',
solidityNode: 'https://httpapi.nileex.io/walletsolidity',
eventServer: 'https://eventtest.nileex.io',
network_id: '3'
},
development: {
// For trontools/quickstart docker image
privateKey: 'da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0',
userFeePercentage: 0,
feeLimit: 1e8,
fullHost: 'http://127.0.0.1:' + port,
network_id: '9'
},
compilers: {
solc: {
version: '0.4.25'
}
}
}
}
This seems like a regression bug in tronbox 2.7.4 and 2.7.5 since when I use tronbox 2.5.2 everything works smoothly.

SSL Error: Handshake failed with fatal error - Querying fabric-sdk-rest server on a Fabric Network with TLS enabled

I started a Multi-Host Fabric Network usind docker swarm made up of 1 CA-server, 1 Orderer, 2 Peers (both in Org1, one on PC1 and one on PC2), 2 CouchBD (one for each Peer) with fabric-sdk-rest running on PC2.
Now if I disable TLS in the Fabric Network, everything works fine. But if i enable the TLS in the network, the SDK cannot connect to the peers failing to query.
Here I show the configuration of the network and the fabric-sdk-rest:
(crypto-config.yaml)
OrdererOrgs:
- Name: Orderer
Domain: example.com
Specs:
- Hostname: orderer
PeerOrgs:
- Name: Org1
Domain: org1.example.com
Template:
Count: 2
Users:
Count: 0
(datasources.json)
{
"db": {
"name": "db",
"connector": "memory"
},
"fabricDataSource": {
"name": "fabricDataSource",
"connector": "fabric",
"keyStoreFile": "/tmp/fabricSDKStore",
"fabricUser": {
"username": "Admin#org1.example.com",
"mspid": "Org1MSP",
"cryptoContent": {
"privateKey":"$HOME/mynetwork/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/keystore/KEY_sk",
"signedCert":"$HOME/mynetwork/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/signcerts/Admin#org1.example.com-cert.pem"
}
},
"COMMENT_orgs":"Referenced by peers to avoid having to configure the same file location multiple times. Change CACertFile locations for your fabric",
"orgs": [
{ "name":"org1", "CACertFile":"$HOME/mynetwork/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem"}
],
"COMMENT_peers" : "Configured array is for use with the fabric-sample when running it in a local docker set up. eventURL and publicCertFile not currently used.",
"peers": [
{ "requestURL":"grpcs://peer1.org1.example.com:7051", "eventURL":"grpcs://peer1.org1.example.com:7053", "orgIndex":"0", "publicCertFile":"$HOME/mynetwork/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp/signcerts/peer1.org1.example.com-cert.pem", "hostname":"peer1" }
],
"COMMENT_peers_secure" : "UNUSED. This is a copy of the above with grpcs URLs. Replace peers content with this if grpcs urls are needed.",
"peers-secure": [
{ "requestURL":"grpcs://peer1.org1.example.com:7051", "eventURL":"grpcs://peer1.org1.example.com:7053", "orgIndex":"0", "publicCertFile":"$HOME/mynetwork/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp/signcerts/peer1.org1.example.com-cert.pem", "hostname":"peer1" }
],
"orderers": [
{ "url":"grpcs://orderer.example.com:7050", "CACertFile":"$HOME/mynetwork/crypto-config/ordererOrganizations/example.com/ca/ca.example.com-cert.pem", "publicCertFile": "$HOME/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/orderer.example.com-cert.pem", "hostname":"orderer"}
],
"COMMENT_orderers_secure" : "UNUSED. This is a copy of the above with grpcs URLs. Replace orderers content with this if grpcs urls are needed.",
"orderers-secure": [
{ "url":"grpcs://orderer.example.com:7050", "CACertFile":"$HOME/mynetwork/crypto-config/ordererOrganizations/example.com/ca/ca.example.com-cert.pem", "publicCertFile": "$HOME/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/orderer.example.com-cert.pem", "hostname":"orderer"}
],
"COMMENT_channels":"fabric-sdk-node Client class requires channel information to be configured during bootstrap.",
"channels": [
{ "name":"mychannel", "peersIndex":[0], "orderersIndex":[0] }
],
"channels-first-network": [
{ "name":"mychannel", "peersIndex":[0,1,2,3], "orderersIndex":[0] }
]
}
}
Once started the Hyperledger Fabric SDK REST server at https://0.0.0.0:3000, when I try to make the GET channels query from the explorer, I get the following error:
error: [fabricconnector.js]: Failed to queryChannels: Error: 14 UNAVAILABLE: Connect Failed
Error not handled for the GET request /api/fabric/1_0/channels: Error: 14 UNAVAILABLE: Connect Failed
at Object.exports.createStatusError ($HOME/mynetwork/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/grpc/src/common.js:87:15)
at Object.onReceiveStatus ($HOME/mynetwork/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/grpc/src/client_interceptors.js:1214:28)
at InterceptingListener._callNext ($HOME/mynetwork/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/grpc/src/client_interceptors.js:590:42)
at InterceptingListener.onReceiveStatus ($HOME/mynetwork/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/grpc/src/client_interceptors.js:640:8)
at callback ($HOME/mynetwork/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/grpc/src/client_interceptors.js:867:24)
E0510 10:51:04.780559355 12247 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
Has anyone ever seen this error? Can anyone help me get through this, please?

Apache Beam on Cloud Dataflow - Failed to query Cadvisor

I have a cloud dataflow that is reading from a Pub/Sub and pushing data out to BQ. Recently the dataflow is reporting the error below and not writing any data to BQ.
{
insertId: "3878608796276796502:822931:0:1075"
jsonPayload: {
line: "work_service_client.cc:490"
message: "gcpnoelevationcall-01211413-b90e-harness-n1wd Failed to query CAdvisor at URL=<IPAddress>:<PORT>/api/v2.0/stats?count=1, error: INTERNAL: Couldn't connect to server"
thread: "231"
}
labels: {
compute.googleapis.com/resource_id: "3878608796276796502"
compute.googleapis.com/resource_name: "gcpnoelevationcall-01211413-b90e-harness-n1wd"
compute.googleapis.com/resource_type: "instance"
dataflow.googleapis.com/job_id: "2018-01-21_14_13_45"
dataflow.googleapis.com/job_name: "gcpnoelevationcall"
dataflow.googleapis.com/region: "global"
}
logName: "projects/poc/logs/dataflow.googleapis.com%2Fshuffler"
receiveTimestamp: "2018-01-21T22:41:40.053806623Z"
resource: {
labels: {
job_id: "2018-01-21_14_13_45"
job_name: "gcpnoelevationcall"
project_id: "poc"
region: "global"
step_id: ""
}
type: "dataflow_step"
}
severity: "ERROR"
timestamp: "2018-01-21T22:41:39.524005Z"
}
Any ideas, on how could I help this? Has anyone faced a similar issue before?
If this just happened once it could be attributed to a transient issue. The process running on the worker node can't reach cAdvisor. Either the cAdvisor container is not running or there is a temporal problem on the worker that can't contact cAdvisor and the job gets stuck.