Correct bugs during bootstrap
1. Ensure Zookeeper restarts and checks out successfully before proceeding with other steps. 2. Make sure PVC itself doesn't start prematurely.
This commit is contained in:
		| @@ -18,6 +18,10 @@ | ||||
| - name: initialize a fresh PVC cluster | ||||
|   command: pvc -c local task init -y | ||||
|  | ||||
| - name: wait 5s for cluster to stabilize | ||||
|   pause: | ||||
|     seconds: 5 | ||||
|  | ||||
| - name: stop the API daemon | ||||
|   service: | ||||
|     name: pvcapid.service | ||||
|   | ||||
| @@ -53,6 +53,7 @@ | ||||
| - name: enable daemon services but don't start them | ||||
|   service: | ||||
|     name: "{{ item }}" | ||||
|     state: stopped | ||||
|     enabled: yes | ||||
|   with_items: | ||||
|     - pvc-flush.service | ||||
|   | ||||
							
								
								
									
										13
									
								
								roles/pvc/tasks/zookeeper/bootstrap.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								roles/pvc/tasks/zookeeper/bootstrap.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| --- | ||||
| - name: restart Zookeeper on all nodes | ||||
|   service: | ||||
|     name: zookeeper | ||||
|     state: restarted | ||||
|  | ||||
| - name: wait 10s for cluster to stabilize | ||||
|   pause: | ||||
|     seconds: 10 | ||||
|  | ||||
| - name: ensure Zookeeper is running on node1 | ||||
|   shell: echo "ls /" | /usr/share/zookeeper/bin/zkCli.sh | ||||
|   when: ansible_local.host_id == 1 | ||||
| @@ -42,4 +42,7 @@ | ||||
|   with_items: | ||||
|     - zookeeper | ||||
|  | ||||
| - include: zookeeper/bootstrap.yml | ||||
|   when: bootstrap is defined and bootstrap | ||||
|  | ||||
| - meta: flush_handlers | ||||
|   | ||||
		Reference in New Issue
	
	Block a user