This is an automated email from the ASF dual-hosted git repository.
junchao pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/incubator-resilientdb.git
The following commit(s) were added to refs/heads/release by this push:
new 64a49811 add change port
64a49811 is described below
commit 64a498117c4343f48eaddc78c4fd9df0a10b99ee
Author: cjcchen <[email protected]>
AuthorDate: Sun Dec 8 04:21:22 2024 +0000
add change port
---
README.md | 17 ++++++
scripts/deploy/script/generate_config.sh | 7 ++-
.../tools/config}/generate_config.sh | 20 +++++--
service/tools/config/interface/service.config | 3 +-
service/tools/config/server/server.config | 62 +++++++++------------
service/tools/data/cert/cert_1.cert | Bin 166 -> 167 bytes
service/tools/data/cert/cert_2.cert | 8 +--
service/tools/data/cert/cert_3.cert | 6 +-
service/tools/data/cert/cert_4.cert | 6 +-
service/tools/data/cert/cert_5.cert | 7 +--
service/tools/kv/server_tools/generate_config.sh | 15 +++++
11 files changed, 93 insertions(+), 58 deletions(-)
diff --git a/README.md b/README.md
index 9bae516d..050ccf35 100644
--- a/README.md
+++ b/README.md
@@ -338,3 +338,20 @@ We also provide access to a [deployment
script](https://github.com/resilientdb/r
```
Verify the functionality of the service by performing set and get
operations provided above [functions](README.md#functions).
+
+
+## Custom Port ##
+When starting the service locally, current services are running on 10000
port-base with 5 services where the server config is located
[here](https://github.com/apache/incubator-resilientdb/blob/master/service/tools/config/server/server.config)
+
+If you want to change the setting, you need to generate the certificates.
+
+Go the the workspace where the resilientdb repo is localted.
+
+Change the setting parameters here and run the script:
+ ./service/tools/kv/server_tools/generate_config.sh
+
+Then re-run the start script:
+ ./service/tools/kv/server_tools/start_kv_service.sh
+
+
+
diff --git a/scripts/deploy/script/generate_config.sh
b/scripts/deploy/script/generate_config.sh
index 5df2396f..c3a731ab 100755
--- a/scripts/deploy/script/generate_config.sh
+++ b/scripts/deploy/script/generate_config.sh
@@ -21,6 +21,8 @@ key_path=$1; shift
output_cert_path=$1; shift
output_path=$1; shift
admin_key_path=$1; shift
+client_num=$1; shift
+base_port=$1; shift
iplist=$@
@@ -41,8 +43,9 @@ CERT_TOOLS_BIN=${base_path}/bazel-bin/tools/certificate_tools
CONFIG_TOOLS_BIN=${base_path}/bazel-bin/tools/generate_region_config
USERNAME=ubuntu
-BASE_PORT=17000
-CLIENT_NUM=1
+BASE_PORT=${base_port}
+CLIENT_NUM=${client_num}
+
echo "" > client.config
echo "" > server.config
diff --git a/scripts/deploy/script/generate_config.sh
b/service/tools/config/generate_config.sh
similarity index 84%
copy from scripts/deploy/script/generate_config.sh
copy to service/tools/config/generate_config.sh
index 5df2396f..8d493c55 100755
--- a/scripts/deploy/script/generate_config.sh
+++ b/service/tools/config/generate_config.sh
@@ -21,6 +21,8 @@ key_path=$1; shift
output_cert_path=$1; shift
output_path=$1; shift
admin_key_path=$1; shift
+client_num=$1; shift
+base_port=$1; shift
iplist=$@
@@ -41,8 +43,9 @@ CERT_TOOLS_BIN=${base_path}/bazel-bin/tools/certificate_tools
CONFIG_TOOLS_BIN=${base_path}/bazel-bin/tools/generate_region_config
USERNAME=ubuntu
-BASE_PORT=17000
-CLIENT_NUM=1
+BASE_PORT=${base_port}
+CLIENT_NUM=${client_num}
+
echo "" > client.config
echo "" > server.config
@@ -57,12 +60,16 @@ do
tot=$(($tot+1))
done
+echo $PWD
echo "node num:"$tot
+echo "base port:"${BASE_PORT}
+echo "client num:" ${CLIENT_NUM}
for ip in ${iplist[@]};
do
port=$((${BASE_PORT}+${idx}))
- public_key=${key_path}/node_${idx}.key.pub
+ public_key=${key_path}/node${idx}.key.pub
+ echo "get ip:"${ip}
# create public key
# create server config
@@ -78,5 +85,8 @@ do
idx=$(($idx+1))
done
-python3 ${CONFIG_TOOLS_BIN} ./server.config ./server.config.json
../config/template.config
-mv server.config.json server.config
+python3 ${CONFIG_TOOLS_BIN} ./server.config ./server.config.json
+mv server.config.json ${output_path}/server/server.config
+mv client.config ${output_path}/interface/service.config
+echo "config done:" ${output_path}/server/server.config
+
diff --git a/service/tools/config/interface/service.config
b/service/tools/config/interface/service.config
index d357ba73..2214ed91 100644
--- a/service/tools/config/interface/service.config
+++ b/service/tools/config/interface/service.config
@@ -1,3 +1,2 @@
-5 127.0.0.1 10005
-
+5 127.0.0.1 20005
diff --git a/service/tools/config/server/server.config
b/service/tools/config/server/server.config
index b9e57d18..1cf8416f 100644
--- a/service/tools/config/server/server.config
+++ b/service/tools/config/server/server.config
@@ -1,36 +1,28 @@
{
- region : {
- replica_info : {
- id:1,
- ip:"127.0.0.1",
- port: 10001,
- },
- replica_info : {
- id:2,
- ip:"127.0.0.1",
- port: 10002,
- },
- replica_info : {
- id:3,
- ip:"127.0.0.1",
- port: 10003,
- },
- replica_info : {
- id:4,
- ip:"127.0.0.1",
- port: 10004,
- },
- region_id: 1,
- },
- self_region_id:1,
- leveldb_info : {
- write_buffer_size_mb:128,
- write_batch_size:1,
- },
- require_txn_validation:true,
- enable_viewchange:false,
- enable_resview:true,
- enable_faulty_switch:false
-}
-
-
+ "region": [
+ {
+ "replicaInfo": [
+ {
+ "id": "1",
+ "ip": "127.0.0.1",
+ "port": 20001
+ },
+ {
+ "id": "2",
+ "ip": "127.0.0.1",
+ "port": 20002
+ },
+ {
+ "id": "3",
+ "ip": "127.0.0.1",
+ "port": 20003
+ },
+ {
+ "id": "4",
+ "ip": "127.0.0.1",
+ "port": 20004
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/service/tools/data/cert/cert_1.cert
b/service/tools/data/cert/cert_1.cert
index cb2ffd01..a0a6ede6 100644
Binary files a/service/tools/data/cert/cert_1.cert and
b/service/tools/data/cert/cert_1.cert differ
diff --git a/service/tools/data/cert/cert_2.cert
b/service/tools/data/cert/cert_2.cert
index 81b87435..d69a4a49 100644
--- a/service/tools/data/cert/cert_2.cert
+++ b/service/tools/data/cert/cert_2.cert
@@ -1,7 +1,7 @@
$
- u>��,����Nb+R�m����.�dQ|;V;݅|
-6
+ u>��,����Nb+R�m����.�dQ|;V;݅}
+7
$
- ���Ej�K'=��zp�@r����E�����"
127.0.0.1(�NB@,'�GJ�|�R;�'��m@�:�#9�ĝ�'[� J��Z}_��,��Iʟ9'n)%�
-�n|G
\ No newline at end of file
+ ���Ej�K'=��zp�@r����E�����" 127.0.0.1(��B@Ol�
+Ɖ瀥5��&eJ�X�B��O.kP��'y�ᆰy�:�k��I}m���=�.��5�$�
\ No newline at end of file
diff --git a/service/tools/data/cert/cert_3.cert
b/service/tools/data/cert/cert_3.cert
index f7f81121..58899e57 100644
--- a/service/tools/data/cert/cert_3.cert
+++ b/service/tools/data/cert/cert_3.cert
@@ -1,7 +1,7 @@
$
- u>��,����Nb+R�m����.�dQ|;V;݅|
-6
+ u>��,����Nb+R�m����.�dQ|;V;݅}
+7
$
|�a9� #��Y��<g�6_��"g!M���
-��" 127.0.0.1(�NB@;�/��U����r1ޡ��Tf�x�Xy�Kl�V�xf��A�
��Y���N�18��-iO�N
\ No newline at end of file
+��" 127.0.0.1(��B@�X8!�$E�^ݶlR�l(I�.�ۛ] I�D��J!LPT�3�
��"4��)�ЯŴ�#ޝ(��*
\ No newline at end of file
diff --git a/service/tools/data/cert/cert_4.cert
b/service/tools/data/cert/cert_4.cert
index cef16d63..db03281a 100644
--- a/service/tools/data/cert/cert_4.cert
+++ b/service/tools/data/cert/cert_4.cert
@@ -1,6 +1,6 @@
$
- u>��,����Nb+R�m����.�dQ|;V;݅|
-6
+ u>��,����Nb+R�m����.�dQ|;V;݅}
+7
$
- {aLx2٢�<�jQf+S�b���±��2"
127.0.0.1(�NB@N�뀒�U�U����zi�W�}2Ub����X����1&�I��5�>=��y��{�6]g�w��
\ No newline at end of file
+ {aLx2٢�<�jQf+S�b���±��2"
127.0.0.1(��B@Y�)X��>�~l(}�Z������{���yqa���YX^���0$N'C"Tz��}��\-��
\ No newline at end of file
diff --git a/service/tools/data/cert/cert_5.cert
b/service/tools/data/cert/cert_5.cert
index b04bf7a9..a1ebad5a 100644
--- a/service/tools/data/cert/cert_5.cert
+++ b/service/tools/data/cert/cert_5.cert
@@ -1,8 +1,7 @@
$
- u>��,����Nb+R�m����.�dQ|;V;݅~
-8
+ u>��,����Nb+R�m����.�dQ|;V;݅
+9
$
�H��Y
-1����hܘ�hT�]%%ey��V" 127.0.0.1(�NB@P���$4�����L
v�t��`�#�+g��X�7i
-��L]൮!���]k!d{q�����P�
\ No newline at end of file
+1����hܘ�hT�]%%ey��V" 127.0.0.1(��B@! VH`� NTô0
��1�o�N9��PT�j�k��|���U�U���t��@&��n�}*�W�
\ No newline at end of file
diff --git a/service/tools/kv/server_tools/generate_config.sh
b/service/tools/kv/server_tools/generate_config.sh
new file mode 100755
index 00000000..300d8376
--- /dev/null
+++ b/service/tools/kv/server_tools/generate_config.sh
@@ -0,0 +1,15 @@
+iplist=(
+127.0.0.1
+127.0.0.1
+127.0.0.1
+127.0.0.1
+127.0.0.1
+)
+
+WORKSPACE=$PWD
+CERT_PATH=$PWD/service/tools/data/cert/
+CONFIG_PATH=$PWD/service/tools/config/
+PORT_BASE=20000
+CLIENT_NUM=1
+
+./service/tools/config/generate_config.sh ${WORKSPACE} ${CERT_PATH}
${CERT_PATH} ${CONFIG_PATH} ${CERT_PATH} ${CLIENT_NUM} ${PORT_BASE}
${iplist[@]}