-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d96e0e1
commit b99f996
Showing
85 changed files
with
1,090 additions
and
17 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sudo yum -y install bzip2 wget gcc gcc-c++ gmp-devel mpfr-devel libmpc-devel make | ||
sudo yum -y install bzip2 wget gcc gcc-c++ gmp-devel mpfr-devel libmpc-devel make texinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def index(): | ||
return 'Index Page' | ||
|
||
@app.route("/hello") | ||
def hello_world(): | ||
return "Hello, World" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from flask import Flask | ||
from markupsafe import escape | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/user/<username>') | ||
def show_user_profile(username): | ||
# show the user profile for that user | ||
return f'User {escape(username)}' | ||
|
||
@app.route('/post/<int:post_id>') | ||
def show_post(post_id): | ||
# show the post with the given id, the id is an interger | ||
return f'Post {post_id}' | ||
|
||
@app.route('/path/<path:subpath>') | ||
def show_subpath(subpath): | ||
# show the subpath after /path/ | ||
return f'Subpath {escape(subpath)}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
source/gluster/deploy/centos/centos_gluster_init/parted_xfs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
source/gluster/deploy/centos/centos_gluster_init/parted_xfs_df
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Filesystem Size Used Avail Use% Mounted on | ||
devtmpfs 63G 0 63G 0% /dev | ||
tmpfs 63G 66M 63G 1% /dev/shm | ||
tmpfs 63G 2.2M 63G 1% /run | ||
tmpfs 63G 0 63G 0% /sys/fs/cgroup | ||
/dev/sda3 49G 21G 27G 44% / | ||
/dev/sda5 167G 1.4G 157G 1% /home | ||
/dev/sda2 976M 181M 728M 20% /boot | ||
/dev/nvme0n1p1 3.5T 3.7G 3.5T 1% /data/brick0 | ||
/dev/nvme1n1p1 3.5T 3.7G 3.5T 1% /data/brick1 | ||
/dev/nvme2n1p1 3.5T 3.7G 3.5T 1% /data/brick2 | ||
/dev/nvme3n1p1 3.5T 3.7G 3.5T 1% /data/brick3 | ||
/dev/nvme4n1p1 3.5T 3.7G 3.5T 1% /data/brick4 | ||
/dev/nvme5n1p1 3.5T 3.7G 3.5T 1% /data/brick5 | ||
/dev/nvme6n1p1 3.5T 3.7G 3.5T 1% /data/brick6 | ||
/dev/nvme7n1p1 3.5T 3.7G 3.5T 1% /data/brick7 | ||
/dev/nvme8n1p1 3.5T 3.7G 3.5T 1% /data/brick8 | ||
/dev/nvme9n1p1 3.5T 3.7G 3.5T 1% /data/brick9 | ||
/dev/nvme10n1p1 3.5T 3.7G 3.5T 1% /data/brick10 | ||
/dev/nvme11n1p1 3.5T 3.7G 3.5T 1% /data/brick11 |
21 changes: 16 additions & 5 deletions
21
...loy_centos7_gluster11_lvm_mdadm_raid6.rst → ...oy_centos7_gluster11_lvm_mdadm_raid10.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ps -eo pid,lstart,cmd | grep qemu-system-x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
7300 Sun Aug 6 11:10:56 2023 /usr/bin/qemu-system-x86_64 -name guest=z-b-data-3,... | ||
7354 Sun Aug 6 11:11:03 2023 /usr/bin/qemu-system-x86_64 -name guest=z-b-data-1,... | ||
7405 Sun Aug 6 11:11:09 2023 /usr/bin/qemu-system-x86_64 -name guest=z-b-data-2,... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ps -T -o pid,tid,c,pcpu,comm -p 7354 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PID TID C %CPU COMMAND | ||
7354 7354 0 0.2 qemu-system-x86 | ||
7354 7358 0 0.0 qemu-system-x86 | ||
7354 7361 0 0.0 IO mon_iothread | ||
7354 7363 2 2.1 CPU 0/KVM | ||
7354 7364 2 2.6 CPU 1/KVM | ||
7354 7365 2 2.5 CPU 2/KVM | ||
7354 7366 2 2.7 CPU 3/KVM | ||
7354 7470 0 0.0 worker | ||
7354 210749 0 0.0 worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
top - 16:30:30 up 4 days, 5:28, 11 users, load average: 0.72, 0.55, 0.40 | ||
Tasks: 630 total, 1 running, 629 sleeping, 0 stopped, 0 zombie | ||
%Cpu(s): 0.6 us, 0.3 sy, 0.0 ni, 99.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st | ||
MiB Mem : 386813.0 total, 327264.1 free, 51822.8 used, 7726.1 buff/cache | ||
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 332638.5 avail Mem | ||
|
||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | ||
7354 libvirt+ 20 0 16.8g 16.0g 19768 S 10.2 4.2 635:51.79 qemu-system-x86 | ||
7300 libvirt+ 20 0 16.7g 16.0g 19668 S 6.6 4.2 459:39.34 qemu-system-x86 | ||
7405 libvirt+ 20 0 16.8g 16.0g 19732 S 6.6 4.2 442:22.15 qemu-system-x86 | ||
2014 prometh+ 20 0 726984 19972 12036 S 4.3 0.0 50:29.36 node_exporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. _sysctl: | ||
|
||
================= | ||
sysctl | ||
================= | ||
|
||
``sysctl`` 命令工具可以动态修改内核参数 | ||
|
||
快速起步 | ||
========== | ||
|
||
- 列出所有系统内核变量(参数值): | ||
|
||
.. literalinclude:: sysctl/sysctl_a | ||
:caption: 列出所有内核变量及值 | ||
|
||
- 读取变量(这里案例是读取 ``kernel.version`` ): | ||
|
||
.. literalinclude:: sysctl/sysctl_read | ||
:caption: 读取 ``kernel.version`` 内核参数 | ||
|
||
- 临时修改内核变量: | ||
|
||
.. literalinclude:: sysctl/sysctl_change | ||
:caption: 临时修改内核参数 | ||
|
||
- 修改内核变量持久化(也就是写入配置文件,重启依然生效): | ||
|
||
.. literalinclude:: sysctl/sysctl_change_permanently | ||
:caption: 永久修改内核参数 | ||
|
||
.. note:: | ||
|
||
内核参数除了配置在 ``/etc/sysctl.conf`` 配置文件,也可以将大配置文件拆解成多个存储在 ``/etc/sysctl.d`` 目录下的各个配置文件 | ||
|
||
|
||
参考 | ||
====== | ||
|
||
- `Product Documentation > Red Hat Enterprise Linux > 7 > Kernel Administration Guide > Chapter 2. Working with sysctl and kernel tunables <https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/kernel_administration_guide/working_with_sysctl_and_kernel_tunables>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sysctl -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sysctl <tunable class>.<tunable>=<value> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sysctl -w <tunable class>.<tunable>=<value> >> /etc/sysctl.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sysctl kernel.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.. _k8s_hosts_file_for_pods: | ||
|
||
================================ | ||
Kubernetes配置Pods中的hosts文件 | ||
================================ | ||
|
||
在故障排查中(也可能测试环境),需要为 pod 中注入 ``/etc/hosts`` 配置,以便能够绕过DNS解析来直接访问目标服务器。在Kubernetes中, ``PodSpec`` 段落提供了 ``HostAliases`` 字段完成配置: | ||
|
||
.. literalinclude:: k8s_hosts_file_for_pods/hostalias.yaml | ||
:language: yaml | ||
:caption: 为pod添加hosts | ||
|
||
- 测试: | ||
|
||
.. literalinclude:: k8s_hosts_file_for_pods/kubectl_hostalias | ||
:caption: 创建测试pods | ||
|
||
- 检查: | ||
|
||
.. literalinclude:: k8s_hosts_file_for_pods/kubectl_get_hostalias | ||
:caption: 查看创建的测试pods | ||
|
||
输出可以看到运行的pod: | ||
|
||
.. literalinclude:: k8s_hosts_file_for_pods/kubectl_get_hostalias_output | ||
:caption: 查看创建的测试pods | ||
|
||
|
||
- 查看日志: | ||
|
||
.. literalinclude:: k8s_hosts_file_for_pods/kubectl_logs_hostalias | ||
:caption: 查看创建的测试pods的日志 | ||
|
||
- 日志结果(就是 ``cat /etc/hosts`` 的输出内容验证): | ||
|
||
.. literalinclude:: k8s_hosts_file_for_pods/kubectl_logs_hostalias_output | ||
:caption: 查看创建的测试pods的日志内容就是 hosts 内容 | ||
|
||
|
||
参考 | ||
======= | ||
|
||
- `Adding entries to Pod /etc/hosts with HostAliases <https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/>`_ |
Oops, something went wrong.