Installation Environment Vmware Workstation pro It is recommended to use the snapshot to store the state of each installation stage to avoid installation failures and causing the installation to start from scratch. Ubuntu 22.04 windows 11 Hardware settings create 3 VM: 4 cores and 4G memory and 100G capacity Before installing K8s (All use the root user) set host: 192.168.47.135 master 192.168.47.131 node1 192.168.47.132 node2 set root ssh connection: sudo su - echo "PermitRootLogin yes" >> /etc/ssh/sshd_config systemctl restart sshd sudo passwd ssh-keygen for i in {master,node1,node2}; do ssh-copy-id root@$i; done set Ipvs and conf create conf file: for i in {master,node1,node2}; do ssh root@$i 'cat << EOF > /etc/modules-load.d/containerd.conf overlay br_netfilter EOF'; done execute conf: for i in {master,node1,node2}; do ssh root@$i 'modprobe overlay;modprobe br_netfilter;'; done create 99-kubernetes-cri.conf file: for i in {master,node1,
A set of the blocked processes each holding some resources and waiting to acquire a resource held by another process in the set.
Necessary conditions
All four conditions must hold for possible deadlock:
- Mutual exclusion:
- Only 1 process at a time can use a resource.
- Hold and wait:
- A process holding some resources is waiting for another resource
- No preemption:
- A resource can be only released by a process voluntarily.
- Circular wait:
- There exists a set {P0,P1…} of waiting processes such that
- P0 -> P1 -> P2 …..Pn -> P0
Handling Deadlocks
- Ensure the system will never enter a deadlock state.
- Deadlock prevention: ensure that at least one of the 4 necessary conditions cannot hold.
- Deadlock avoidance: dynamically examines the resources allocation state before allocation.
- Allow to enter a deadlock state and then recover.
- Deadlock detection.
- Deadlock recovery.
- Ignore the problem and pretend that deadlock never occurs in the system.
- Use by most operating systems, including UNIX…
Avoidance algorithms
- A single instance of the resource type.
- Resource-allocation graph(RAG) algorithm based on circle detection.
- Multiple instances of the resource type.
- Banker's algorithm is based on safe sequence detection.
Deadlock Detection
Single instance of each resource type.
- Convert request/assignment edges into wait-for graph
- Deadlock exists if there is a cycle in the wait-for graph
Deadlock Recovery
- Process termination.
- Resource preemption.
reference:
https://www.amazon.com/-/zh_TW/Operating-System-Concepts-Abraham-Silberschatz/dp/1119800366/ref=sr_1_1?keywords=Operating-System-Concepts&qid=1669538704&s=books&sr=1-1
留言
張貼留言