当前位置: 首页 > news >正文

网站建设编程语言wordpress网站地图

网站建设编程语言,wordpress网站地图,视觉传播设计与制作,手机编码制网站1、下载安装包 使用华为镜像站下载速度很快#xff0c;华为镜像站#xff1a;https://mirrors.huaweicloud.com/home#xff0c;下载时需要保证版本一致 2、安装elasticsearch 解压到当前目录 [rootlocalhost elk]# tar zxvf elasticsearch-7.4.2-linux-x86_64.tar.gz 安…1、下载安装包 使用华为镜像站下载速度很快华为镜像站https://mirrors.huaweicloud.com/home下载时需要保证版本一致 2、安装elasticsearch 解压到当前目录 [rootlocalhost elk]# tar zxvf elasticsearch-7.4.2-linux-x86_64.tar.gz 安装将Elasticsearch移动到/opt目录之中 [rootlocalhost elk]# mv elasticsearch-7.4.2 /opt创建Elasticsearch用户 es 规定 root 用户不能启动 es所以需要新建一个其他用户来启动 es修改配置文件 添加用户 [rootlocalhost elk]# adduser es设定密码 [rootlocalhost elk]# passwd es添加权限 [rootlocalhost elk]# chown -R es /opt/elasticsearch-7.4.2修改配置文件 进入 /opt/elasticsearch-7.4.2/config/修改elasticsearch.yml文件 [rootlocalhost ~]# cd /opt/elasticsearch-7.4.2/config/ 取消如下注释并修改为当前主机地址 cluster.name: my-applicationnode.name: node-1bootstrap.memory_lock: falsenetwork.host: 192.168.75.143http.port: 9200discovery.zen.ping.unicast.hosts: [192.168.75.143] discovery.zen.minimum_master_nodes: 1 #注意因为本人目前是单节点这里必须为1新增如下配置: transport.tcp.port: 9300 transport.tcp.compress: true bootstrap.system_call_filter: false使用vi编辑器修改/etc/sysctl.conf文件添加如下代码(若无将会出现下面常见问题2) vm.max_map_count262144退出保存后执行如下命令: sysctl -p修改/etc/security/limits.conf文件在文件末尾添加如下代码(若无将会出现下面常见问题3): # es为登录服务器的用户名 essoft nofile 65536 eshard nofile 65536 essoft nproc 4096 eshard nproc 40963、启动Elasticsearch 切换用户 su solin查看当前用户 who am i启动服务 [eslocalhost ~]$ /opt/elasticsearch-7.4.2/bin/elasticsearch后台启动 [eslocalhost ~]$ /opt/elasticsearch-7.4.2/bin/elasticsearch -d测试是否启动成功 [rootlocalhost ~]# curl 192.168.75.143:9200 报错需要按照JAVA11 future versions of Elasticsearch will require Java 11; your Java version from [/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b08-1.el7_9.x86_64/jre] does not meet this requirement选择11版本 [eslocalhost ~]$ yum search java| grep jdk [rootlocalhost elk]# yum install java-11-openjdk-devel.x86_64java环境配置参考https://www.voidking.com/dev-install-jdk-on-all-platforms/ export JAVA_HOME/usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el7_9.x86_64 export CLASSPATH$JAVA_HOME/lib:$CLASSPATH export PATH$JAVA_HOME/bin:$PATH报错2 could not find java in JAVA_HOME or bundled at /usr/lib/jvm/java-1.8.0/bin/java解决办法 切换到普通用户es下执行source /etc/profile刷新配置 报错3 OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.警告信息不影响es的启动如果要去掉警告则需要修改es config下面的jvm.options文件中的属性定义字段把-XX:UseConcMarkSweepGC修改成 [rootlocalhost config]# vim jvm.options -XX:UseG1GC设置允许其他机器访问 当前只能响应本机的请求想要其他机器也能访问的话那么需要修改elasticsearch的配置。 [rootlocalhost ~]# vim /opt/elasticsearch-7.4.2/config/elasticsearch.yml # line 17, uncomment cluster.name: my-application # line 22, uncomment and change node.name: master # line 55, uncomment and change network.host: 0.0.0.0 # line 59, uncomment ttp.port: 9200 # line 72, uncomment and change cluster.initial_master_nodes: [master, node-2]重启Elasticsearch 如果可以看到:::9200就可以通过外部浏览器访问Elasticsearch服务了至此Elasticsearch安装配置完成。 4、Logstash安装 Logstash 工作原理 Logstash使用管道方式进行日志的搜集处理和输出。 有点类似Linux系统的管道命令 aaa| bbb | cccaaa执行完了会执行bbb然后执行ccc。 在logstash中包括了三个阶段: 输入input -- 处理filter不是必须的 -- 输出output 配置文件也是按这个顺序进行配置的。 解压安装包到当前目录 [rootlocalhost elk]# tar zxvf logstash-7.4.2.tar.gz 移动安装目录到opt目录下 [rootlocalhost elk]# mv logstash-7.4.2 /opt拷贝 config 目录下的 logstash-sample.conf改名为 logstash.conf修改其配置内容如下 简单解释一下这段配置 1、input 块是 logstash 接收日志时的一些配置output 是 logstash 往 elasticsearch 输送日志的配置 2、input.host 是运行 logstash 的服务器的 ipinput.port 是 logstash 的运行端口可以自己定义 3、output.hosts 的 elasticsearch 的 ip 和端口这是个数组多个用逗号隔开由于我们没有修改 elasticsearch 的配置它默认就是 9200 端口output.index 是索引 4、修改完配置进入 bin 目录指定配置文件启动即可例如./logstash -f ../config/logstash.conf如果是 windows 版本执行logstash.bat -f …/config/logstash.conf即可。 [rootlocalhost bin]# ./logstash -f ../config/logstash.conf5、kibana安装 下载后解压然后拷贝一份 config 目录下的 kibana.yml根据自己的需要可以修改配置比如端口默认5601、host、elasticsearch.hosts默认localhost:9200等。我这里都用默认的没有修改。 到 bin 目录下执行 ./kibana就可以启动了windows 执行 kibana.bat即可。 启动完访问 localhost:5601看到如下界面就启动成功了。 kibana.yml配置文件常用配置说明 server.port:默认值: 5601 Kibana 由后端服务器提供服务该配置指定使用的端口号。 server.host:默认值: localhost 指定后端服务器的主机地址。 server.basePath:如果启用了代理指定 Kibana 的路径该配置项只影响 Kibana 生成的 URLs转发请求到 Kibana 时代理会移除基础路径值该配置项不能以斜杠 (/)结尾。 server.maxPayloadBytes:默认值: 1048576 服务器请求的最大负载单位字节。 server.name:默认值: 您的主机名 Kibana 实例对外展示的名称。 server.defaultRoute:默认值: /app/kibana Kibana 的默认路径该配置项可改变 Kibana 的登录页面。 elasticsearch.url:默认值: http://localhost:9200 用来处理所有查询的 Elasticsearch 实例的 URL 。 elasticsearch.preserveHost:默认值: true 该设置项的值为 true 时Kibana 使用 server.host 设定的主机名该设置项的值为 false 时Kibana 使用主机的主机名来连接 Kibana 实例。 kibana.index:默认值: .kibana Kibana 使用 Elasticsearch 中的索引来存储保存的检索可视化控件以及仪表板。如果没有索引Kibana 会创建一个新的索引。 kibana.defaultAppId:默认值: discover 默认加载的应用。 tilemap.url:Kibana 用来在 tile 地图可视化组件中展示地图服务的 URL。默认时Kibana 从外部的元数据服务读取 url用户也可以覆盖该参数使用自己的 tile 地图服务。例如https://tiles.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tosagreemy_app_namekibana tilemap.options.minZoom:默认值: 1 最小缩放级别。 tilemap.options.maxZoom:默认值: 10 最大缩放级别。 tilemap.options.attribution:默认值: © [Elastic Tile Service](https://www.elastic.co/elastic-tile-service) 地图属性字符串。 tilemap.options.subdomains:服务使用的二级域名列表用 {s} 指定二级域名的 URL 地址。 elasticsearch.username: 和 elasticsearch.password:Elasticsearch 设置了基本的权限认证该配置项提供了用户名和密码用于 Kibana 启动时维护索引。Kibana 用户仍需要 Elasticsearch 由 Kibana 服务端代理的认证。 server.ssl.enabled默认值: false 对到浏览器端的请求启用 SSL设为 true 时 server.ssl.certificate 和 server.ssl.key 也要设置。 server.ssl.certificate: 和 server.ssl.key:PEM 格式 SSL 证书和 SSL 密钥文件的路径。 server.ssl.keyPassphrase解密私钥的口令该设置项可选因为密钥可能没有加密。 server.ssl.certificateAuthorities可信任 PEM 编码的证书文件路径列表。 server.ssl.supportedProtocols默认值: TLSv1、TLSv1.1、TLSv1.2 版本支持的协议有效的协议类型: TLSv1 、 TLSv1.1 、 TLSv1.2 。 server.ssl.cipherSuites默认值: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES256-GCM-SHA384, DHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES128-SHA256, DHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, DHE-RSA-AES256-SHA384, ECDHE-RSA-AES256-SHA256, DHE-RSA-AES256-SHA256, HIGH,!aNULL, !eNULL, !EXPORT, !DES, !RC4, !MD5, !PSK, !SRP, !CAMELLIA. 具体格式和有效参数可通过[OpenSSL cipher list format documentation](https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-LIST-FORMAT) 获得。 elasticsearch.ssl.certificate: 和 elasticsearch.ssl.key:可选配置项提供 PEM格式 SSL 证书和密钥文件的路径。这些文件确保 Elasticsearch 后端使用同样的密钥文件。 elasticsearch.ssl.keyPassphrase解密私钥的口令该设置项可选因为密钥可能没有加密。 elasticsearch.ssl.certificateAuthorities:指定用于 Elasticsearch 实例的 PEM 证书文件路径。 elasticsearch.ssl.verificationMode:默认值: full 控制证书的认证可用的值有 none 、 certificate 、 full 。 full 执行主机名验证certificate 不执行主机名验证。 elasticsearch.pingTimeout:默认值: elasticsearch.requestTimeout setting 的值等待 Elasticsearch 的响应时间。 elasticsearch.requestTimeout:默认值: 30000 等待后端或 Elasticsearch 的响应时间单位微秒该值必须为正整数。 elasticsearch.requestHeadersWhitelist:默认值: [ authorization ] Kibana 客户端发送到 Elasticsearch 头体发送 no 头体设置该值为[]。 elasticsearch.customHeaders:默认值: {} 发往 Elasticsearch的头体和值 不管 elasticsearch.requestHeadersWhitelist 如何配置任何自定义的头体不会被客户端头体覆盖。 elasticsearch.shardTimeout:默认值: 0 Elasticsearch 等待分片响应时间单位微秒0即禁用。 elasticsearch.startupTimeout:默认值: 5000 Kibana 启动时等待 Elasticsearch 的时间单位微秒。 pid.file:指定 Kibana 的进程 ID 文件的路径。 logging.dest:默认值: stdout 指定 Kibana 日志输出的文件。 logging.silent:默认值: false 该值设为 true 时禁止所有日志输出。 logging.quiet:默认值: false 该值设为 true 时禁止除错误信息除外的所有日志输出。 logging.verbose默认值: false 该值设为 true 时记下所有事件包括系统使用信息和所有请求的日志。 ops.interval默认值: 5000 设置系统和进程取样间隔单位微妙最小值100。 status.allowAnonymous默认值: false 如果启用了权限该项设置为 true 即允许所有非授权用户访问 Kibana 服务端 API 和状态页面。 cpu.cgroup.path.override如果挂载点跟 /proc/self/cgroup 不一致覆盖 cgroup cpu 路径。 cpuacct.cgroup.path.override如果挂载点跟 /proc/self/cgroup 不一致覆盖 cgroup cpuacct 路径。 console.enabled默认值: true 设为 false 来禁用控制台切换该值后服务端下次启动时会重新生成资源文件因此会导致页面服务有点延迟。 elasticsearch.tribe.url:Elasticsearch tribe 实例的 URL用于所有查询。 elasticsearch.tribe.username: 和 elasticsearch.tribe.password:Elasticsearch 设置了基本的权限认证该配置项提供了用户名和密码用于 Kibana 启动时维护索引。Kibana 用户仍需要 Elasticsearch 由 Kibana 服务端代理的认证。 elasticsearch.tribe.ssl.certificate: 和 elasticsearch.tribe.ssl.key:可选配置项提供 PEM 格式 SSL 证书和密钥文件的路径。这些文件确保 Elasticsearch 后端使用同样的密钥文件。 elasticsearch.tribe.ssl.keyPassphrase解密私钥的口令该设置项可选因为密钥可能没有加密。 elasticsearch.tribe.ssl.certificateAuthorities:指定用于 Elasticsearch tribe 实例的 PEM 证书文件路径。 elasticsearch.tribe.ssl.verificationMode:默认值: full 控制证书的认证可用的值有 none 、 certificate 、 full 。 full 执行主机名验证 certificate 不执行主机名验证。 elasticsearch.tribe.pingTimeout:默认值: elasticsearch.tribe.requestTimeout setting 的值等待 Elasticsearch 的响应时间。 elasticsearch.tribe.requestTimeout:Default: 30000 等待后端或 Elasticsearch 的响应时间单位微秒该值必须为正整数。 elasticsearch.tribe.requestHeadersWhitelist:默认值: [ authorization ] Kibana 发往 Elasticsearch 的客户端头体发送 no 头体设置该值为[]。 elasticsearch.tribe.customHeaders:默认值: {} 发往 Elasticsearch的头体和值不管 elasticsearch.tribe.requestHeadersWhitelist 如何配置任何自定义的头体不会被客户端头体覆盖。 报错1 FATAL [master_not_discovered_exception] null :: {path:/.kibana_task_manager,query:{},statusCode:503,response:{\error\:{\root_cause\:[{\type\:\master_not_discovered_exception\,\reason\:null}],\type\:\master_not_discovered_exception\,\reason\:null},\status\:503}}原因未修改elasticsearch.yml的cluster.initial_master_nodes配置修改配置之后重启elasticsearch node.name: node-1 cluster.initial_master_nodes: [“node-1”]报错2Request Timeout after 30000ms 解决办法 方法1、修改elastisearch的内存 方法2、修改kibana的超时时间 如果机器的内存不是那么的充足的话我们可以改改后端弹性搜索的阈值。修改配置文件/etc/kibana/kibana.yml的第66行将#去掉然后将30000毫秒也就是30s 更改成40000(40秒)这个根据实际情况进行修改。 报错3 fs.js:115throw err;^Error: EACCES: permission denied, open /opt/kibana-7.4.2-linux-x86_64/optimize/.babel_register_cache.jsonat Object.openSync (fs.js:439:3)at Object.writeFileSync (fs.js:1190:35)at save (/opt/kibana-7.4.2-linux-x86_64/node_modules/babel/register/lib/cache.js:52:15)at process._tickCallback (internal/process/next_tick.js:61:11)at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)at startup (internal/bootstrap/node.js:283:19)at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)解决办法赋予普通用户文件权限 chown -R kibana /opt/kibana-7.4.2-linux-x86_64/optimize/.babel_register_cache.json在kibana中查询日志 访问localhost:5601点击左侧最下方图标【Management】– 【Index Patterns】– 【Create index pattern】 6、logstash深入收集Nginx日志 安装nginx [rootlocalhost nginx]# yum -y install nginx echo 192.168.75.143 /usr/share/nginx/html/index.html住nginx.conf配置 [rootlocalhost nginx]# cat nginx.conf # For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid;# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf;events {worker_connections 1024; }http {# log_format main $remote_addr - $remote_user [$time_local] $request # $status $body_bytes_sent $http_referer # $http_user_agent $http_x_forwarded_for;log_format access_json {timestamp:$time_iso8601,host:$server_addr,clientip:$remote_addr,size:$body_bytes_sent,responsetime:$request_time,upstreamtime:$upstream_response_time,upstreamhost:$upstream_addr,http_host:$host,url:$uri,domain:$host,xff:$http_x_forwarded_for,referer:$http_referer,status:$status};#access_log /var/log/nginx/access.log main;access_log /var/log/nginx/access.log access_json;sendfile on;tcp_nopush on;tcp_nodelay on;keepalive_timeout 65;types_hash_max_size 4096;include /etc/nginx/mime.types;default_type application/octet-stream;include /etc/nginx/conf.d/*.conf; server {listen 80;listen [::]:80;server_name _;root /usr/share/nginx/html;# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;error_page 404 /404.html;location /404.html {}error_page 500 502 503 504 /50x.html;location /50x.html {}}将Nginx日志转换成json格式 log_format access_json {timestamp:$time_iso8601,host:$server_addr,clientip:$remote_addr,size:$body_bytes_sent,responsetime:$request_time,upstreamtime:$upstream_response_time,upstreamhost:$upstream_addr,http_host:$host,url:$uri,domain:$host,xff:$http_x_forwarded_for,referer:$http_referer,status:$status};access_log /var/log/nginx/access.log access_json;重启nginx查看访问日志 刷新页面会在日志看到访问日志信息为json格式即可配置logstash收集Nginx日志 [rootlocalhost config]# cat nginx-log-es.conf input{file{path /var/log/nginx/access.logstart_position beginningstat_interval 3 type nginx-accesslogcodec json} }output{if [type] nginx-accesslog{elasticsearch {hosts [192.168.75.143:9200]index long-nginx-accesslog-%{YYYY.MM.dd} }} }检查语法 /opt/logstash-7.4.2/bin/logstash -f /opt/logstash-7.4.2/config/nginx-log-es.conf -t启动 /opt/logstash-7.4.2/bin/logstash -f /opt/logstash-7.4.2/config/nginx-log-es.conf查看kabana 把nginx的访问日志和错误日志一起收集配置文件 [rootlocalhost config]# cat nginx-log-es.conf input{file{path /var/log/nginx/access.logstart_position beginningstat_interval 3 type nginx-accesslogcodec json}file{path /var/log/nginx/error.logstart_position beginningstat_interval 3type nginx-errorlog#codec json} }output{if [type] nginx-accesslog{elasticsearch {hosts [192.168.75.143:9200]index long-nginx-accesslog-%{YYYY.MM.dd} }}if [type] nginx-errorlog{elasticsearch {hosts [192.168.75.143:9200]index long-nginx-errorlog-%{YYYY.MM.dd}}} }检查语法 /opt/logstash-7.4.2/bin/logstash -f /opt/logstash-7.4.2/config/nginx-log-es.conf -t启动 /opt/logstash-7.4.2/bin/logstash -f /opt/logstash-7.4.2/config/nginx-log-es.conf查看错误日志
http://www.w-s-a.com/news/925193/

相关文章:

  • js网站开发工具软件营销方案
  • 做网站的天空网云南省建设厅网站怎么进不去
  • 天津网站排名提升网络营销推广策略包括哪些
  • 网站建设与管理 ppt网站打开是别人的
  • 图片网站怎么做排名怎么分析一个网站seo
  • 伪原创对网站的影响深圳装修公司排名100强
  • 网站建设公司效果个人可以做医疗信息网站吗
  • 网站使用arial字体下载微网站 建设
  • 文化馆网站建设意义营销型国外网站
  • 公司网站定位建议wordpress怎么用模板
  • 中国十大热门网站排名计算机选什么专业最好
  • 怀化建设企业网站太原网站关键词排名
  • 空间注册网站网站制作是怎么做的
  • 数码家电商城网站源码一个网站的成本
  • 网站伪静态是什么意思麻涌东莞网站建设
  • 理县网站建设公司郑州仿站定制模板建站
  • 手机网站建设网站报价诸城人才网招聘网
  • 一起做网站怎么下单临沂网站制作
  • 公司网站案例企业网站 模版
  • 做的好的响应式网站有哪些网站界面设计案例
  • 上海创意型网站建设icp备案网站信息
  • 网站没收录中山手机网站制作哪家好
  • 代驾软件开发流程wordpress 博客主题 seo
  • 成都的教育品牌网站建设网站广告js代码添加
  • 网站找人做seo然后网站搜不到了网站建设seoppt
  • 做网站优化有用吗学做文案的网站
  • wordpress 知名网站怎么做微网站
  • 用电脑怎么做原创视频网站河南建设工程信息网一体化平台官网
  • 云服务器和网站空间郑州做招商的网站
  • 规模以上工业企业的标准北京seo结算