Failed to add a new replica to SiriDB - database

My Set-up
I've started two SiriDB server on the same node, but using different ports:
First server:
server_name: %HOSTNAME:9010
listen_client_port: 9000
http_api_port: 9020
Second server:
server_name: %HOSTNAME:9011
listen_client_port: 9001
http_api_port: 9021
Situation
I've created a new replica using the following curl command:
curl --location --request POST 'http://localhost:9021/new-replica' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c2E6c2lyaQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
"dbname": "dbtest",
"username": "iris",
"password": "siri",
"host": "localhost",
"port": 9000,
"pool": 0
}'
The response from the command above was OK.
But in the server logging I see the following error message:
Connecting to back-end server 'my-hostname-xxx:9010' failed (error: connection refused)
When performing a list servers query, it seems that the servers are not able to find each other:
curl --location --request POST 'http://localhost:9021/query/dbtest' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic aXJpczpzaXJp' \
--header 'Content-Type: text/plain' \
--data-raw '{"q": "list servers"}'
This is the response:
{"columns":["status"],"servers":[["offline"],["running | synchronizing"]]}
I can't find what's wrong, as the servers run on the same host. Therefore, they should be able to find each other right?

Most likely your binding is incorrect. Can you check if this is the case?
By default SiriDB binds only to 127.0.0.1 (localhost) for security reasons.
Since %HOSTNAME is used, it might be so that SiriDB is listening on another interface.
If you are using a configuration file, you probably need to change both bind_server_address and bind_client_address to :: (any).
Note: the same setting can be done using the environment variable SIRIDB_BIND_SERVER_ADDRESS and SIRIDB_BIND_CLIENT_ADDRESS.

Related

How to pass SSL cert and key in Gatling Script

I have to create one script in gatling where I need to pass ssl CERT AND KEY.Curl is in below format.I am not sure how to pass it in my simulation .Can someone please help.
curl -E abc.crt --key cde.key --location --request POST 'https://a/b' \
--header 'Content-Type: application/json'

How to deploy Mule application jar file in Runtime Fabric with Anypoint Runtime Manager REST API without going though Anypoint Exchange

I want deploy a jar file which is availble for me in my pc to RTF Mule server managed by AKS.I want use ARM rest api.
curl --location --request POST 'https://anypoint.mulesoft.com/hybrid/api/v1/applications' \
--header 'x-anypnt-env-id: e21c3d' \
--header 'x-anypnt-org-id: 321d5ac3e' \
--header 'Authorization: Bearer 4f4e0ce1340c29f7baf9' \
--header 'Content-Type: multipart/form-data' \
--header 'Cookie: XSRF-TOKEN=TLy3BYtp-pshrqU42; mulesoft.sess=eyJpeyJ1c2VyX2lkIjoiZmU2YWZlMGQtMTZhZC00NDEwLTk1YTUtNDQ5MzUyZTgwMmUzIn19fQ==; mulesoft.sess.sig=IlvX_h9vp_ijZt_hAh0gM5WXoEs' \
--form 'file=#"/C:/Users/wb587070/AnypointStudio/s7-12-workspace/test-project/target/test-project-5.0.0-dev393-mule-application.jar"' \
--form 'artifactName="test-project"' \
--form 'targetId="30683393-4494-4d21-87c6-be27679ed021"' \
I am using curl to deploy jar file but I am getting "403 forbidden error"
In this knowledge article the application is deployed first to Exchange, and then from Exchange to the Runtime Fabric server. Is there any way by using Anypoint Runtime Manager REST API to deploy application straight to server with out using Exchange
No. Application deployments must go through the Anypoint Exchange repository first.
You can use Anypoint CLI as an alternative to the REST API however it still requires deploying to Exchange first: https://docs.mulesoft.com/anypoint-cli/3.x/runtime-fabric-apps#runtime-mgr-application-deploy

unable to upload csv file in postman using salesforce bulk api 2.0

I am facing problem uploading csv file with postman using bulk api 2.0 basically, I am using Postman, but the csv file doesn't seem to upload correct. however, if I use workbench, it works.
the curl from postman looks like this
curl --location --request PUT 'https://bonuspoint-dev-ed.my.salesforce.com/services/data/v55.0/jobs/ingest/7505g00000CTs5pAAD/batches'
--header 'Accept: application/json'
--header 'X-PrettyPrint: 1'
--header 'Content-Type: text/csv'
--header 'Authorization: Bearer 00D5g000005GHBP!ARUAQJLq22f.uDZXp_cWTaKrVImIPtxkcW3VIxyZ0RNZ_BXG9hBMniPg34ezDUBcDTgB6.K0ropfNKV1w1EFOo4I7OxPxaX_'
--header 'Cookie: BrowserId=k-EBPmwsEeyXmPs9yu0SNQ; CookieConsentPolicy=0:1; LSKey-c$CookieConsentPolicy=0:1'
--data-binary '#uploaddatafile.csv'

Create Environment for Watson Discovery API

I am trying to create an environment to start using my Watson Discovery Service created in Bluemix.
Following the get started documentation I entered this code (in cmd):
curl -X POST -u "{username}":"{password}" -H "Content-Type: application/json" -d '{ "name":"my-first-environment", "description":"exploring environments", "size":0}' "https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2016-12-01"
I made sure I entered the right service credentials but I get this error that I donĀ“t understand:
{ "code" : 401 , "error" : "Not Authorized" , "description" : "2017-05-23T08:53:35-04:00, Error ERCDPLTFRM-INVLDCHR occurred when accessing https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2016-12-01, Tran-Id: gateway-dp02-1408488112 - " }
When I type the link in a browser and enter the credentials manually I don't get any error.
Does some body understand this error and can help me?
Thanks in advance and best Regards
Emira
Are you certain that you are supplying Discovery Service credentials? If you then check that you have the username and password the right way round.
When you access Discovery Service, have some option with the name: Service Credentials.
Replace the username and password with these values.
See one example to access:
curl -X POST -u "USERNAME":"PASSWORD" -H "Content-Type: application/json" -d '{ "name":"my-first-environment", "description":"exploring environments", "size":0}' "https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2016-12-01"
EDIT:
curl -X POST -u "{username}":"{password}" -H "Content-Type: application/json" -d '{ "name": "test_collection", "description": "My test collection", "configuration_id": "{configuration_id}" }' "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/collections?version=2016-12-01"

Payment APIs without server-side requirements

Are there any Payment APIs, preferably in Javascript/Angular that can be directly used on the client side, and thus require no server side implementation?
The best example is Stripe. It both requires setting up the client side (Checkout and retrieval of StripeToken) and then actually processing the payment on the server (Charge).
I found a service that allows you to process Stripe payments without setting up the server-side yourself: Noodlio Pay.
You simply send HTTP requests to the API hosted on Mashape.
Here is an example of a request in cURL:
curl -X POST --include 'https://noodlio-pay.p.mashape.com/charge/token'
\ -H 'X-Mashape-Key: <required>'
\ -H 'Content-Type: application/x-www-form-urlencoded'
\ -H 'Accept: application/json'
\ -d 'amount=100'
\ -d 'currency=usd'
\ -d 'description=Purchase with Noodlio Pay'
\ -d 'source=tok_181ER0E9p71uHfeG90clN2MH'
\ -d 'stripe_account=acct_12abcDEF34GhIJ5K'

Resources