在网络推广部门组建方案中可以快速做出分析并且制定方案的是哪一家公司

更多频道内容在这里查看
爱奇艺用户将能永久保存播放记录
过滤短视频
暂无长视频(电视剧、纪录片、动漫、综艺、电影)播放记录,
使用您的微博帐号登录,即刻尊享微博用户专属服务。
使用您的QQ帐号登录,即刻尊享QQ用户专属服务。
使用您的人人帐号登录,即刻尊享人人用户专属服务。
按住视频可进行拖动
把视频贴到Blog或BBS
当前浏览器仅支持手动复制代码
视频地址:
flash地址:
html代码:
通用代码:
通用代码可同时支持电脑和移动设备的分享播放
收藏成功,可进入查看所有收藏列表
方式1:用手机看
用爱奇艺APP或微信扫一扫,在手机上继续观看:
elasticsearch x-pack
方式2:一键下载至手机
限爱奇艺安卓6.0以上版本
使用微信扫一扫,扫描左侧二维码,下载爱奇艺移动APP
其他安装方式:手机浏览器输入短链接http://71.am/udn
下载安装包到本机:&&
设备搜寻中...
请确保您要连接的设备(仅限安卓)登录了同一爱奇艺账号 且安装并开启不低于V6.0以上版本的爱奇艺客户端
连接失败!
请确保您要连接的设备(仅限安卓)登录了同一爱奇艺账号 且安装并开启不低于V6.0以上版本的爱奇艺客户端
部安卓(Android)设备,请点击进行选择
请您在手机端下载爱奇艺移动APP(仅支持安卓客户端)
使用微信扫一扫,下载爱奇艺移动APP
其他安装方式:手机浏览器输入短链接http://71.am/udn
下载安装包到本机:&&
爱奇艺云推送
请您在手机端登录爱奇艺移动APP(仅支持安卓客户端)
使用微信扫一扫,下载爱奇艺移动APP
180秒后更新
打开爱奇艺移动APP,点击“我的-扫一扫”,扫描左侧二维码进行登录
没有安装爱奇艺视频最新客户端?
爸爸去哪儿2游戏 立即参与
elasticsearch x-pack
播放量数据:
9,406人已订阅
你可能还想订阅他们:
{{#needAdBadge}} 广告{{/needAdBadge}}
&正在加载...
您使用浏览器不支持直接复制的功能,建议您使用Ctrl+C或右键全选进行地址复制
安装爱奇艺视频客户端,
马上开始为您下载本片
5秒后自动消失
&li data-elem="tabtitle" data-seq="{{seq}}"& &a href="javascript:void(0);"& &span>{{start}}-{{end}}&/span& &/a& &/li&
&li data-downloadSelect-elem="item" data-downloadSelect-selected="false" data-downloadSelect-tvid="{{tvid}}"& &a href="javascript:void(0);"&{{pd}}&/a&
选择您要下载的《
色情低俗内容
血腥暴力内容
广告或欺诈内容
侵犯了我的权力
还可以输入
您使用浏览器不支持直接复制的功能,建议您使用Ctrl+C或右键全选进行地址复制你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
回复了问题 o 1 人关注 o 1 个回复 o 7 次浏览 o 9 分钟前
o 来自相关话题
回复了问题 o 2 人关注 o 1 个回复 o 29 次浏览 o 15 分钟前
o 来自相关话题
回复了问题 o 1 人关注 o 1 个回复 o 20 次浏览 o 3 分钟前
o 来自相关话题
回复了问题 o 6 人关注 o 5 个回复 o 2363 次浏览 o 10 小时前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 11 次浏览 o 10 小时前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 16 次浏览 o 12 小时前
o 来自相关话题
回复了问题 o 2 人关注 o 1 个回复 o 44 次浏览 o 23 小时前
o 来自相关话题
回复了问题 o 2 人关注 o 1 个回复 o 26 次浏览 o 1 天前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 87 次浏览 o 1 天前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 38 次浏览 o 1 天前
o 来自相关话题
30 个问题, 4 人关注
217 个问题, 87 人关注
7 个问题, 12 人关注
183 个问题, 116 人关注
1 个问题, 1 人关注
5 个问题, 0 次赞同
13 个问题, 1 次赞同
50 个问题, 14 次赞同
4 个问题, 0 次赞同
13 个问题, 64 次赞同
《Elasticsearch权威指南》中文版你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
回复了问题 o 1 人关注 o 1 个回复 o 7 次浏览 o 9 分钟前
o 来自相关话题
回复了问题 o 2 人关注 o 1 个回复 o 29 次浏览 o 15 分钟前
o 来自相关话题
回复了问题 o 1 人关注 o 1 个回复 o 20 次浏览 o 3 分钟前
o 来自相关话题
回复了问题 o 6 人关注 o 5 个回复 o 2363 次浏览 o 10 小时前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 11 次浏览 o 10 小时前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 16 次浏览 o 12 小时前
o 来自相关话题
回复了问题 o 2 人关注 o 1 个回复 o 44 次浏览 o 23 小时前
o 来自相关话题
回复了问题 o 2 人关注 o 1 个回复 o 26 次浏览 o 1 天前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 87 次浏览 o 1 天前
o 来自相关话题
发起了问题 o 1 人关注 o 0 个回复 o 38 次浏览 o 1 天前
o 来自相关话题
30 个问题, 4 人关注
217 个问题, 87 人关注
7 个问题, 12 人关注
183 个问题, 116 人关注
1 个问题, 1 人关注
21 个问题, 14 次赞同
4 个问题, 0 次赞同
6 个问题, 0 次赞同
6 个问题, 0 次赞同
14 个问题, 1 次赞同
《Elasticsearch权威指南》中文版ElasticSearch 5学习——安装Elasticsearch、Kibana和X-Pack-爱编程
ElasticSearch 5学习——安装Elasticsearch、Kibana和X-Pack
安装准备:
安装Elasticsearch唯一的要求是安装官方新版的Java,包括对应的Jdk。
首先到官网下载最新版本的Elasticsearch压缩包。
可以使用命令,注意将最新的可用的下载链接填入:
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.2.zip
unzip elasticsearch-5.0.2.zip
cd elasticsearch-5.0.2
Elasticsearch已经准备就绪,执行以下命令可在前台启动:
./bin/elasticsearch
如果想在后台以守护进程模式运行,添加-d参数。
打开另一个终端进行测试:
curl 'http://localhost:9200/?pretty'
你能看到以下返回信息:
"name": "vP19PMO",
"cluster_name": "elasticsearch",
"cluster_uuid": "IMKMfkMsSrKODIYg5gxgeQ",
"version": {
"number": "5.0.2",
"build_hash": "f6b4951",
"build_date": "T10:07:18.101Z",
"build_snapshot": false,
"lucene_version": "6.2.1"
"tagline": "You Know, for Search"
这说明你的ELasticsearch集群已经启动并且正常运行。
安装Kiabna
Kibana是一个为 ElasticSearch 提供的数据分析的 Web 接口。可使用它对日志进行高效的搜索、可视化、分析等各种操作。
首先到官网下载最新版本的Kiabna压缩包。
可以使用如下命令,注意将最新的可用的下载链接填入:
wget https://artifacts.elastic.co/downloads/kibana/kibana-5.1.1-linux-x86_64.tar.gz
sha1sum kibana-5.1.1-linux-x86_64.tar.gz
tar -xzf kibana-5.1.1-linux-x86_64.tar.gz
cd kibana/
可以在该地址获取下载链接,一定要选择对于系统和版本。
按照文档的要求,一般情况下kibana的版本必须和Elasticsearch安装的版本一致。
安装X-Pack
X-Pack是一个Elastic Stack的扩展,将安全,警报,监视,报告和图形功能包含在一个易于安装的软件包中。在Elasticsearch 5.0.0之前,您必须安装单独的Shield,Watcher和Marvel插件才能获得在X-Pack中所有的功能。
Elasticsearch 5.0.2
Kibana 5.0.2
在Es的根目录(每个节点),运行 bin/elasticsearch-plugin进行安装。
bin/elasticsearch-plugin install x-pack
安装过程中跳出选项现在y即可。
如果你在Elasticsearch已禁用自动索引的创建,在elasticsearch.yml配置action.auto_create_index允许X-pack创造以下指标:
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
运行Elasticsearch。
bin/elasticsearch
Kibana下载X-Pack
在Kibana根目录运行 bin/kibana-plugin 进行安装。
bin/kibana-plugin install x-pack
安装过程会比较久,耐心等待。
运行Kibana。
bin/kibana
验证X-Pack
在浏览器上输入: http://localhost:5601/ ,可以打开Kibana,此时需要输入用户名和密码登录,默认分别是 elastic 和 changeme。
安装参考:
每个操作系统安装Elasticsearch的文件选择不同,参考:,选择对应的文件下载。
安装Kiabna需要根据操作系统做选择,参考:,选择对应的文件下载。
安装X-Pack需要根据Elasticsearch安装不同的方式提供不同的安装方法,参考:。
在刚接触Elasticsearch的时候,会有很多名词不能理解,或者不知道其中的关系。其中很多是为不同版本的Elasticsearch而存在的。
Marvel插件:在簇中从每个节点汇集数据。这个插件必须每个节点都得安装。&
Marvel是Elasticsearch的管理和监控工具,在开发环境下免费使用。它包含了Sense。
交互式控制台,使用户方便的通过浏览器直接与Elasticsearch进行交互。
在学习Elasticsearch的过程中,必不可少需要通过一些工具查看es的运行状态以及数据。如果都是通过rest请求,未免太过麻烦,而且也不够人性化。此时,Head插件可以实现基本信息的查看,rest请求的模拟,数据的检索等等。
x-pack是elasticsearch的一个扩展包,将安全,警告,监视,图形和报告功能捆绑在一个易于安装的软件包中,也是官方推荐的。
kibana是一个与elasticsearch一起工作的开源的分析和可视化的平台。使用kibana可以查询、查看并与存储在elasticsearch索引的数据进行交互操作。使用kibana能执行高级的数据分析,并能以图表、表格和地图的形式查看数据。
kibana使得理解大容量的数据变得非常容易。它非常简单,基于浏览器的接口使我们能够快速的创建和分享显示elasticsearch查询结果实时变化的仪表盘。
在Elasticsearch 5版本之前,一般都是通过安装Kibana,而后将Marvel、Hand等各种功能插件添加到Kibana上使用。在Elasticsearch 5版本之后,一般情况下只需要安装一个官方推荐的X-pack扩展包即可。
版权所有 爱编程 (C) Copyright 2012. . All Rights Reserved.
闽ICP备号-3
微信扫一扫关注爱编程,每天为您推送一篇经典技术文章。炎风狼 的BLOG
用户名:炎风狼
文章数:10
访问量:1042
注册日期:
阅读量:5863
阅读量:12276
阅读量:378396
阅读量:1071063
51CTO推荐博文
目录一、 安装JAVA. 1二、 安装elasticsearch. 2三、 配置elasticsearch. 2四、 安装logstash. 3五、 配置 logstash. 3六、 安装kibana. 4七、 配置kibana. 5八、 安装x-pack插件... 5九、 x-pack管理用户... 61、 添加用户... 62、 查看用户... 63、 测试用户登录... 64、 删除用户... 6十、 安装filebeat. 7一、 安装JAVA#&mkdir&/usr/local/java/&Cp
#&cd&/usr/local/java/#&tar&zxvf&/data/elk5.0/jdk-8u111-linux-x64.tar.gz
#&cat&&&/etc/profile&&EOF
export&JAVA_HOME=/usr/local/java/jdk1.8.0_111
export&PATH=$PATH:$JAVA_HOME/bin
export&CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
#&source&/etc/profile
#&java&-version
java&version&"1.8.0_111"Java(TM)&SE&Runtime&Environment&(build&1.8.0_111-b14)
Java&HotSpot(TM)&64-Bit&Server&VM&(build&25.111-b14,&mixed&mode)二、 安装elasticsearch#&mkdir&/data/PRG/&-p
#&cd&/data/PRG/#&tar&zxvf&/data/elk5.0/elasticsearch-5.0.2.tar.gz
#&mv&elasticsearch-5.0.2&elasticsearch
#&useradd&elasticsearch&-s&/sbin/nologin
#&chown&elasticsearch.&elasticsearch&/data/PRG/elasticsearch/&&添加启动脚本vi /etc/init.d/elasticsearch#!/bin/sh#
#&elasticsearch&&summary&#
#&chkconfig:&&&#&description:&Starts&and&stops&a&single&elasticsearch&instance&on&this&system
###&BEGIN&INIT&INFO
#&Provides:&Elasticsearch
#&Required-Start:&$network&$named
#&Required-Stop:&$network&$named
#&Default-Start:&2&3&4&5#&Default-Stop:&0&1&6#&Short-Description:&This&service&manages&the&elasticsearch&daemon
#&Description:&Elasticsearch&is&a&very&scalable,&schema-free&and&high-performance&search&solution&supporting&multi-tenancy&and&near&realtime&search.
###&END&INIT&INFO
#&init.d&/&servicectl&compatibility&(openSUSE)
#if&[&-f&/etc/rc.status&];&then.&/etc/rc.status
&&&&rc_resetfi#
#&Source&function&library.
#if&[&-f&/etc/rc.d/init.d/functions&];&then.&/etc/rc.d/init.d/functionsfi#&Sets&the&default&values&for&elasticsearch&variables&used&in&this&script
ES_USER="elasticsearch"ES_GROUP="elasticsearch"ES_HOME="/data/PRG/elasticsearch"MAX_OPEN_FILES=65536MAX_MAP_COUNT=262144LOG_DIR="/var/log/elasticsearch"DATA_DIR="/var/lib/elasticsearch"CONF_DIR="/data/PRG/elasticsearch/config"PID_DIR="/var/run/elasticsearch"#&Source&the&default&env&fileES_ENV_FILE="/etc/sysconfig/elasticsearch"if&[&-f&"$ES_ENV_FILE"&];&then.&"$ES_ENV_FILE"fi#&CONF_FILE&setting&was&removedif&[&!&-z&"$CONF_FILE"&];&thenecho&"CONF_FILE&setting&is&no&longer&supported.&elasticsearch.yml&must&be&placed&in&the&config&directory&and&cannot&be&renamed."exit&1fiexec="$ES_HOME/bin/elasticsearch"prog="elasticsearch"pidfile="$PID_DIR/${prog}.pid"export&ES_HEAP_SIZE
export&ES_HEAP_NEWSIZE
export&ES_DIRECT_SIZE
export&ES_JAVA_OPTS
export&ES_GC_LOG_FILE
export&ES_STARTUP_SLEEP_TIME
export&JAVA_HOME
export&ES_INCLUDElockfile=/var/lock/subsys/$prog
#&backwards&compatibility&for&old&config&sysconfig&files,&pre&0.90.1if&[&-n&$USER&]&&&&[&-z&$ES_USER&]&;&then
&&&ES_USER=$USERficheckJava()&{if&[&-x&"$JAVA_HOME/bin/java"&];&thenJAVA="$JAVA_HOME/bin/java"elseJAVA=`which&java`fiif&[&!&-x&"$JAVA"&];&thenecho&"Could&not&find&any&executable&java&binary.&Please&install&java&in&your&PATH&or&set&JAVA_HOME"exit&1fi}
&&&&checkJava
&&&&[&-x&$exec&]&||&exit&5if&[&-n&"$MAX_LOCKED_MEMORY"&-a&-z&"$ES_HEAP_SIZE"&];&thenecho&"MAX_LOCKED_MEMORY&is&set&-&ES_HEAP_SIZE&must&also&be&set"return&7fiif&[&-n&"$MAX_OPEN_FILES"&];&thenulimit&-n&$MAX_OPEN_FILESfiif&[&-n&"$MAX_LOCKED_MEMORY"&];&thenulimit&-l&$MAX_LOCKED_MEMORYfiif&[&-n&"$MAX_MAP_COUNT"&-a&-f&/proc/sys/vm/max_map_count&];&thensysctl&-q&-w&vm.max_map_count=$MAX_MAP_COUNTfiexport&ES_GC_LOG_FILE
&&&&#&Ensure&that&the&PID_DIR&exists&(it&is&cleaned&at&OS&startup&time)if&[&-n&"$PID_DIR"&]&&&&[&!&-e&"$PID_DIR"&];&thenmkdir&-p&"$PID_DIR"&&&&chown&"$ES_USER":"$ES_GROUP"&"$PID_DIR"fiif&[&-n&"$pidfile"&]&&&&[&!&-e&"$pidfile"&];&thentouch&"$pidfile"&&&&chown&"$ES_USER":"$ES_GROUP"&"$pidfile"ficd&$ES_HOMEecho&-n&$"Starting&$prog:&"#&if&not&running,&start&it&up&here,&usually&something&like&"daemon&$exec"daemon&--user&$ES_USER&&--pidfile&$pidfile&$exec&-p&$pidfile&-d
&&&&#daemon&--user&$ES_USER&--pidfile&$pidfile&$exec&-p&$pidfile&-d&-Des.default.path.home=$ES_HOME&-Des.default.path.logs=$LOG_DIR&-Des.default.path.data=$DATA_DIR&-Des.default.path.conf=$CONF_DIR
&&&&retval=$?echo[&$retval&-eq&0&]&&&&touch&$lockfilereturn&$retval
stop()&{echo&-n&$"Stopping&$prog:&"#&stop&it&here,&often&"killproc&$prog"killproc&-p&$pidfile&-d&86400&$prog
&&&&retval=$?echo[&$retval&-eq&0&]&&&&rm&-f&$lockfilereturn&$retval
restart()&{
reload()&{
&&&&restart
force_reload()&{
&&&&restart
rh_status()&{
&&&&#&run&checks&to&determine&if&the&service&is&running&or&use&generic&status
&&&&status&-p&$pidfile&$prog
rh_status_q()&{
&&&&rh_status&&/dev/null&2&&1}case&"$1"&instart)
&&&&&&&&rh_status_q&&&&exit&0$1;;
&&&&&&&&rh_status_q&||&exit&0$1;;
&&&&restart)
&&&&&&&&$1;;
&&&&reload)
&&&&&&&&rh_status_q&||&exit&7$1;;
&&&&force-reload)
&&&&&&&&force_reload
&&&&&&&&;;
&&&&status)
&&&&&&&&rh_status
&&&&&&&&;;
&&&&condrestart|try-restart)
&&&&&&&&rh_status_q&||&exit&0restart
&&&&&&&&;;*)echo&$"Usage:&$0&{start|stop|status|restart|condrestart|try-restart|reload|force-reload}"exit&2esacexit&$?&#&chmod&+x&/etc/init.d/elasticsearch
#&/etc/init.d/elasticsearch&start
#&/etc/init.d/elasticsearch&status
elasticsearch&(pid&20895)&is&running...
#&netstat&-ntlp&|grep&9[2-3]00tcp&0&0&:::9300&:::*&LISTEN&20895/java
tcp&0&0&:::9200&:::*&LISTEN&20895/java三、 配置elasticsearch内存低于2G,需要修改jvm配置-Xms512m-Xmx512m#&cat&/data/PRG/elasticsearch/config/elasticsearch.yml&|grep&-v&'#'network.host:&0.0.0.0&###开启监听地址,
action.auto_create_index:&.security,.monitoring*,.watches,.triggered_watches,.watcher-history*####以下模块视情况是否开启
xpack.security.enabled:&true&####开启用户认证
xpack.monitoring.enabled:&truexpack.graph.enabled:&truexpack.watcher.enabled:&truexpack.security.authc.realms:&####用户认证模式,ldap、file、pki、Active&Directory等
type:&fileorder:&0四、 安装logstash&#&cd&/data/PRG/#&tar&zxvf&/data/elk5.0/logstash-5.0.2.tar.gz
#&mv&logstash-5.0.2&logstash
#&useradd&logstash&-s&/sbin/nologin
#&chown&logstash.&logstash&/data/PRG/logstash添加启动脚本vim /etc/init.d/logstash#!/bin/sh#&Init&script&for&logstash
#&Maintained&by&Elasticsearch
#&Generated&by&pleaserun.
#&Implemented&based&on&LSB&Core&3.1:
#&&&*&Sections:&20.2,&20.3#
###&BEGIN&INIT&INFO
#&Provides:&&&&&&&&&&logstash
#&Required-Start:&&&&$remote_fs&$syslog
#&Required-Stop:&&&&&$remote_fs&$syslog
#&Default-Start:&&&&&2&3&4&5#&Default-Stop:&&&&&&0&1&6#&Short-Description:
#&Description:&&&&&&&&Starts&Logstash&as&a&daemon.
###&END&INIT&INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export&PATHif&[&`id&-u`&-ne&0&];&then
&&&echo&"You&need&root&privileges&to&run&this&script"
&&&exit&1finame=logstash
pidfile="/var/run/$name.pid"LS_USER=logstash
LS_GROUP=logstash
LS_HOME=/var/lib/logstash
LS_HEAP_SIZE="1g"LS_LOG_DIR=/var/log/logstash
LS_LOG_FILE="${LS_LOG_DIR}/$name.log"LS_CONF_DIR=/etc/logstash/conf.d
LS_OPEN_FILES=16384LS_NICE=19KILL_ON_STOP_TIMEOUT=${KILL_ON_STOP_TIMEOUT-0}&#default&value&is&zero&to&this&variable&but&could&be&updated&by&user&request
LS_OPTS=""[&-r&/etc/default/$name&]&&&&.&/etc/default/$name
[&-r&/etc/sysconfig/$name&]&&&&.&/etc/sysconfig/$name
program=/opt/logstash/bin/logstash
args="agent&-f&${LS_CONF_DIR}&-l&${LS_LOG_FILE}&${LS_OPTS}"quiet()&{&&"$@"&&&/dev/null&2&&1
&&return&$?}
&&LS_JAVA_OPTS="${LS_JAVA_OPTS}&-Djava.io.tmpdir=${LS_HOME}"
&&HOME=${LS_HOME}
&&export&PATH&HOME&LS_HEAP_SIZE&LS_JAVA_OPTS&LS_USE_GC_LOGGING&LS_GC_LOG_FILE
&&#&chown&doesn't&grab&the&suplimental&groups&when&setting&the&user:group&-&so&we&have&to&do&it&for&it.
&&#&Boy,&I&hope&we're&root&here.
&&SGROUPS=$(id&-Gn&"$LS_USER"&|&tr&"&"&","&|&sed&'s/,$//';&echo&'')&&if&[&!&-z&$SGROUPS&]&&thenEXTRA_GROUPS="--groups&$SGROUPS"
&&#&set&ulimit&as&(root,&presumably)&first,&before&we&drop&privileges
&&ulimit&-n&${LS_OPEN_FILES}
&&#&Run&the&program!&&nice&-n&${LS_NICE}&chroot&--userspec&$LS_USER:$LS_GROUP&$EXTRA_GROUPS&/&sh&-c&"&&&&cd&$LS_HOME
&&&&ulimit&-n&${LS_OPEN_FILES}
&&&&exec&\"$program\"&$args
&&"&&&"${LS_LOG_DIR}/$name.stdout"&2&&"${LS_LOG_DIR}/$name.err"&&
&&#&Generate&the&pidfile&from&here.&If&we&instead&made&the&forked&process
&&#&generate&it&there&will&be&a&race&condition&between&the&pidfile&writing
&&#&and&a&process&possibly&asking&for&status.&&echo&$!&&&$pidfile&&echo&"$name&started."
&&return&0}
&&#&Try&a&few&times&to&kill&TERM&the&program&&if&status&;&thenpid=`cat&"$pidfile"`echo&"Killing&$name&(pid&$pid)&with&SIGTERM"kill&-TERM&$pid
&&&&#&Wait&for&it&to&exit.for&i&in&1&2&3&4&5&6&7&8&9&;&do&&echo&"Waiting&$name&(pid&$pid)&to&die..."&&status&||&break&&&&&&sleep&1doneif&status&;&then&&if&[&$KILL_ON_STOP_TIMEOUT&-eq&1&]&;&thenecho&"Timeout&reached.&Killing&$name&(pid&$pid)&with&SIGKILL.&This&may&result&in&data&loss."kill&-KILL&$pidecho&"$name&killed&with&SIGKILL."&&elseecho&"$name&stop&&still&running."return&1&#&stop&timed&out&and&not&forced&&&&&&fielse&&echo&"$name&stopped."fi
status()&{&&if&[&-f&"$pidfile"&]&;&thenpid=`cat&"$pidfile"`if&kill&-0&$pid&&&/dev/null&2&&/dev/null&;&then&&#&process&by&this&pid&is&running.
&&&&&&#&It&may&not&be&our&pid,&but&that's&what&you&get&with&just&pidfiles.&&#&TODO(sissel):&Check&if&this&process&seems&to&be&the&same&as&the&one&we
&&&&&&#&expect.&It'd&be&nice&to&use&flock&here,&but&flock&uses&fork,&not&exec,&&#&so&it&makes&it&quite&awkward&to&use&in&this&case.
&&&&&&return&0else&&return&2&#&program&is&dead&but&pid&file&existsfi
&&elsereturn&3&#&program&is&not&running&&fi}
reload()&{&&if&status&;&thenkill&-HUP&`cat&"$pidfile"`&&fi}
force_stop()&{&&if&status&;&thenstop
&&&&status&&&&kill&-KILL&`cat&"$pidfile"`&&fi}
configtest()&{
&&#&Check&if&a&config&file&exists&&if&[&!&"$(ls&-A&${LS_CONF_DIR}/*&2&&/dev/null)"&];&thenecho&"There&aren't&any&configuration&files&in&${LS_CONF_DIR}"return&1
&&HOME=${LS_HOME}
&&export&PATH&HOME
&&test_args="--configtest&-f&${LS_CONF_DIR}&${LS_OPTS}"
&&$program&${test_args}
&&[&$?&-eq&0&]&&&&return&0
&&#&Program&not&configured
&&return&6}case&"$1"&in
&&&&status
&&&&code=$?if&[&$code&-eq&0&];&then&&echo&"$name&is&already&running"else&&start
&&&&&&code=$?fiexit&$code
&&stop)&stop&;;
&&force-stop)&force_stop&;;
&&&&status
&&&&code=$?if&[&$code&-eq&0&]&;&then&&echo&"$name&is&running"else&&echo&"$name&is&not&running"fiexit&$code
&&reload)&reload&;;
&&restart)
&&&&quiet&configtest
&&&&RET=$?if&[&${RET}&-ne&0&];&then&&echo&"Configuration&error.&Not&restarting.&Re-run&with&configtest&parameter&for&details"&&exit&${RET}fistop&&&&start
&&configtest)
&&&&configtest
&&&&exit&$?;;&&*)echo&"Usage:&$SCRIPTNAME&{start|stop|force-stop|status|reload|restart|configtest}"&&&2exit&3
&&;;esacexit&$?&#&chmod&+x&/etc/init.d/logstash
#&/etc/init.d/logstash&start
#&/etc/init.d/logstash&status
logstash&is&running
#&netstat&-ntlp|grep&9600tcp&0&0&:::9600&:::*&LISTEN&10141/java五、 配置 logstash#&cat&/data/PRG/logstash/config/logstash.yml&|grep&-v&'#'http.host:&"0.0.0.0"&###开启监听地址&nginx日志收集
&#&cat&/data/PRG/logstash/conf.d/filter.conf&
port&=&&10200}
match&=&&{
message&=&&"%{IPORHOST:remote_addr}&,&\[%{HTTPDATE:timestamp}\]&,&%{IPORHOST:http_host}&,&\"%{WORD:http_verb}&(?:%{PATH:baseurl}\?%{NOTSPACE:params}|%{DATA:raw_http_request})\"&,&%{NUMBER:http_status_code}&,&%{NUMBER:bytes_read}&,&%{QS:referrer}&,&%{QS:agent}&,&\"%{IPORHOST:client_ip},&%{IPORHOST:proxy_server}\"&,&-&,&-&,&-&,&%{IPORHOST:server_ip}&,&%{BASE10NUM:request_duration}"&}
match&=&&{
message&=&&"%{IPORHOST:remote_addr}&,&\[%{HTTPDATE:timestamp}\]&,&%{IPORHOST:http_host}&,&\"%{WORD:http_verb}&(?:%{PATH:baseurl}\?%{NOTSPACE:params}|%{DATA:raw_http_request})\"&,&%{NUMBER:http_status_code}&,&%{NUMBER:bytes_read}&,&%{QUOTEDSTRING:referrer}&,&%{QS:agent}&,&\"%{IPORHOST:client_ip},&%{IPORHOST:proxy_server}\"&,&%{IPORHOST}:%{INT}&,&%{INT}&,&%{BASE10NUM}&,&%{IPORHOST}&,&%{BASE10NUM:request_duration}"&}
elasticsearch&{
hosts&=&&["192.168.62.200:9200"]
index&=&&"operation-%{+YYYY.MM.dd}"document_type&=&&"nginx2"user&=&&'admin'&####&elasticsearch的用户名,用X-PACK插件创建
password&=&&'kbsonlong'&####&elasticsearch的用户名
stdout&{&codec&=&&rubydebug&}
&&六、 安装kibana&#&cd&/data/PRG/#&tar&zxvf&/data/elk5.0/kibana-5.0.2-linux-x86_64.tar.gz
#&mv&kibana-5.0.2-linux-x86_64&kibana
#&useradd&kibana&Cs&/sbin/nologin
#&chown&kibana.&kibana&/data/PRG/kibana添加启动脚本# vim /etc/init.d/kibana#!/bin/sh#&Init&script&for&kibana
#&Maintained&by&
#&Generated&by&pleaserun.
#&Implemented&based&on&LSB&Core&3.1:
#&&&*&Sections:&20.2,&20.3#
###&BEGIN&INIT&INFO
#&Provides:&&&&&&&&&&kibana
#&Required-Start:&&&&$remote_fs&$syslog
#&Required-Stop:&&&&&$remote_fs&$syslog
#&Default-Start:&&&&&2&3&4&5#&Default-Stop:&&&&&&0&1&6#&Short-Description:&
#&Description:&&&&&&&Kibana
###&END&INIT&INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export&PATH
KIBANA_HOME=/data/PRG/kibana
name=kibana
program=$KIBANA_HOME/bin/kibana
args=''pidfile="$KIBANA_HOME/logs/$name.pid"LOG_HOME="$KIBANA_HOME/logs"[&-r&/etc/default/$name&]&&&&.&/etc/default/$name
[&-r&/etc/sysconfig/$name&]&&&&.&/etc/sysconfig/$name
[&-z&"$nice"&]&&&&nice=0trace()&{
&&logger&-t&"/etc/init.d/kibana"&"$@"}
&&trace&"$@"
&&echo&"$@"}
&&#&Ensure&the&log&directory&is&setup&correctly.
&&[&!&-d&"$LOG_HOME"&]&&&&mkdir&"$LOG_HOME"
&&chmod&755&"$LOG_HOME"
&&#&Setup&any&environmental&stuff&beforehand
&&#&Run&the&program!
&&#chroot&--userspec&"$user":"$group"&"$chroot"&sh&-c&"&&&&
&&$program&$args&&&&$LOG_HOME/kibana.stdout&2&&&$LOG_HOME/kibana.stderr&&
&&#&Generate&the&pidfile&from&here.&If&we&instead&made&the&forked&process
&&#&generate&it&there&will&be&a&race&condition&between&the&pidfile&writing
&&#&and&a&process&possibly&asking&for&status.&&echo&$!&&&$pidfile
&&emit&"$name&started"
&&return&0}
&&#&Try&a&few&times&to&kill&TERM&the&program&&if&status&;&thenpid=$(cat&"$pidfile")echo&"Killing&$name&(pid&$pid)&with&SIGTERM"ps&-ef&|grep&$pid&|grep&-v&'grep'&|awk&'{print&$2}'&|&xargs&kill&-9#&Wait&for&it&to&exit.for&i&in&1&2&3&4&5&;&do&&trace&"Waiting&$name&(pid&$pid)&to&die..."&&status&||&break&&&&&&sleep&1doneif&status&;&then&&if&[&"$KILL_ON_STOP_TIMEOUT"&-eq&1&]&;&thentrace&"Timeout&reached.&Killing&$name&(pid&$pid)&with&SIGKILL.&&This&may&result&in&data&loss."kill&-KILL&$pid
&&&&&&&&emit&"$name&killed&with&SIGKILL."&&elseemit&"$name&stop&&still&running."&&fielse&&emit&"$name&stopped."fi
status()&{&&if&[&-f&"$pidfile"&]&;&thenpid=$(cat&"$pidfile")if&ps&-p&$pid&&&/dev/null&2&&/dev/null&;&then&&#&process&by&this&pid&is&running.
&&&&&&#&It&may&not&be&our&pid,&but&that's&what&you&get&with&just&pidfiles.&&#&TODO(sissel):&Check&if&this&process&seems&to&be&the&same&as&the&one&we
&&&&&&#&expect.&It'd&be&nice&to&use&flock&here,&but&flock&uses&fork,&not&exec,&&#&so&it&makes&it&quite&awkward&to&use&in&this&case.
&&&&&&return&0else&&return&2&#&program&is&dead&but&pid&file&existsfi
&&elsereturn&3&#&program&is&not&running&&fi}case&"$1"&in
&&force-start|start|stop|status|restart)
&&&&trace&"Attempting&'$1'&on&kibana";;esaccase&"$1"&in
&&force-start)
&&&&PRESTART=no
&&&&exec&"$0"&start
&&&&status
&&&&code=$?if&[&$code&-eq&0&];&then&&emit&"$name&is&already&running"&&exit&$codeelse&&start
&&&&&&exit&$?;
&&stop)&stop&;;
&&&&status
&&&&code=$?if&[&$code&-eq&0&]&;&then&&emit&"$name&is&running"else&&emit&"$name&is&not&running"fiexit&$code
&&restart)
&&&&stop&&&&start
&&&&;;&&*)echo&"Usage:&$SCRIPTNAME&{start|force-start|stop|force-start|force-stop|status|restart}"&&&2exit&3
&&;;esacexit&$?#&chmod&+x&/etc/init.d/kibana
#&/etc/init.d/kibana&start&
#&/etc/init.d/kibana&status
#&netstat&-ntlp&|grep&5601tcp&0&0&0.0.0.0:.0.0:*&LISTEN&13052/node七、 配置kibana#&cat&/data/PRG/kibana/config/kibana.yml&|grep&-v&'#'server.host:&"0.0.0.0"####以下模块视情况是否开启
xpack.security.enabled:&truexpack.monitoring.enabled:&truexpack.graph.enabled:&truexpack.reporting.enabled:&true八、 安装x-pack插件#&/data/PRG/kibana/bin/kibana-plugin&install&file:///root/x-pack-5.0.0.zip#&/data/PRG/elasticsearch/bin/elasticsearch-plugin&install&file:///root/x-pack-5.0.0.zip离线安装x-pack要修改用户脚本,默认创建用户配置文件在/etc/elasticsearch/x-pack目录在创建用户的时候提示/etc/elasticsearch/x-pack/users…tmp不存在,直接创建目录或者修改/data/PRG/elasticsearch/bin/x-pack/users脚本#&mkdir&/etc/elasticsearch/x-pack/#&chown&elasticsearch.&elasticsearch&/etc/elasticsearch/x-pack/&-R九、 1、 添加用户#&cd&/data/PRG/elasticsearch
#&bin/x-pack/users&useradd&admin&-p&kbsonlong&-r&superuser2、 查看用户#&/data/PRG/elasticsearch/bin/x-pack/users&list
admin&:&superusertest : - ###创建用户时没有添加-r参数,所以没有用户角色3、 测试用户登录#&curl&http://localhost:9200/_xpack/&--user&admin:kbsonlong{"build":{"hash":"7763f8e","date":"T04:51:59.202Z"},"license":{"uid":"06a82587-66ac-4d4a-90c4-857d9ca7f3bc","type":"trial","mode":"trial","status":"active","expiry_date_in_millis":6},"features":{"graph":{"description":"Graph&Data&Exploration&for&the&Elastic&Stack","available":true,"enabled":true},"monitoring":{"description":"Monitoring&for&the&Elastic&Stack","available":true,"enabled":true},"security":{"description":"Security&for&the&Elastic&Stack","available":true,"enabled":true},"watcher":{"description":"Alerting,&Notification&and&Automation&for&the&Elastic&Stack","available":true,"enabled":true}},"tagline":"You&know,&for&X"}4、 删除用户#&/data/PRG/elasticsearch/bin/x-pack/users&userdel&test
#&/data/PRG/elasticsearch/bin/x-pack/users&list
admin&:&superuser十、 安装filebeat#&cd&/data/PRG
#&tar&zxvf&/&data/elk5.0/filebeat-5.0.0-linux-x86_64.tar.gz
#&mv&filebeat-5.0.0-linux-x86_64&filebeat&配置启动脚本# vim /etc/init.d/filebeat&#!/bin/bash
#&filebeat&&&&&&&&&&filebeat&shipper
#&chkconfig:&#
###&BEGIN&INIT&INFO
#&Provides:&&&&&&&&&&filebeat
#&Required-Start:&&&&$local_fs&$network&$syslog
#&Required-Stop:&&&&&$local_fs&$network&$syslog
#&Default-Start:&&&&&2&3&4&5#&Default-Stop:&&&&&&0&1&6#&Short-Description:&Sends&log&files&to&Logstash&or&directly&to&Elasticsearch.
#&Description:&&&&&&&filebeat&is&a&shipper&part&of&the&Elastic&Beats&
#&&&&&&&&&&&&&&&&&&&&&family.&Please&see:&https://www.elastic.co/products/beats###&END&INIT&INFO
PATH=/usr/bin:/sbin:/bin:/usr/sbin
export&PATH
[&-f&/etc/sysconfig/filebeat&]&&&&.&/etc/sysconfig/filebeat
pidfile=${PIDFILE-/data/PRG/filebeat/filebeat.pid}
agent=${PB_AGENT-/data/PRG/filebeat/filebeat}
args="-c&/data/PRG/filebeat/filebeat.yml"test_args="-e&-configtest"wrapper="filebeat-god"wrapperopts="-r&/&-n&-p&$pidfile"RETVAL=0#&Source&function&library.
.&/etc/rc.d/init.d/functions
#&Determine&if&we&can&use&the&-p&option&to&daemon,&killproc,&and&status.
#&RHEL&&&5&can't.if&status&|&grep&-q&--&'-p'&2&/dev/&thendaemonopts="--pidfile&$pidfile"pidopts="-p&$pidfile"fitest()&{
&&&&$agent&$args&$test_args
start()&{echo&-n&$"Starting&filebeat:&"testif&[&$?&-ne&0&];&thenechoexit&1fidaemon&$daemonopts&$wrapper&$wrapperopts&--&$agent&$args
&&&&RETVAL=$?echoreturn&$RETVAL
stop()&{echo&-n&$"Stopping&filebeat:&"killproc&$pidopts&$wrapper
&&&&RETVAL=$?echo[&$RETVAL&=&0&]&&&&rm&-f&${pidfile}
restart()&{
&&&&testif&[&$?&-ne&0&];&thenreturn&1fistop
rh_status()&{
&&&&status&$pidopts&$wrapper
&&&&RETVAL=$?return&$RETVAL
rh_status_q()&{
&&&&rh_status&&/dev/null&2&&1}case&"$1"&instart)
&&&&&&&&start
&&&&&&&&stop
&&&&restart)
&&&&&&&&restart
&&&&condrestart|try-restart)
&&&&&&&&rh_status_q&||&exit&0restart
&&&&status)
&&&&&&&&rh_status
&&&&;;*)echo&$"Usage:&$0&{start|stop|status|restart|condrestart}"exit&1esacexit&$RETVAL&# cat filebeat/filebeat.yml |grep -v '#'filebeat.prospectors:
-&input_type:&log
-&/tmp/nginx.log
output.logstash:
enabled:&true
hosts:&["localhost:10200"]启动filebeat#&/etc/init.d/filebeat5&start
Starting&filebeat:&&07:18:37.177631&beat.go:264:&INFO&Home&path:&[/data/PRG/filebeat]&Config&path:&[/data/PRG/filebeat]&Data&path:&[/data/PRG/filebeat/data]&Logs&path:&[/data/PRG/filebeat/logs]&07:18:37.177681&beat.go:174:&INFO&Setup&Beat:&&Version:&5.0.&07:18:37.177760&logstash.go:90:&INFO&Max&Retries&set&to:&&07:18:37.177828&outputs.go:106:&INFO&Activated&logstash&as&output&plugin.&07:18:37.177912&publish.go:291:&INFO&Publisher&name:&operation&07:18:37.178158&async.go:63:&INFO&Flush&Interval&set&to:&1s&07:18:37.178170&async.go:64:&INFO&Max&Bulk&Size&set&to:&2048Config&OK
#&/etc/init.d/filebeat5&status
filebeat-god&(pid&7365)&is&running...
#&ps&-ef&|grep&filebeat
root&&15:18&pts/1&00:00:00&filebeat-god&-r&/&-n&-p&/data/PRG/filebeat/filebeat.pid&--&/data/PRG/filebeat/filebeat&-c&/data/PRG/filebeat/filebeat.yml
root&&15:18&pts/1&00:00:00&/data/PRG/filebeat/filebeat&-c&/data/PRG/filebeat/filebeat.yml
#&netstat&-ntlp&|&egrep&'01|'tcp&0&0&0.0.0.0:.0.0:*&LISTEN&14339/node
tcp&0&0&:::9300&:::*&LISTEN&14205/java
tcp&0&0&:::10200&:::*&LISTEN&14309/java
tcp&0&0&::ffff:127.0.0.1:9600&:::*&LISTEN&14309/java
tcp&0&0&:::9200&:::*&LISTEN&14205/java本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)

我要回帖

更多关于 网络推广运营方案 的文章

 

随机推荐