Skip to content

[[Ubuntu安装docker及docker]] compose

apt-get update
curl -sSL https://get.daocloud.io/docker | sh
service docker start
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

[[nmap]]安装

wget https://nmap.org/dist/nmap-7.80-1.x86_64.rpm && rpm -ivh nmap-7.80-1.x86_64.rpm

[[masscan]]安装

yum install -y masscan

安装 Elasticsearch 5.6.8版本

[[Centos安装java]]环境

yum -y install java-1.8.0-openjdk*

[[下载Es]]并解压

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.8.tar.gz && tar -zxvf elasticsearch-5.6.8.tar.gz -C /opt

[[创建ES]]用户

groupadd elasticsearch && useradd elasticsearch -g elasticsearch -p Es12345678 #新建一个非 root 权限用户,-p 后跟设定的密码,ES就使用这个用户启动。

修改文件夹所属用户和组为 elasticsearch:elasticsearch

chown -R elasticsearch:elasticsearch /opt/elasticsearch-5.6.8

修改配置文件

Centos7以下系统在config/elasticsearch.yml中添加

bootstrap.system_call_filter: false [[vi]] /opt/elasticsearch-5.6.8/config/elasticsearch.yml中添加

[[启动Es]]

su - elasticsearch -c '/opt/elasticsearch-5.6.8/bin/elasticsearch -d'
curl -XGET -s "http://localhost:9200/_cluster/health?pretty" [[curl下确认Es]]启动成功

启动报错

修改配置文件的网络地址后启动不能通过IP访问ES服务,具体步骤有:

  • 查看ES日志,vi /opt/elasticsearch-5.6.8/log/elasticsearch.log
  • 日志报错1:uncaught exception in thread [main]
  • 查看ES网络服务,netstat -lnpt
  • 查看ES进程,ps -ef | grep elasticsearch or ps aux | grep ‘elastic’
  • 关闭部分或全部进程,kill -9 pid
  • 日志报错2:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
  • 修改系统配置文件,vi /etc/sysctl.conf ,增加配置 vm.max_map_count=262144
  • 执行命令sysctl -p生效
  • 查看结果:sysctl -a|grep vm.max_map_count
  • 重启ES服务

安装 Kibana 5.6.8版本

[[下载Kibana]]并解压

wget https://artifacts.elastic.co/downloads/kibana/kibana-5.6.8-linux-x86_64.tar.gz && tar -zxvf kibana-5.6.8-linux-x86_64.tar.gz -C /opt

修改配置文件

```server.host: "0.0.0.0" 在/opt/kibana-5.6.8-linux-x86_64/config/kibana.yml中增加以下配置并保存

#[[启动kibana]]
```shell
nohup /opt/kibana-5.6.8-linux-x86_64/bin/kibana > /dev/null 2>&1 & 

浏览器中输入:http://xx.xx.xx.xx:5601(kibana所在ip地址),访问成功后,点击左侧菜单栏Management,配置索引。 在Index pattern中输入scan-*,Time Filter field name下拉框选择time字段,即完成kibana的配置