小敏的博客


  • 首页

  • 分类

  • 标签

  • 归档

  • 关于

运维-rap 2 安装

发表于 2019-04-24 | | 阅读次数:

安装配置

rap2-delos 安装配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 下载rap2后端数据API服务器代码
git clone https://github.com/thx/rap2-delos.git

# 初始化
npm install

# 安装全局组件
npm install pm2 -g
npm install typescript -g

# 添加 pm2 系统命令
ln -s /path/nodejs/bin/pm2 /usr/local/bin/

# 修改配置文件
> 生产模式下配置文件地址 src/config/config.prod.ts
> 修改端口、数据库连接

# 编译
npm run build

# 创建表
npm run create-db

# 启动服务
npm start

# 查看 pm2 服务 并 保存开机启动
pm2 list
pm2 save
pm2 startup

# 设置nginx反向代理

rap2-dolores 安装配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 下载rap2前端静态资源代码
git clone https://github.com/thx/rap2-dolores.git

# 初始化
npm install

# 如果初始化失败 --unsafe-perm 解锁安全模式
npm install --unsafe-perm=true --allow-root

# 修改配置文件
> 生产模式下配置文件地址 src/config/config.prod.js

# 编译
npm run build

# 启动服务
# npm start

# 设置nginx服务,指向/path/rap2-dolores/build

运维-Supervisor 安装配置

发表于 2019-04-24 | 分类于 IT , 运维 | | 阅读次数:

安装

1
2
3
4
5
6
yum install supervisor
systemctl start supervisord
systemctl status supervisord
systemctl enable supervisord
systemctl restart supervisord

参数

1
#

配置

新增 /etc/supervisord.d/laravel-worker.ini

1
2
3
4
5
6
7
8
9
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/artisan queue:work database --queue=all_comment
autostart=true
autorestart=true
user=forge
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/zhenyouhaofang/storage/logs/worker.log

运维-Jeknins安装

发表于 2019-04-22 | 分类于 IT , 运维 | | 阅读次数:

Jenkins是一款由Java编写的开源的持续集成工具。

阅读全文 »

运维-SSL 证书安装 certbot-auto

作者: 小敏-blog | 发表于 2019-04-09 | 分类于 IT , 运维 | | 阅读次数:

certbot是专门为Let’s encrypt制作的一个管理证书工具,可以通过它来生成证书管理更新Let’s encrypt证书。

阅读全文 »

运维-MariaDB 数据库安装配置

作者: 小敏-blog | 发表于 2019-04-09 | 分类于 IT , 运维 | | 阅读次数:

MariaDB是MySQL关系数据库管理系统的一个复刻,由社区开发,有商业支持,旨在继续保持在GNU GPL下开源。

阅读全文 »

运维-自助 Git 服务 Gogs 安装

作者: 小敏-mingo | 发表于 2019-04-02 | 分类于 IT , 运维 | | 阅读次数:

一款极易搭建的自助 Git 服务。

阅读全文 »

运维-Api文档管理 ShowDoc 安装

作者: 小敏-mingo | 发表于 2019-04-02 | 分类于 IT , 运维 | | 阅读次数:

ShowDoc就是一个非常适合IT团队的在线文档分享工具,它可以加快团队之间沟通的效率。

阅读全文 »

运维-搜索引擎安装 Elasticsearch

作者: 小敏-mingo | 发表于 2019-03-06 | 分类于 IT , 运维 | | 阅读次数:

安装

将 Elasticsearch 公共 GPG 密钥导入 rpm

1
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

新增 /etc/yum.repos.d/elasticsearch.repo

1
2
3
4
5
6
7
8
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

安装 Elasticsearch

1
2
3
yum install elasticsearch
systemctl start elasticsearch
systemctl enable elasticsearch

安装 Logstash

1
2
3
yum install logstash
systemctl start logstash
systemctl enable logstash

安装 Kibana

1
2
3
yum install kibana
systemctl start kibana
systemctl enable kibana

安装 Filebeat

1
2
3
yum install filebeat
systemctl start filebeat
systemctl enable filebeat

查看端口是否正常

1
2
netstat -lntp |grep 9200
netstat -lntp |grep 5601

配置

  • 设置kibana

    /etc/kibana/kibana.yml

1
logging.dest: /var/log/kibana/kibana.log

调试

filebeat 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
- type: log
enabled: true
paths:
- /var/log/nginx/access.log
# 添加字段信息
fields:
logtype: nginx_access
logsource: nginx_access_log

- type: log
enabled: true
paths:
- /var/log/nginx/error.log
# 添加字段信息
fields:
logtype: nginx_error
logsource: nginx_error_log
...
output.logstash:
hosts: ["localhost:10520"]
...
1
2
### 测试配置
filebeat -e -c /etc/filebeat/filebeat.yml

logstash 配置 Rsyslog 日志

  • logstash 配置 rsyslog 日志
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### 编辑 rsyslog 配置,/etc/rsyslog.conf
*.* @@127.0.0.1:10514

### 编辑 logstash 配置,/etc/logstash/conf.d/system-syslog.conf
input {
syslog {
port => 10514
}
}
output {
stdout {
codec => rubydebug # 将日志输出到当前的终端上显示
}
}

### 测试配置
/usr/share/logstash/bin/logstash --path.settings /etc/logstash/ -f /etc/logstash/conf.d/system-syslog.conf
  • logstash 配置 filebeat 日志
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
input {
beats {
port => 10520
}
}
output {
if [fields][logtype] == "nginx_access" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "nginx_access-%{+YYYY.MM.dd}"
}
}
if [fields][logtype] == "nginx_error" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "nginx_error-%{+YYYY.MM.dd}"
}
}

#stdout {
# codec => rubydebug # 将日志输出到当前的终端上显示
#}
}

nginx 配置 Kibana 代理

1
2
3
4
5
6
7
8
9
10
11
12
## 新增密码文件

htpasswd -c /etc/nginx/passwd/.htpasswd mingo

## 追加密码用户
htpasswd /etc/nginx/passwd/.htpasswd mingo002

## 添加nginx配置
auth_basic "Administrator Login";
auth_basic_user_file /etc/nginx/passwd/.htpasswd;

## 重启

推荐文章

  • php-Laravel elasticsearch教程
  • 运维-搜索引擎安装 迅搜

运维-搜索引擎安装 迅搜

作者: 小敏-mingo | 发表于 2019-03-06 | 分类于 IT , 运维 | | 阅读次数:

开源免费、高性能、多功能
简单易用的专业全文检索技术方案
帮助一般开发者针对既有的海量数据,快速而方便地建立自己的全文搜索引擎。全文检索可以帮助您降低服务器搜索负荷、极大程度的提高搜索速度和用户体验

阅读全文 »

运维-nginx日志分析工具

作者: 小敏-mingo | 发表于 2019-02-26 | 分类于 IT , 运维 | | 阅读次数:

GoAccess 是一款开源的且具有交互视图界面的实时 Web 日志分析工具,通过你的 Web 浏览器或者 Unix 系统下的终端程序(terminal)即可访问。

阅读全文 »
<i class="fa fa-angle-left"></i>1…891011<i class="fa fa-angle-right"></i>

106 日志
15 分类
173 标签
GitHub E-Mail
友情链接
  • Google
  • Twitter
  • FB Page
  • VK Group
  • StackOverflow
  • YouTube
  • Instagram
© 2018 — 2025 小敏-mingo
由 Hexo 强力驱动
|
主题 — NexT.Gemini v5.1.4
本站总访问量次 本站访客数次