笔记归档

pull/11/head
Zhang Peng 2019-02-22 11:07:25 +08:00
parent 56d1c908a8
commit d781a22198
2 changed files with 111 additions and 15 deletions

View File

@ -6,7 +6,7 @@
>
> 本项目,就是本人在日常学习工作中,对于操作系统、运维部署等相关知识的整理。
## :books: 内容
## :memo: 知识点
### [Linux](docs/linux)
@ -38,11 +38,18 @@
#### [Linux 运维](docs/linux/ops)
#### Linux 服务器运维
- [Linux 典型运维应用](docs/linux/ops/linux典型运维应用.md)
- [samba 使用详解](docs/linux/ops/samba使用详解.md)
#### 应用、服务、工具运维和调优
> :bulb: **说明**
>
> 这里总结了多种常用研发软件的安装、配置、使用指南。并提供基本安装、运行的脚本。
>
> [环境部署工具](codes/deploy/README.md) :适合开发、运维人员,在 [CentOS](https://www.centos.org/) 机器上安装常用命令工具或开发软件。
> [环境部署工具](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy) :适合开发、运维人员,在 [CentOS](https://www.centos.org/) 机器上安装常用命令工具或开发软件。
>
> - _`Scripts`安装配置脚本按照说明安装使用即可。_
> - _`Docs`: 安装配置文档说明安装的方法以及一些注意事项。_
@ -50,43 +57,42 @@
- 研发环境
- JDK
- | [**`Scripts`**](codes/deploy/tool/jdk) | [**`Docs`**](docs/linux/ops/service/jdk.md) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/jdk) | [**`Docs`**](docs/linux/ops/service/jdk.md) |
- Maven
- | [**`Scripts`**](codes/deploy/tool/maven) | [**`Tutorial`**](https://github.com/dunwu/javastack/tree/master/docs/javatool/build/maven) |
- | [**`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) |
- Nginx
- | [**`Scripts`**](codes/deploy/tool/nginx) | [**`Tutorial`**](https://github.com/dunwu/nginx-tutorial) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/nginx) | [**`Docs`**](https://github.com/dunwu/nginx-tutorial) |
- Nodejs
- | [**`Scripts`**](codes/deploy/tool/nodejs) | [**`Docs`**](docs/linux/ops/service/nodejs.md) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/nodejs) | [**`Docs`**](docs/linux/ops/service/nodejs.md) |
- Tomcat
- | [**`Scripts`**](codes/deploy/tool/tomcat) | [**`Docs`**](docs/linux/ops/service/tomcat.md) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/tomcat) | [**`Docs`**](docs/linux/ops/service/tomcat.md) |
- Zookeeper
- | [**`Scripts`**](codes/deploy/tool/zookeeper) | [**`Docs`**](docs/linux/ops/service/zookeeper.md) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/zookeeper) | [**`Docs`**](docs/linux/ops/service/zookeeper.md) |
- 研发工具
- Nexus - Maven 私服。
- | [**`Docs`**](docs/linux/ops/service/nexus.md) |
- Jenkins - 持续集成和持续交付平台。
- | [**`Scripts`**](codes/deploy/tool/jenkins) | [**`Docs`**](docs/linux/ops/service/jenkins.md) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/jenkins) | [**`Docs`**](docs/linux/ops/service/jenkins.md) |
- 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) 的首字母组合。
- | [**`Tutorial`**](docs/linux/ops/service/elastic/README.md) |
- | [**`Docs`**](docs/linux/ops/service/elastic) |
- 版本控制
- Gitlab - Git 代码管理平台
- Svn - Svn 是 Subversion 的简称,是一个开放源代码的版本控制系统,它采用了分支管理系统。
- | [**`Docs`**](docs/linux/ops/service/svn.md) |
- 消息中间件
- Kafka - 应该是 Java 世界最流行的消息中间件了吧。
- | [**`Scripts`**](codes/deploy/tool/kafka) | [**`Docs`**](docs/linux/ops/service/kafka.md) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/kafka) | [**`Docs`**](docs/linux/ops/service/kafka.md) |
- RocketMQ - 阿里巴巴开源的消息中间件。
- | [**`Scripts`**](codes/deploy/tool/rocketmq) | [**`Docs`**](docs/linux/ops/service/rocketmq.md) |
- | [**`Scripts`**](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy/tool/rocketmq) | [**`Docs`**](docs/linux/ops/service/rocketmq.md) |
- 数据库
- Mysql - 关系型数据库
- | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/mysql/install-mysql.md) |
- PostgreSQL - 关系型数据库
- | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/postgresql.md#安装) |
- Mongodb - Nosql
- | [**`Scripts`**](codes/deploy/tool/mongodb) | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/mongodb/install-mongodb.md) |
- | [**`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) |
- Redis - Nosql
- | [**`Scripts`**](codes/deploy/tool/redis) | [**`Docs`**](https://github.com/dunwu/database/blob/master/docs/redis/install-redis.md) |
- | [**`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) |
### [Windows](docs/windows)

View File

@ -1,5 +1,95 @@
# Linux 典型运维应用
> :bulb: 如果没有特殊说明,本文的案例都是针对 Centos 发行版本。
## 网络操作
### 无法访问外网域名
1在 hosts 中添加本机实际 IP 和本机实际域名的映射
```bash
echo "192.168.0.1 hostname" >> /etc/hosts
```
如果不知道本机域名,使用 `hostname` 命令查一下;如果不知道本机实际 IP使用 `ifconfig` 查一下。
2配置信赖的 DNS 服务器
执行 `vi /etc/resolv.conf` ,添加以下内容:
```bash
nameserver 114.114.114.114
nameserver 8.8.8.8
```
> 114.114.114.114 是国内老牌 DNS
>
> 8.8.8.8 是 Google DNS
>
> 👉 参考:[公共 DNS 哪家强](https://www.zhihu.com/question/32229915)
3测试一下能否 ping 通 www.baidu.com
### 开启、关闭防火墙
```bash
# 开启防火墙 22 端口
iptables -I INPUT -p tcp --dport 22 -j accept
# 彻底关闭防火墙
sudo systemctl status firewalld.service
sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service
```
## 系统维护
### 使用 NTP 进行时间同步
1先安装时钟同步工具 ntp
```
yum -y install ntp
```
ntp 的配置文件路径为: `/etc/ntp.conf`
2启动 NTP 服务
```bash
systemctl start ntpd.service
```
3放开防火墙 123 端口
NTP 服务的端口是 123,使用的是 udp 协议,所以 NTP 服务器的防火墙必须对外开放 udp 123 这个端口。
```
/sbin/iptables -A INPUT -p UDP -i eth0 -s 192.168.0.0/24 --dport 123 -j ACCEPT
```
4执行时间同步
```
/usr/sbin/ntpdate ntp.sjtu.edu.cn
```
ntp.sjtu.edu.cn 是上海交通大学 ntp 服务器。
5自动定时同步时间
执行如下命令,就可以在每天凌晨 3 点同步系统时间:
```
echo "* 3 * * * /usr/sbin/ntpdate ntp.sjtu.edu.cn" >> /etc/crontab
systemctl restart crond.service
```
> :point_right: 参考https://www.cnblogs.com/quchunhui/p/7658853.html
## 配置
### 设置 Linux 启动模式
1. 停机(记得不要把 initdefault 配置为 0因为这样会使 Linux 不能启动)