os:linux:troubleshooting
Различия
Показаны различия между двумя версиями страницы.
Следующая версия | Предыдущая версия | ||
os:linux:troubleshooting [24.09.2020 13:38] – создано viacheslav | os:linux:troubleshooting [20.10.2024 07:52] (текущий) – [Доступен ли порт] viacheslav | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
+ | ===== Что ест дисковые ресурсы ===== | ||
+ | <code bash> | ||
+ | top | ||
+ | # wa -- iowait | ||
+ | # Amount of time the CPU has been waiting for I/O to complete. | ||
+ | </ | ||
+ | Processes that are waiting for I/O are commonly in an “uninterruptible sleep” state or “D”; given this information we can simply find the processes that are constantly in a wait state. | ||
+ | <code bash> | ||
+ | for x in `seq 1 1 10`; do ps -eo state, | ||
+ | </ | ||
+ | The above for loop will print the processes in a “D” state every 5 seconds for 10 intervals. | ||
+ | |||
+ | |||
+ | **Finding what files are being written too heavily**\\ | ||
+ | The lsof command will show you all of the files open by a specific process or all processes depending on the options provided. From this list one can make an educated guess as to what files are likely being written to often based on the size of the file and the amounts present in the “io” file within /proc. To narrow down the output we will use the -p <pid> options to print only files open by the specific process id. | ||
+ | <code bash> | ||
+ | lsof -p <process id> | ||
+ | </ | ||
+ | |||
+ | https:// | ||
+ | |||
+ | ===== Кончилось место на диске ===== | ||
+ | По версии '' | ||
+ | <code bash> | ||
+ | # Вывести список | ||
+ | lsof | grep ' | ||
+ | </ | ||
+ | Решение - перезапустить или завершить процесс (в моём случае это был mysql). | ||
+ | |||
+ | https:// | ||
+ | |||
+ | ===== Доступен ли порт ===== | ||
+ | <code bash> | ||
+ | # netcat (быстро выходит сразу, показывая результат, | ||
+ | # Single port: | ||
+ | nc -zv 127.0.0.1 80 | ||
+ | # Multiple ports: | ||
+ | nc -zv 127.0.0.1 22 80 8080 | ||
+ | # Range of ports: | ||
+ | nc -zv 127.0.0.1 20-30 | ||
+ | |||
+ | # Bash тоже умеет: | ||
+ | # If host is a valid hostname or Internet address, and port is an integer port number | ||
+ | # or service name, bash attempts to open a connection to the corresponding socket. | ||
+ | # TCP | ||
+ | / | ||
+ | # UDP | ||
+ | / | ||
+ | |||
+ | echo 2> /dev/null > / | ||
+ | Success | ||
+ | |||
+ | # telnet (ждёт) | ||
+ | telnet 127.0.0.1 22 | ||
+ | </ | ||
+ | https:// |