目录:
一,查看Linux内核,进程,开放的接口,版本等信息 二,Linux + elasticsearch7.2 三,Windows10 + elasticsearch7.2
[root@VM_6_21_centos ~]# cat /proc/version
Linux version 3.10.0-957.5.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Fri Feb 1 14:54:57 UTC 2019
[root@VM_6_21_centos ~]# uname -r
3.10.0-957.5.1.el7.x86_64
[root@VM_6_21_centos ~]# uname -a
Linux VM_6_21_centos 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@VM_6_21_centos ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@VM_6_21_centos ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@VM_6_21_centos ~]# file /bin/bash
/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=9223530b1aa05d3dbea7e72738b28b1e9d82fbad, stripped
[root@VM_6_21_centos ~]# file /bin/cat
/bin/cat: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=8ac8b57ae50762a4a0480486839107e87b3c284d, stripped
[root@VM_6_21_centos ~]# getconf LONG_BIT
64
[root@VM_6_21_centos ~]# lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 3062 root 8u IPv4 22821 0t0 TCP *:http (LISTEN)
nginx 3065 www 8u IPv4 22821 0t0 TCP *:http (LISTEN)
[root@VM_6_21_centos ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 5084/beam
.
.
.
方法一:
[root@VM_6_21_centos ~]# vi /etc/sysconfig/iptables
# Generated by iptables-save v1.4.21 on Thu Mar 21 17:44:15 2019
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [554:741143]
-A INPUT -p tcp -m tcp --dport 15672 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5672 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Thu Mar 21 17:44:15 2019
方法二:
[root@VM_6_21_centos ~]# -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT 重启防火墙,修改完成
[root@VM_6_21_centos ~]# service iptables restart 重启防火墙,修改生效
查看端口状态 | /etc/init.d/iptables status |
---|---|
会列出所有正在使用的端口及关联的进程/应用 | netstat -nap |
portnumber要用具体的端口号代替,可以直接列出该端口听使用进程/应用 | lsof -i :portnumber |
检查端口被哪个进程占用 | netstat -lnp|grep 88 |
查看进程的详细信息 | ps 进程号 |
杀死进程 | kill -9 1777 |
关闭端口 | /sbin/iptables -I INPUT -p tcp --dport 80 -j DROP 写入修改 /etc/init.d/iptables save 保存修改 service iptables restart 重启防火墙,修改生效 |
官方网站地址为:https://www.elastic.co/downloads/elasticsearch
1,安裝(下载慢,去官网下载,再通过ftp上传到Linux)
[root@local ~]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz
[root@local ~]# tar -zxvf elasticsearch-7.2.0-linux-x86_64.tar.gz
[root@local ~]# rm -rf elasticsearch-7.2.0-linux-x86_64.tar.gz
[root@local ~]# mv elasticsearch-7.2.0 /usr/local/elasticsearch7.2
2,elasticsearch不能使用root权限登录
[root@local ~]# useradd 用户1
[root@local ~]# passwd 用户1
[root@local ~]# chown -R 用户1 /usr/local/elasticsearch7.2
3,修改配置文件
[root@local ~]# cd /usr/local/elasticsearch7.2
[root@local elasticsearch7.2]# vim config/elasticsearch.yml
#修改为自己的
ipnetwork.host: x.x.x.x
#把这个注释先放开
cluster.initial_master_nodes: ["node-1", "node-2"]
4 . 启动
[root@local elasticsearch7.2]# ./elasticsearch
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
vi /etc/sysctl.conf
vm.max_map_count=262144
sysctl -p
集群安装参考:Centos7.4下Elasticsearch-6.7集群安装配置 https://blog.51cto.com/niubdada/2371379
官方网站地址为:https://www.elastic.co/downloads/elasticsearch
github 地址为:https://github.com/medcl/elasticsearch-analysis-ik/releases