I
I
Ivan Shysterov2020-07-21 21:06:28
PHP
Ivan Shysterov, 2020-07-21 21:06:28

Need help running rpc-proxy in kphp-kdb?

Having proved no on the engine https://github.com/vk-com/kphp-kdb/tree/master/rpc...
Create a binlog:

/usr/local/src/kphp-kdb/scripts/create_binlog.sh 0xf9a90101 1 0 > /var/lib/engine/rpc.bin

Permissions:
chown -R kitten:kitten /var/lib/engine/
Config for rpc-proxy:
1. engine.rpc.conf file:
execute rpc-proxy
arg1 /etc/engine/clusterrpc.conf
-p 11259
-a rpc
-y 300
-vvv

2. cluster config:
file /etc/engine/clusterrpc.conf
cluster_text {
proto tcp;
server 127.0.0.1:11200;
schema text;
min_connections 1;
max_connections 1000;
timeout 1000;
#step 0;
new_id 1;
extension firstint;
#extension clear_flags;
#extension skip_response_inderect;
#extension points;
#extension secure_send;
#extension secure_receive;
#extension double_send;
#extension double_receive;
#extension secondint;
#extension_params ;
#mode firstint;
}
cluster_lists {
id 123;
proto tcp;
server 127.0.0.1:11201;
# [email protected]:11202
schema lists;
min_connections 1;
max_connections 1000;
timeout 1000;
new_id 11;
extension firstint;
}

We start rpc-engine - it starts, starts pinging the cluster servers, responds to its requests (from combined.tl) on port 11259 with the following content:
$rpcMsg[]=array('rpcProxy.getClusters');
$rpcMsg[]=array('rpcProxy.getClusterSize',0);
$rpcMsg[]=array('rpcProxy.getClusterServers',0);
$rpcMsg[]=array('rpcProxy.getClusterServers',123);

НО, если отправить на порт 11259 запрос к text-engine вида:
$rpcMsg[]=array('text.sendMessage', $uid,
(1 « 4) + (1 « 5) + (1 « 7) ,# text, flags, peer_id
array(
'text' => 'сообщение привет ололо ',
'flags' => $flags,
'peer_id' => $peer_id
)
)

then the request is NOT forwarded where necessary, and the response is:
Array
(
[0] => Array
(
[__error] => Can not find working connection to target
[__error_code] => -3002
)

)

In the logs for this request, there is such a line: Forward methods failed.
There are no docks on rpc-proxy, the config was made by examining the sources, most likely they missed some parameters, so the engine does not understand where to send requests.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question