Spring Boot (日志篇):Log4j2整合ELK,搭建实时日志平台
一、安装JDK1.8以上版本
1、从Oracle官网上下载Linux x64版本的 下载地址: http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
jdk-8u201-linux-x64.tar.gz
2、解压jdk安装包并创建软连接:
tar zxf /usr/local/src/jdk-8u201-linux-x64.tar.gz –C /usr/local/
ln -s /usr/local/jdk1.8.0_201/ /usr/local/jdk
3、配置环境变量:
vim /etc/profile
#修改内容如下:
JAVA_HOME=/usr/local/jdk
export JRE_HOME=/usr/local/jdk/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
4、重新载入环境变量:
source /etc/profile
5、查看jdk是否安装成功:
java -version
6、效果展示
二、Elasticsearch安装配置
1. 解压elasticsearch-5.3.1.tar源码包
下载链接:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.1.tar.gz
解压至/usr/local/目录下
tar -zxvf /usr/local/src/elasticsearch-5.3.1.tar.gz -C /usr/local/
2. 修改配置文件
修改 /usr/local/elasticsearch-5.3.1/config/elasticsearch.yml
配置文件。
以下供参考配置,实际以需求为准:
vi /usr/local/elasticsearch-5.3.1/config/elasticsearch.yml
# 这里指定的是集群名称,需要修改为对应的,开启了自发现功能后,ES会按照此集群名称进行集群发现
cluster.name: skynet_es_cluster
node.name: skynet_es_cluster_dev1
# 数据目录
path.data: /data/elk/data
# log 目录
path.logs: /data/elk/logs
# 修改一下ES的监听地址,这样别的机器也可以访问
network.host: 0.0.0.0
# 默认的端口号
http.port: 9200
discovery.zen.ping.unicast.hosts: ["172.18.5.111", "172.18.5.112"]
# discovery.zen.minimum_master_nodes: 3
# enable cors,保证_site类的插件可以访问es
http.cors.enabled: true
http.cors.allow-origin: "*"
# Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
注意,设置参数的时候:后面要有空格!
tips:ElasticSearch 配置文件译文解析
3. 修改系统参数
确保系统有足够资源启动ES 注:ES启动的时候回占用特别大的资源所以需要修改下系统参数,若不修改资源启动会异常退出
设置内核参数
vi /etc/sysctl.conf
# 增加以下参数
vm.max_map_count=655360
执行以下命令,确保生效配置生效:
sysctl -p
设置资源参数
vi /etc/security/limits.conf
# 修改
* soft nofile 65536
* hard nofile 131072
* soft nproc 65536
* hard nproc 131072
设置用户资源参数
vi /etc/security/limits.d/20-nproc.conf
# 设置elk用户参数
elk soft nproc 65536
4. 添加启动用户,设置权限
启动ElasticSearch5版本要非root用户,需要新建一个用户来启动ElasticSearch
useradd elk #创建用户elk
groupadd elk #创建组elk
useradd elk -g elk #将用户添加到组
mkdir -pv /data/elk/{data,logs} # 创建数据和日志目录
# 修改文件所有者
chown -R elk:elk /data/elk/
chown -R elk:elk /usr/local/elasticsearch-5.3.1/
5. 启动ES
查看内存剩余
free -g
ps:启动时候不能以root用户启动,否则会报错。
使用elk用户启动elasticsearch服务
切换至elk用户
su elk
/usr/local/elasticsearch-5.3.1/bin/elasticsearch
检查elasticsearch服务,如下图所示,即成功开启服务了,这就意味着你现在已经启动并运行一个Elasticsearch节点了。
浏览器访问http://192.168.13.131:9200/_search?pretty。如下json格式网页展示,表示ES启动成功
(注意如防火墙开启中,需要把9200端口开启监听,否则需要关闭防火墙systemctl stop firewalld.service
)
{
"took" : ,
"timed_out" : false,
"_shards" : {
"total" : ,
"successful" : ,
"failed" :
},
"hits" : {
"total" : ,
"max_score" : 0.0,
"hits" : [ ]
}
}
5.检测elasticsearch状态
三、安装 Logstash
下载并安装 Logstash ,安装 logstash 只需将它解压的对应目录即可,例如: /usr/local 下:
1.解压源码包 wget https://artifacts.elastic.co/downloads/logstash/logstash-5.3.1.tar.gz
tar /usr/local/src/logstash-5.3.1.tar.gz -C /usr/local/
解压并创建软连接:
tar /usr/local/src/logstash-5.3.1.tar.gz –C /usr/local/
ln –s /usr/local/logstash-5.3.1 /usr/local/logstash
2.测试logstash是否可用:
/usr/local/logstash/bin/logstash -e 'input { stdin { } } output { stdout {} }'

我们可以看到,我们输入什么内容logstash按照某种格式输出,其中-e参数参数允许Logstash直接通过命令行接受设置。这点尤其快速的帮助我们反复的测试配置是否正确而不用写配置文件。使用ctrl-c命令可以退出之前运行的Logstash。
使用-e参数在命令行中指定配置是很常用的方式,不过如果需要配置更多设置则需要很长的内容。这种情况,我们首先创建一个简单的配置文件,并且指定logstash使用这个配置文件。 例如:在 logstash 安装目录下(/usr/local/logstash-5.3.1/config)创建一个“基本配置”测试文件 logstash-simple.conf, 文件内容如下:vim logstash-simple.conf
input { stdin { } }
output {
stdout { codec=> rubydebug }
}
Logstash 使用 input 和 output 定义收集日志时的输入和输出的相关配置,本例中 input 定义了一个叫 "stdin" 的 input , output 定义一个叫 "stdout" 的 output 。无论我们输入什么字符, Logstash 都会按照某种格式来返回我们输入的字符,其中 output 被定义为 "stdout" 并使用了 codec 参数来指定 logstash 输出格式。
使用logstash的-f参数来读取配置文件,执行如下开始进行测试:
/usr/local/logstash/bin/logstash -f /usr/local/logstash/config/logstash-simple.conf
此时说明我们的logstash是完全没有问题了,可以进行日志收集了
3.创建配置文件获取redis日志的数据:
vim /usr/local/logstash/config/redis-spring.conf
input {
redis {
port => "7001"
host => "192.168.13.131"
data_type => "list"
type => "log"
key => "eureka-log"
}
}
output {
elasticsearch {
hosts => "192.168.13.131:9200"
index => "logstash1-%{+YYYY.MM.dd}"
}
}
redis服务器中的值
通过配置文件启动服务查看效果:
/usr/local/logstash/bin/logstash -f /usr/local/logstash/config/redis-spring.conf

启动成功后
此时我们再去查看reids中key:(此时已经没有数据了,数据已经被logstash取完)
使用curl 查看ES是否接受到数据
curl http://
192.168.13.131:9200/_search?pretty
4.测试Elasticsearch 和 Logstash 来收集日志数据
接下来我们在 logstash 安装目录下创建一个用于测试 logstash 使用 elasticsearch 作为 logstash 的后端的测试文件 logstash-test.conf,该文件中定义了stdout和elasticsearch作为output,这样的“多重输出”即保证输出结果显示到屏幕上,同时也输出到elastisearch中。
前提要保证elasticsearch和logstash都正常启动(需要先启动elasticsearch,再启动logstash)
vim logstash-test.conf
input { stdin { } }
output {
elasticsearch {hosts => "192.168.13.131:9200" } #elasticsearch服务地址
stdout { codec=> rubydebug }
}
开启服务,执行如下命令:
/usr/local/logstash-5.3.1/bin/logstash -f /usr/local/logstash-5.3.1/config/logstash-test.conf
我们可以使用 curl 命令发送请求来查看 ES 是否接收到了数据:
curl 'http://192.168.30.132:9200/_search?pretty'
输入消息

返回结果如下
{
"took" : 61,
"timed_out" : false,
"_shards" : {
"total" : 10,
"successful" : 10,
"failed" : 0
},
"hits" : {
"total" : 3,
"max_score" : 1.0,
"hits" : [
{
"_index" : "logstash1-2019.06.15",
"_type" : "log",
"_id" : "AWtaLo8LKrKD-dkRoCEX",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2019-06-15T08:08:48.725Z",
"@version" : "1",
"message" : "1",
"type" : "log",
"tags" : [
"_jsonparsefailure"
]
}
},
{
"_index" : "logstash-2019.06.15",
"_type" : "logs",
"_id" : "AWtaOUUZKrKD-dkRoCEa",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2019-06-15T08:20:31.113Z",
"@version" : "1",
"host" : "localhost.localdomain",
"message" : "21"
}
},
{
"_index" : "logstash-2019.06.15",
"_type" : "logs",
"_id" : "AWtaOSnhKrKD-dkRoCEZ",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2019-06-15T08:20:24.025Z",
"@version" : "1",
"host" : "localhost.localdomain",
"message" : "11"
}
}
]
}
}
至此,你已经成功利用 Elasticsearch 和 Logstash 来收集日志数据了。
四、kibana的安装
1. 解压kibana-5.3.1-linux-x86_64源码包
下载地址:https://artifacts.elastic.co/downloads/kibana/kibana-5.3.1-linux-x86_64.tar.gz
解压至/usr/local/下
tar -zxvf /usr/local/src/kibana-5.3.1-linux-x86_64.tar.gz -C /usr/local/
2.配置kibana
编辑kibana.yml配置文件
vi /usr/local/kibana-5.3.1-linux-x86_64/config/kibana.yml
修改以下参数:
server.port: 5601 #开启默认端口5601
server.host: “192.168.30.132” #站点地址
elasticsearch.url: http://192.168.30.132:9200 #指向elasticsearch服务的ip地址
kibana.index: “.kibana”
3.启动
执行以下命令启动:
/usr/local/kibana-5.3.1-linux-x86_64/bin/kibana
出现如下页面表示kibana启动成功

或者
查看端口监听:
netstat –anot | grep 5601
五、配置ES索引
根据logstash配置文件中index设置索引:
首先查看logstash中的index:
修改logstash-test.conf启动配置文件
vimlogstash-test.conf
重启logstash,然后输入hello world
然后Kibana中创建index:(在Management选项菜单中创建)
创建成功后,在discover中查询出现如下图,能查询到日志数据,就成功了。
六.插件
参考链接:
Elasticsearch 5.0 —— Head插件部署指南
ElasticSearch 5.0的head插件安装https://www.elastic.co/guide/cn/elasticsearch/guide/current/running-elasticsearch.html 中文社区
七、安装ES插件:(elasticsearch-head)
注:head安装需要从国外网站拉去东西,可能网速过慢导致安装失败(可以多试几次),下面有几种方法安装:
方法一、
导入node-v8.2.1.tar.gz phantomjs-2.1.1-linux-x86_64.tar.bz2 安装包
安装node:
tar zxvf node-v8.2.1.tar.gz
cd node-v8.2.1/
./configure && make && make install
安装phantomjs:
tar jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2
cd phantomjs-2.1.1-linux-x86_64/bin/
cp phantomjs /usr/local/bin/
导入es-head程序包并解压:
unzip master.zip –d /usr/local/
cd elasticsearch-head/
npm install
npm run start &
查看端口状态:(端口默认9100)
netstat –anpt | grep 9100
方法二、
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
netstat –anpt | grep 9100
方法三、
拉镜像:
docker push mobz/elasticsearch-head:5
启动镜像:
docker run -p 9100:9100 mobz/elasticsearch-head:5
web访问测试:
http://IP:9100
八.问题集
1、安装head插件时,[root@localhost elasticsearch-head]# npm install
报错如下
npm WARN deprecated coffee-script@1.10.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated http2@3.3.7: Use the built-in module in node 9.0.0 or newer, instead
npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated
npm WARN deprecated json3@3.2.6: Please use the native JSON object instead of JSON 3
npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3 > phantomjs-prebuilt@2.1.16 install /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt
> node install.js PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Removing /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569630895676/phantomjs-2.1.1-linux-x86_64 -> /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
Phantom installation failed { [Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569630895676/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom']
errno: -13,
code: 'EACCES',
syscall: 'link',
path:
'/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569630895676/phantomjs-2.1.1-linux-x86_64',
dest:
'/usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569630895676/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom'
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-09-28T00_35_00_168Z-debug.log
解决方案:
1、输入npm install -g
提示错误如下
[root@localhost elasticsearch-head]# npm install -g
+ elasticsearch-head@0.0.0
updated 1 package in 1.698s
2、然后继续grunt server
[root@localhost elasticsearch-head]# grunt server
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected identifier
Warning: Task "server" not found. Use --force to continue. Aborted due to warnings.
3、根据错误提示,server未发现,重新安装npm,先删除head目录下的node_modules
[root@localhost elasticsearch-head]# rm -rf node_modules/
4、然后安装npm
[root@localhost elasticsearch-head]# npm install -g
+ elasticsearch-head@0.0.0
added 150 packages from 121 contributors and updated 1 package in 28.152s
[root@localhost elasticsearch-head]# grunt server
grunt-cli: The grunt command line interface (v1.3.2) Fatal error: Unable to find local grunt. If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide: https://gruntjs.com/getting-started
5、错误提示Unable to find local grunt, 根据提示进行本地安装grunt,接着启动server
[root@localhost elasticsearch-head]# npm install grunt --save-dev
npm WARN deprecated coffee-script@1.10.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + grunt@1.0.1
added 91 packages from 68 contributors, updated 4 packages and audited 1131 packages in 28.775s
found 24 vulnerabilities (2 low, 2 moderate, 20 high)
run `npm audit fix` to fix them, or `npm audit` for details
[root@localhost elasticsearch-head]# grunt -version
grunt-cli v1.3.2
grunt v1.0.1
[root@localhost elasticsearch-head]# grunt server
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected identifier
Warning: Task "server" not found. Use --force to continue. Aborted due to warnings.
6、这里提示Gruntfile.js错误,由于前面把hostname改成了*,打开文件后忘记加,现在修改过来后,保存退出
7、重新启动服务grunt server
[root@localhost elasticsearch-head]# grunt server
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue. Aborted due to warnings.
8、根据错误提示安装modual
(1)安装module
[root@localhost elasticsearch-head]# npm install grunt-contrib-clean --registry=https://registry.npm.taobao.org
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + grunt-contrib-clean@1.0.0
added 3 packages from 2 contributors and removed 6 packages in 1.611s
[root@localhost elasticsearch-head]# npm install grunt-contrib-concat --registry=https://registry.npm.taobao.org
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + grunt-contrib-concat@1.0.1
added 1 package from 1 contributor in 1.489s
[root@localhost elasticsearch-head]# npm install grunt-contrib-watch --registry=https://registry.npm.taobao.org
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + grunt-contrib-watch@1.0.0
added 36 packages from 41 contributors in 3.025s
[root@localhost elasticsearch-head]# npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org
npm WARN deprecated http2@3.3.7: Use the built-in module in node 9.0.0 or newer, instead
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + grunt-contrib-connect@1.0.2
added 32 packages from 30 contributors in 3.492s
[root@localhost elasticsearch-head]# npm install grunt-contrib-copy --registry=https://registry.npm.taobao.org
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + grunt-contrib-copy@1.0.0
added 2 packages from 2 contributors in 1.827s
[root@localhost elasticsearch-head]# npm install grunt-contrib-jasmine --registry=https://registry.npm.taobao.org > phantomjs-prebuilt@2.1.16 install /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt
> node install.js PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Removing /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569636068657/phantomjs-2.1.1-linux-x86_64 -> /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
Phantom installation failed { [Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569636068657/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom']
errno: -13,
code: 'EACCES',
syscall: 'link',
path:
'/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569636068657/phantomjs-2.1.1-linux-x86_64',
dest:
'/usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569636068657/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom'
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-09-28T02_01_11_594Z-debug.log
(2)修复最后一个modual安装错误
[root@localhost elasticsearch-head]# npm install --unsafe-perm
npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated
npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
npm WARN deprecated json3@3.2.6: Please use the native JSON object instead of JSON 3 > phantomjs-prebuilt@2.1.16 install /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt
> node install.js PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Removing /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1569636202947/phantomjs-2.1.1-linux-x86_64 -> /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /usr/local/fast/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs > core-js@2.6.9 postinstall /usr/local/fast/elasticsearch-head/node_modules/core-js
> node scripts/postinstall || echo "ignore" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) added 541 packages from 639 contributors and audited 2722 packages in 28.198s
found 70 vulnerabilities (19 low, 2 moderate, 49 high)
run `npm audit fix` to fix them, or `npm audit` for details
[root@localhost elasticsearch-head]# npm audit fix
npm WARN rm not removing /usr/local/fast/elasticsearch-head/node_modules/.bin/grunt as it wasn't installed by /usr/local/fast/elasticsearch-head/node_modules/grunt
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) + grunt@1.0.4
+ grunt-contrib-watch@1.1.0
added 23 packages from 18 contributors, removed 15 packages and updated 23 packages in 41.075s
fixed 45 of 70 vulnerabilities in 2722 scanned packages
1 vulnerability required manual review and could not be updated
3 package updates for 24 vulns involved breaking changes
(use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)
9、启动服务,运行head插件
[root@localhost elasticsearch-head]# grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
10、在浏览器输入http://192.168.76.128:9100/
Spring Boot (日志篇):Log4j2整合ELK,搭建实时日志平台的更多相关文章
- ELK搭建实时日志分析平台之二Logstash和Kibana搭建
本文书接前回<ELK搭建实时日志分析平台之一ElasticSearch> 文:铁乐与猫 四.安装Logstash logstash是一个数据分析软件,主要目的是分析log日志. 1)下载和 ...
- ELK搭建实时日志分析平台之一ElasticSearch搭建
文:铁乐与猫 系统:CentOS Linux release 7.3.1611 (Core) 注:我这里为测试和实验方便,ELK整套都装在同一台服务器环境中了,生产环境的话,可以分开搭建在不同的服务器 ...
- ELK搭建实时日志分析平台
ELK搭建实时日志分析平台 导言 ELK由ElasticSearch.Logstash和Kiabana三个开源工具组成,ELK平台可以同时实现日志收集.日志搜索和日志分析的功能.对于生产环境中海量日志 ...
- Spring boot学习1 构建微服务:Spring boot 入门篇
Spring boot学习1 构建微服务:Spring boot 入门篇 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框 ...
- Spring Boot 学习笔记(六) 整合 RESTful 参数传递
Spring Boot 学习笔记 源码地址 Spring Boot 学习笔记(一) hello world Spring Boot 学习笔记(二) 整合 log4j2 Spring Boot 学习笔记 ...
- spring boot与jdbcTemplate的整合案例2
简单入门了spring boot后,接下来写写跟数据库打交道的案例.博文采用spring的jdbcTemplate工具类与数据库打交道. 下面是搭建的springbootJDBC的项目的总体架构图: ...
- 构建微服务:Spring boot 入门篇
什么是Spring Boot Spring Boot 是由 Pivotal 团队提供的全新框架,其设计目的是用来简化新 Spring 应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而 ...
- Spring boot 入门篇
详见:https://www.cnblogs.com/ityouknow/p/5662753.html 什么是Spring Boot Spring Boot 是由 Pivotal 团队提供的全新框架, ...
- Spring Boot干货系列:(七)默认日志框架配置
Spring Boot干货系列:(七)默认日志框架配置 原创 2017-04-05 嘟嘟MD 嘟爷java超神学堂 前言 今天来介绍下Spring Boot如何配置日志logback,我刚学习的时候, ...
- (转)Spring Boot干货系列:(七)默认日志logback配置解析
转:http://tengj.top/2017/04/05/springboot7/ 前言 今天来介绍下Spring Boot如何配置日志logback,我刚学习的时候,是带着下面几个问题来查资料的, ...
随机推荐
- 利用Travis CI+GitHub实现持续集成和自动部署
前言 如果你手动部署过项目,一定会深感持续集成的必要性,因为手动部署实在又繁琐又耗时,虽然部署流程基本固定,依然容易出错. 如果你很熟悉持续集成,一定会同意这样的观点:"使用它已经成为一种标 ...
- EJB生成代码后遇到transient错误
启动服务的时候遇到这样的错误: 解决方案: 1.找到对应的模块的SesBean文件 2.去掉transient 3.重启服务即可
- maven私服 nexus 的安装与使用
简介 私服不是Maven的核心概念,它仅仅是一种衍生出来的特殊的Maven仓库.通过建立自己的私服,就可以降低中央仓库负荷.节省外网带宽.加速Maven构建.自己部署构建等,从而高效地使用Maven. ...
- __pycache__
最近在使用python写一个串口模块的时候,偶然发现运行脚本之后,在工程文件夹下面出现了这样一个文件夹__pycache__,所以就特意到网上查了一下这个文件夹是怎么回事. 我们先在源文件中添加一些内 ...
- 二 mysql库表的详细操作
目录 1.库操作 1.创建数据库 2.数据库相关操作 2.表操作 1.存储引擎 2.表介绍 3.创建表 4.查看表结构 5.MySQL的基础数据类型 6.表的完整性约束 7.修改表 alter tab ...
- spring源码分析系列3:BeanFactory核心容器的研究
目录 @(spring源码分析系列3:核心容器的研究) 在讲容器之前,再明确一下知识点. BeanDefinition是Bean在容器的描述.BeanDefinition与Bean不是一个东西. Be ...
- Mysql高手系列 - 第22篇:深入理解mysql索引原理,连载中
Mysql系列的目标是:通过这个系列从入门到全面掌握一个高级开发所需要的全部技能. 欢迎大家加我微信itsoku一起交流java.算法.数据库相关技术. 这是Mysql系列第22篇. 背景 使用mys ...
- php获取文件的文件名(误区)
文件路径:$path = '/home/files/1234.jpg'; php获取文件名,大家应该是轻车熟路了,写个小函数,分分钟 <?php //获取文件名 function get_fil ...
- ASP.NET Web API 2系列(三):查看WebAPI接口的详细说明及测试接口
引言 前边两篇博客介绍了Web API的基本框架以及路由配置,这篇博客主要解决在前后端分离项目中,为前端人员提供详细接口说明的问题,主要是通过修改WebApi HelpPage相关代码和添加WebAp ...
- group by 如何合并字符串优化记?
sqlserver 2005及以上版本 表(tb) id value 1 aa 2 cc 3 bb 3 dd 4 aa 4 cc 4 dd ...