<commit_before>#!/bin/bash

CMD_PATH=.
DST_PATH=./conf_orig
CONF_DEPLOY_DIR=./conf_deploy
RUN_DATE=$1
MY_LOCALE=$($CMD_PATH/get-conf-data.sh ./locale.txt LOCALE)
if [ $MY_LOCALE = 'CN' ]; then
    source ./locale_cn.txt
else
    source ./locale_en.txt
fi

#Start controller nodes installation
echo $STR_BEGIN_CONTROLLER_NODES_INSTALL

#Get all controller nodes IPs
declare -a G_CONTROLLER_NODE_IPS
MY_INDEX=0
for IP in $(cat $CONF_DEPLOY_DIR/Controller-Nodes-IPs.txt); do
    G_CONTROLLER_NODE_IPS[$MY_INDEX]=$IP
    ((MY_INDEX++))
done

#Process controller-node-install-part-1 on controller node 1
echo $CTL_INSTALL_PART_1_ON_CTL_1
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[0]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-1.sh $RUN_DATE-controller-node-install-part-1-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-1 on controller node 2
echo $CTL_INSTALL_PART_1_ON_CTL_2
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[1]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-1.sh $RUN_DATE-controller-node-install-part-1-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-1 on controller node 3
echo $CTL_INSTALL_PART_1_ON_CTL_3
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[2]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-1.sh $RUN_DATE-controller-node-install-part-1-$IP.log
$CMD_PATH/check-screen-ended.sh

#Sync /var/lib/rabbitmq/.erlang.cookie
ssh root@${G_CONTROLLER_NODE_IPS[1]} "rm -f /var/lib/rabbitmq/.erlang.cookie"
ssh root@${G_CONTROLLER_NODE_IPS[2]} "rm -f /var/lib/rabbitmq/.erlang.cookie"
rsync -va root@${G_CONTROLLER_NODE_IPS[0]}:/var/lib/rabbitmq/.erlang.cookie $CMD_PATH/
rsync -va $CMD_PATH/.erlang.cookie root@${G_CONTROLLER_NODE_IPS[1]}:/var/lib/rabbitmq/
rsync -va $CMD_PATH/.erlang.cookie root@${G_CONTROLLER_NODE_IPS[2]}:/var/lib/rabbitmq/

#Process controller-node-install-part-2 on controller node 1
echo $CTL_INSTALL_PART_2_ON_CTL_1
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[0]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-2.sh $RUN_DATE-controller-node-install-part-2-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-2 on controller node 2
echo $CTL_INSTALL_PART_2_ON_CTL_2
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[1]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-2.sh $RUN_DATE-controller-node-install-part-2-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-2 on controller node 3
echo $CTL_INSTALL_PART_2_ON_CTL_3<commit_msg>sync .erlang.cookie<commit_after>#!/bin/bash

CMD_PATH=.
DST_PATH=./conf_orig
CONF_DEPLOY_DIR=./conf_deploy
RUN_DATE=$1
MY_LOCALE=$($CMD_PATH/get-conf-data.sh ./locale.txt LOCALE)
if [ $MY_LOCALE = 'CN' ]; then
    source ./locale_cn.txt
else
    source ./locale_en.txt
fi

#Start controller nodes installation
echo $STR_BEGIN_CONTROLLER_NODES_INSTALL

#Get all controller nodes IPs
declare -a G_CONTROLLER_NODE_IPS
MY_INDEX=0
for IP in $(cat $CONF_DEPLOY_DIR/Controller-Nodes-IPs.txt); do
    G_CONTROLLER_NODE_IPS[$MY_INDEX]=$IP
    ((MY_INDEX++))
done

#Process controller-node-install-part-1 on controller node 1
echo $CTL_INSTALL_PART_1_ON_CTL_1
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[0]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-1.sh $RUN_DATE-controller-node-install-part-1-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-1 on controller node 2
echo $CTL_INSTALL_PART_1_ON_CTL_2
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[1]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-1.sh $RUN_DATE-controller-node-install-part-1-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-1 on controller node 3
echo $CTL_INSTALL_PART_1_ON_CTL_3
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[2]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-1.sh $RUN_DATE-controller-node-install-part-1-$IP.log
$CMD_PATH/check-screen-ended.sh

#Sync /var/lib/rabbitmq/.erlang.cookie
ssh root@${G_CONTROLLER_NODE_IPS[1]} "rm -f /var/lib/rabbitmq/.erlang.cookie"
ssh root@${G_CONTROLLER_NODE_IPS[2]} "rm -f /var/lib/rabbitmq/.erlang.cookie"
rsync -va root@${G_CONTROLLER_NODE_IPS[0]}:/var/lib/rabbitmq/.erlang.cookie $CMD_PATH/
rsync -va $CMD_PATH/.erlang.cookie root@${G_CONTROLLER_NODE_IPS[1]}:/var/lib/rabbitmq/
rsync -va $CMD_PATH/.erlang.cookie root@${G_CONTROLLER_NODE_IPS[2]}:/var/lib/rabbitmq/
ssh root@${G_CONTROLLER_NODE_IPS[1]} "chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie"
ssh root@${G_CONTROLLER_NODE_IPS[2]} "chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie"

#Process controller-node-install-part-2 on controller node 1
echo $CTL_INSTALL_PART_2_ON_CTL_1
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[0]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-2.sh $RUN_DATE-controller-node-install-part-2-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-2 on controller node 2
echo $CTL_INSTALL_PART_2_ON_CTL_2
screen -dmS niu -U -t sleeping $CMD_PATH/sleep-x-seconds.sh 10
$CMD_PATH/check-screen-started.sh
IP=${G_CONTROLLER_NODE_IPS[1]}
screen   -S niu -U -X screen   -U -t $IP $CMD_PATH/run-on-node.expect $IP controller-node-install-part-2.sh $RUN_DATE-controller-node-install-part-2-$IP.log
$CMD_PATH/check-screen-ended.sh

#Process controller-node-install-part-2 on controller node 3
echo $CTL_INSTALL_PART_2_ON_CTL_3
{'fraction_non_alphanumeric': 0.13905053598774886, 'fraction_numerical': 0.017457886676875957, 'mean_word_length': 4.749119718309859, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1677113', 'n_tokens_mistral': 2704, 'n_tokens_neox': 2607, 'n_words': 478}