Skip to content

Commit d781a22

Browse files
committed
笔记归档
1 parent 56d1c90 commit d781a22

2 files changed

Lines changed: 111 additions & 15 deletions

File tree

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
>
77
> 本项目,就是本人在日常学习工作中,对于操作系统、运维部署等相关知识的整理。
88
9-
## :books: 内容
9+
## :memo: 知识点
1010

1111
### [Linux](docs/linux)
1212

@@ -38,55 +38,61 @@
3838

3939
#### [Linux 运维](docs/linux/ops)
4040

41+
#### Linux 服务器运维
42+
43+
- [Linux 典型运维应用](docs/linux/ops/linux典型运维应用.md)
44+
- [samba 使用详解](docs/linux/ops/samba使用详解.md)
45+
46+
#### 应用、服务、工具运维和调优
47+
4148
> :bulb: **说明**
4249
>
4350
> 这里总结了多种常用研发软件的安装、配置、使用指南。并提供基本安装、运行的脚本。
4451
>
45-
> [环境部署工具](codes/deploy/README.md) :适合开发、运维人员,在 [CentOS](https://www.centos.org/) 机器上安装常用命令工具或开发软件。
52+
> [环境部署工具](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy) :适合开发、运维人员,在 [CentOS](https://www.centos.org/) 机器上安装常用命令工具或开发软件。
4653
>
4754
> - _`Scripts`:安装配置脚本,按照说明安装使用即可。_
4855
> - _`Docs`: 安装配置文档,说明安装的方法以及一些注意事项。_
4956
> - _`Tutorial`: 教程文档。_
5057
5158
- 研发环境
5259
- JDK
53-
- | [**`Scripts`**](codes/deploy/tool/jdk) | [**`Docs`**](docs/linux/ops/service/jdk.md) |
60+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/jdk) | [**`Docs`**](docs/linux/ops/service/jdk.md) |
5461
- Maven
55-
- | [**`Scripts`**](codes/deploy/tool/maven) | [**`Tutorial`**](https://github.com/dunwu/javastack/tree/master/docs/javatool/build/maven) |
62+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/maven) | [**`Docs`**](https://github.com/dunwu/javastack/tree/master/docs/javatool/build/maven) |
5663
- Nginx
57-
- | [**`Scripts`**](codes/deploy/tool/nginx) | [**`Tutorial`**](https://github.com/dunwu/nginx-tutorial) |
64+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/nginx) | [**`Docs`**](https://github.com/dunwu/nginx-tutorial) |
5865
- Nodejs
59-
- | [**`Scripts`**](codes/deploy/tool/nodejs) | [**`Docs`**](docs/linux/ops/service/nodejs.md) |
66+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/nodejs) | [**`Docs`**](docs/linux/ops/service/nodejs.md) |
6067
- Tomcat
61-
- | [**`Scripts`**](codes/deploy/tool/tomcat) | [**`Docs`**](docs/linux/ops/service/tomcat.md) |
68+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/tomcat) | [**`Docs`**](docs/linux/ops/service/tomcat.md) |
6269
- Zookeeper
63-
- | [**`Scripts`**](codes/deploy/tool/zookeeper) | [**`Docs`**](docs/linux/ops/service/zookeeper.md) |
70+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/zookeeper) | [**`Docs`**](docs/linux/ops/service/zookeeper.md) |
6471
- 研发工具
6572
- Nexus - Maven 私服。
6673
- | [**`Docs`**](docs/linux/ops/service/nexus.md) |
67-
6874
- Jenkins - 持续集成和持续交付平台。
69-
- | [**`Scripts`**](codes/deploy/tool/jenkins) | [**`Docs`**](docs/linux/ops/service/jenkins.md) |
75+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/jenkins) | [**`Docs`**](docs/linux/ops/service/jenkins.md) |
7076
- Elastic - 常被称为 `ELK` ,是 Java 世界最流行的分布式日志解决方案 。 `ELK` 是 Elastic 公司旗下三款产品 [ElasticSearch](https://www.elastic.co/products/elasticsearch)[Logstash](https://www.elastic.co/products/logstash)[Kibana](https://www.elastic.co/products/kibana) 的首字母组合。
71-
- | [**`Tutorial`**](docs/linux/ops/service/elastic/README.md) |
77+
- | [**`Docs`**](docs/linux/ops/service/elastic) |
7278
- 版本控制
7379
- Gitlab - Git 代码管理平台
7480
- Svn - Svn 是 Subversion 的简称,是一个开放源代码的版本控制系统,它采用了分支管理系统。
7581
- | [**`Docs`**](docs/linux/ops/service/svn.md) |
7682
- 消息中间件
7783
- Kafka - 应该是 Java 世界最流行的消息中间件了吧。
78-
- | [**`Scripts`**](codes/deploy/tool/kafka) | [**`Docs`**](docs/linux/ops/service/kafka.md) |
84+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/kafka) | [**`Docs`**](docs/linux/ops/service/kafka.md) |
7985
- RocketMQ - 阿里巴巴开源的消息中间件。
80-
- | [**`Scripts`**](codes/deploy/tool/rocketmq) | [**`Docs`**](docs/linux/ops/service/rocketmq.md) |
86+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/rocketmq) | [**`Docs`**](docs/linux/ops/service/rocketmq.md) |
8187
- 数据库
8288
- Mysql - 关系型数据库
8389
- | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/mysql/install-mysql.md) |
8490
- PostgreSQL - 关系型数据库
8591
- | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/postgresql.md#安装) |
8692
- Mongodb - Nosql
87-
- | [**`Scripts`**](codes/deploy/tool/mongodb) | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/mongodb/install-mongodb.md) |
93+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/mongodb) | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/mongodb/install-mongodb.md) |
8894
- Redis - Nosql
89-
- | [**`Scripts`**](codes/deploy/tool/redis) | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/redis/install-redis.md) |
95+
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/redis) | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/redis/install-redis.md) |
9096

9197
### [Windows](docs/windows)
9298

docs/linux/ops/linux典型运维应用.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,95 @@
11
# Linux 典型运维应用
22

3+
> :bulb: 如果没有特殊说明,本文的案例都是针对 Centos 发行版本。
4+
5+
## 网络操作
6+
7+
### 无法访问外网域名
8+
9+
(1)在 hosts 中添加本机实际 IP 和本机实际域名的映射
10+
11+
```bash
12+
echo "192.168.0.1 hostname" >> /etc/hosts
13+
```
14+
15+
如果不知道本机域名,使用 `hostname` 命令查一下;如果不知道本机实际 IP,使用 `ifconfig` 查一下。
16+
17+
(2)配置信赖的 DNS 服务器
18+
19+
执行 `vi /etc/resolv.conf` ,添加以下内容:
20+
21+
```bash
22+
nameserver 114.114.114.114
23+
nameserver 8.8.8.8
24+
```
25+
26+
> 114.114.114.114 是国内老牌 DNS
27+
>
28+
> 8.8.8.8 是 Google DNS
29+
>
30+
> 👉 参考:[公共 DNS 哪家强](https://www.zhihu.com/question/32229915)
31+
32+
(3)测试一下能否 ping 通 www.baidu.com
33+
34+
### 开启、关闭防火墙
35+
36+
```bash
37+
# 开启防火墙 22 端口
38+
iptables -I INPUT -p tcp --dport 22 -j accept
39+
40+
# 彻底关闭防火墙
41+
sudo systemctl status firewalld.service
42+
sudo systemctl stop firewalld.service
43+
sudo systemctl disable firewalld.service
44+
```
45+
46+
## 系统维护
47+
48+
### 使用 NTP 进行时间同步
49+
50+
(1)先安装时钟同步工具 ntp
51+
52+
```
53+
yum -y install ntp
54+
```
55+
56+
ntp 的配置文件路径为: `/etc/ntp.conf`
57+
58+
(2)启动 NTP 服务
59+
60+
```bash
61+
systemctl start ntpd.service
62+
```
63+
64+
(3)放开防火墙 123 端口
65+
66+
NTP 服务的端口是 123,使用的是 udp 协议,所以 NTP 服务器的防火墙必须对外开放 udp 123 这个端口。
67+
68+
```
69+
/sbin/iptables -A INPUT -p UDP -i eth0 -s 192.168.0.0/24 --dport 123 -j ACCEPT
70+
```
71+
72+
(4)执行时间同步
73+
74+
```
75+
/usr/sbin/ntpdate ntp.sjtu.edu.cn
76+
```
77+
78+
ntp.sjtu.edu.cn 是上海交通大学 ntp 服务器。
79+
80+
(5)自动定时同步时间
81+
82+
执行如下命令,就可以在每天凌晨 3 点同步系统时间:
83+
84+
```
85+
echo "* 3 * * * /usr/sbin/ntpdate ntp.sjtu.edu.cn" >> /etc/crontab
86+
systemctl restart crond.service
87+
```
88+
89+
> :point_right: 参考:https://www.cnblogs.com/quchunhui/p/7658853.html
90+
91+
## 配置
92+
393
### 设置 Linux 启动模式
494

595
1. 停机(记得不要把 initdefault 配置为 0,因为这样会使 Linux 不能启动)

0 commit comments

Comments
 (0)