Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions kubernetes/createYaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,36 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then

echo "Create yaml files done"

sleep 40s

numberOfRnningPods="foo"
numberOfAllPods="bar"

while [ "$numberOfRnningPods" != "$numberOfAllPods" ];
do
sleep 10s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yanmo96 Why we still need to wait 10s here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It checks the status every 10s

numberOfRnningPods=$(kubectl get pods -A --field-selector=status.phase=Running | wc -l)
numberOfAllPods=$(kubectl get pods -A | wc -l)
echo "numberOfRnningPods: " "$numberOfRnningPods"
echo "numberOfAllPods: " "$numberOfAllPods"
done

kubectl exec -it ignite-alcor-0 -n ignite-alcor -c ignite-alcor-node -- /opt/ignite/apache-ignite/bin/control.sh --activate

sleep 10s

kubectl exec -it ignite-alcor-ip-0 -n ignite-alcor-ip -c ignite-alcor-ip-node -- /opt/ignite/apache-ignite/bin/control.sh --activate

sleep 10s

kubectl exec -it ignite-alcor-mac-0 -n ignite-alcor-mac -c ignite-alcor-mac-node -- /opt/ignite/apache-ignite/bin/control.sh --activate
kubectl exec -it ignite-alcor-port-0 -n ignite-alcor-port -c ignite-alcor-port-node -- /opt/ignite/apache-ignite/bin/control.sh --activate

sleep 10s

kubectl exec -it ignite-alcor-port-0 -n ignite-alcor-port -c ignite-alcor-port-node -- /opt/ignite/apache-ignite/bin/control.sh --activate
#cd apache-ignite/bin/
#./control.sh --activate


echo "ignite cluster has been activated"

for d in services/*.yaml;
do
kubectl create -f $d
echo "Create ignite yaml - $d completed"
echo "Create services yaml - $d completed"
done

echo "ignite cluster has been activated"
echo "Cluster has been created"

elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Install prerequisites in Mac OSX"
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/db/ignite/ignite_alcor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
- name: OPTION_LIBS
value: ignite-kubernetes,ignite-rest-http
- name: CONFIG_URI
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/services/ignite_config.xml
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/db/ignite/ignite_config.xml
- name: IGNITE_QUIET
value: "false"
- name: JVM_OPTS
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/db/ignite/ignite_alcor_ip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
- name: OPTION_LIBS
value: ignite-kubernetes,ignite-rest-http
- name: CONFIG_URI
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/services/ignite_ip_config.xml
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/db/ignite/ignite_ip_config.xml
- name: IGNITE_QUIET
value: "false"
- name: JVM_OPTS
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/db/ignite/ignite_alcor_mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
- name: OPTION_LIBS
value: ignite-kubernetes,ignite-rest-http
- name: CONFIG_URI
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/services/ignite_mac_config.xml
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/db/ignite/ignite_mac_config.xml
- name: IGNITE_QUIET
value: "false"
- name: JVM_OPTS
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/db/ignite/ignite_alcor_port.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ spec:
- name: OPTION_LIBS
value: ignite-kubernetes,ignite-rest-http
- name: CONFIG_URI
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/services/ignite_port_config.xml
value: https://raw.githubusercontent.com/futurewei-cloud/alcor/master/kubernetes/db/ignite/ignite_port_config.xml
- name: IGNITE_QUIET
value: "false"
- name: JVM_OPTS
Expand Down
16 changes: 13 additions & 3 deletions scripts/deployK8sClusterService.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,25 @@ chmod +x /root/alcor/kubernetes/deleteYaml.sh

cd /root
echo "***** Download and build images on each Node *****" 2>&1 | tee -a ~/alcor_logs/alcor.log
./deploy-alcor-nodes.sh update-alcor4.sh alcor-nodes-ips
./deploy-alcor-nodes.sh update-alcor.sh alcor-nodes-ips

echo "***** Deploy Aclor Cluster *****" 2>&1 | tee -a ~/alcor_logs/alcor.log
cd /root/alcor/kubernetes/
chmod +x /root/alcor/kubernetes/createYaml.sh
/root/alcor/kubernetes/createYaml.sh 2>&1 | tee -a ~/alcor_logs/alcor.log
cd /root

sleep 30s
numberOfRnningPods="foo"
numberOfAllPods="bar"

while [ "$numberOfRnningPods" != "$numberOfAllPods" ];
do
sleep 10s
numberOfRnningPods=$(kubectl get pods -A --field-selector=status.phase=Running | wc -l)
numberOfAllPods=$(kubectl get pods -A | wc -l)
echo "$numberOfRnningPods"
echo "$numberOfAllPods"
done

echo "***** Alcor Microservices Status *****" 2>&1 | tee -a ~/alcor_logs/alcor.log
kubectl get pods -A 2>&1 | tee -a ~/alcor_logs/alcor.log
Expand All @@ -43,4 +53,4 @@ echo "***** Create Segments *****" 2>&1 | tee -a ~/alcor_logs/alcor.log
curl -X POST -H "Content-Type: application/json" -H "Accept: */*" "http://localhost:30001/segments/createDefaultTable" 2>&1 | tee -a ~/alcor_logs/alcor.log

echo "***** Register Nodes *****" 2>&1 | tee -a ~/alcor_logs/alcor.log
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@medina-nodes.json" "http://localhost:30007/nodes/upload" 2>&1 | tee -a ~/alcor_logs/alcor.log
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@medina-nodes.json" "http://localhost:30007/nodes/upload" 2>&1 | tee -a ~/alcor_logs/alcor.log