From 7950bc683f439b880c3e65b9dbdaaba42b7b3a9c Mon Sep 17 00:00:00 2001 From: Jiadi Su <20302010043@fudan.edu.cn> Date: Thu, 27 Apr 2023 19:48:02 +0800 Subject: [PATCH] 2023-04-27 meeting --- ...11\350\243\205\346\220\255\345\273\272.md" | 116 ++++++++++++++++++ doc/note/Su/eBPF.md | 2 + ...32\350\256\256\350\256\260\345\275\225.md" | 18 +++ 3 files changed, 136 insertions(+) create mode 100644 "doc/log/Su/k8s_docker\345\256\211\350\243\205\346\220\255\345\273\272.md" diff --git "a/doc/log/Su/k8s_docker\345\256\211\350\243\205\346\220\255\345\273\272.md" "b/doc/log/Su/k8s_docker\345\256\211\350\243\205\346\220\255\345\273\272.md" new file mode 100644 index 0000000..849cb8a --- /dev/null +++ "b/doc/log/Su/k8s_docker\345\256\211\350\243\205\346\220\255\345\273\272.md" @@ -0,0 +1,116 @@ +# k8s与docker安装æå»º + +## docker的安装 + +### 安装过程 + +1ã€åˆ 除旧版本 + +```bash +$ sudo apt-get remove docker docker-engine docker.io containerd runc +``` + +2ã€è®¾ç½®ä»“库 + +æ›´æ–°apt + +```bash +$ sudo apt-get update +``` + +安装ä¾èµ–包 + +```bash +$ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common +``` + +æ·»åŠ Docker官方密钥 + +```bash +$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add - +OK +``` + +验è¯å¯†é’¥ + +```bash +$ apt-key fingerprint 0EBFCD88 +pub rsa4096 2017-02-22 [SCEA] + 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 +uid [ unknown] Docker Release (CE deb) <docker@docker.com> +sub rsa4096 2017-02-22 [S] + +``` + +设置稳定版仓库 + +```bash +$ add-apt-repository \ + "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \ + $(lsb_release -cs) \ + stable" +``` + +3ã€å®‰è£…docker(最新版本) + +```bash +$ sudo apt-get install docker-ce docker-ce-cli containerd.io +``` + +### é‡åˆ°çš„问题 + +"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" + +åŽŸå› æ˜¯docker未å¯åŠ¨ï¼Œä½¿ç”¨å¦‚ä¸‹æŒ‡ä»¤å¯åЍ + +```bash +$ systemctl start docker +``` + +报错:"System has not been booted with systemd as init system (PID 1). Can't operate." + +åŽŸå› æ˜¯ä¸æ˜¯ç”¨`systemctl`ç®¡ç†æœåŠ¡ï¼Œä¿®æ”¹æŒ‡ä»¤ï¼š + +```bash +$ service docker start + * Starting Docker: docker [ OK ] +``` + +å¯åЍåŽå°è¯•è¿è¡Œhello-world容器: + +```bash +$ sudo docker run hello-world + +Unable to find image 'hello-world:latest' locally +latest: Pulling from library/hello-world +1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f +Status: Downloaded newer image for hello-world:latest + + +Hello from Docker! +This message shows that your installation appears to be working correctly. + + +To generate this message, Docker took the following steps: + 1. The Docker client contacted the Docker daemon. + 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. + (amd64) + 3. The Docker daemon created a new container from that image which runs the + executable that produces the output you are currently reading. + 4. The Docker daemon streamed that output to the Docker client, which sent it + to your terminal. + + +To try something more ambitious, you can run an Ubuntu container with: + $ docker run -it ubuntu bash + + +Share images, automate workflows, and more with a free Docker ID: + https://hub.docker.com/ + + +For more examples and ideas, visit: + https://docs.docker.com/get-started/ +``` + +出现如上结果,安装æˆåŠŸã€‚ \ No newline at end of file diff --git a/doc/note/Su/eBPF.md b/doc/note/Su/eBPF.md index f6fcff7..0753127 100644 --- a/doc/note/Su/eBPF.md +++ b/doc/note/Su/eBPF.md @@ -919,6 +919,8 @@ $ clang -v $ llc --version # test iproute2 $ ip link +# libbpf +$ apt-get install libbpf-dev ``` libbpf其实就包括了eBPF程åºä¸å¸¸è§çš„头文件`<bpf/bpf_helpers.h>`ã€`<bpf/bpf_tracing.h>`ç‰ï¼Œåœ¨å®‰è£…好libbpfåŽä¸Šè¿°æ–‡ä»¶ä¼šå‡ºçŽ°åœ¨`/usr/include/bpf`下供使用。 diff --git "a/doc/\344\274\232\350\256\256\350\256\260\345\275\225.md" "b/doc/\344\274\232\350\256\256\350\256\260\345\275\225.md" index 39febab..7550444 100644 --- "a/doc/\344\274\232\350\256\256\350\256\260\345\275\225.md" +++ "b/doc/\344\274\232\350\256\256\350\256\260\345\275\225.md" @@ -93,3 +93,21 @@ 8. 从需求如手的æ€è·¯è½¬ä¸ºä»Žé—®é¢˜å¦‚æ‰‹ï¼Œæž„é€ ä¸€ä¸ªåœºæ™¯ï¼Œé€šè¿‡åœºæ™¯æè¿°é—®é¢˜ï¼›é—®é¢˜ => 需求; 9. 把之å‰å¡ä½çš„地方记录到git仓库上; +### 2023-04-27 19 : 00 + +地点:逸夫楼501 + +主题:交æµé‡åˆ°çš„问题,讨论åŽç»ä¸¤å¤©çš„å¦ä¹ 内容 + +人员:三ä½é˜Ÿå‘˜ + +1. è¿è¡Œ[libbpf-bootstrap](https://github.com/libbpf/libbpf-bootstrap)项目给出的所有示例; +2. è¿è¡Œ[bpf-developer-tutorial](https://github.com/eunomia-bpf/bpf-developer-tutorial)ä¸çš„æ‰€æœ‰ç¤ºä¾‹ï¼ˆå¯ä»¥ç”¨ä¸åŒçš„æ–¹å¼è¿è¡Œï¼Œlibbpf-bootstrap脚手架,eunomia-bpf框架,或者自己clangç¼–è¯‘åŠ è½½éƒ½å¯ä»¥ï¼‰ï¼› +3. 有时间å¯ä»¥ç®€å•跑一下bcc和示例代ç ï¼› +4. 通过上é¢çš„é¡¹ç›®ï¼Œæ˜Žç¡®ä»¥ä¸‹å‡ ä»¶äº‹ï¼š + - kernelæ€çš„bpfç¨‹åºæ€Žä¹ˆç”¨libbpf库编写(整ç†å‡ºæ¥ä¸€ä¸ªæµç¨‹ï¼Œå¦‚:设置licenseï¼Œå¼•å…¥å“ªäº›å¤´æ–‡ä»¶ï¼Œæ€Žæ ·è®¾ç½®å¤„ç†å‡½æ•°ï¼‰ + - kernelæ€çš„bpfç¨‹åºæ˜¯æ€Žä¹ˆç¼–è¯‘çš„ï¼Œç¼–è¯‘æ—¶éœ€è¦æœ‰å“ªäº›ä¾èµ–,与系统的结构有什么è”系(整ç†å‡ºæ¥ä¸€ä»½libbpf编写的bpf程åºç¼–译时ä¾èµ–的环境) + - 明确bpftoolã€btfã€vmlinux.hã€CO-RE都是什么,起到了什么作用,btfå’Œlinuxå†…æ ¸ä»¥åŠlibbpf库有什么关系,vmlinux.h怎么生æˆå’Œä½¿ç”¨ï¼ŒCO-RE怎么使用; + - æžæ¸…楚libbpf-bootstrap的编译è¿è¡ŒåŠ è½½é€»è¾‘ï¼ˆä¼¼ä¹Žå¯ä»¥é€šè¿‡æŸ¥çœ‹Makefileå’Œlibbpf-bootstrap的说明文档了解一下),整ç†å‡ºä¸€ä¸ªlibbpf-bootstrap的结构文档; +5. 简å•å°è¯•一下bpf-trace程åºï¼› +6. 下一æ¥å¼€å§‹äº†è§£bpfå’Œk8s之间的è”ç³»ï¼Œå¹¶ç ”ç©¶ä¸€ä¸‹eunomia-bpf这个框架; -- GitLab