1。用户管理
创建用户组:
# groupadd dyp
创建用户:
# useradd -g dyp dyp
2。jdk
查看安装jdk版本
# java -version
查看jdk的信息
# rpm -qa|grep java
卸载
# yum -y remove java
解压:
# mkdir /usr/local/java
# tar -zxvf jdk-8u144-linux-x64.tar.gz -C /usr/local/java
配置环境变量:
# vi /etc/profile
在文件里添加如下:
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
加载配置内容:
# source /etc/profile
测试:
# java -version
3..elastic search 安装
下载es
#wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip
解压:
# mkdir /usr/local/es
# unzip elasticsearch-5.5.1.zip -d /usr/local/es/
指定目录所有者:
# chown -R dyp:dyp /usr/local/es/elasticsearch-5.5.1/
创建目录:
#mkdir /home/dyp/es
#mkdir /home/dyp/es/data
#mkdir /home/dyp/es/logs
更新配置:
# vi config/elasticsearch.yml
添加:
cluster.name: dyp_es
node.name: node-1
path.data: /home/dyp/es/data
path.logs: /home/dyp/es/logs
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 0.0.0.0
启动:
#bin/elasticsearch
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1024] for user [pugutang] is too low, increase to at least [2048]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
处理:
注:
修改/etc/security/limits.conf
# vi /etc/security/limits.conf
添加如下:
* soft nofile 65536
* hard nofile 65536
* soft nproc 2048
* hard nproc 4096
修改/etc/sysctl.conf
# vi /etc/sysctl.conf
添加如下:
vm.max_map_count=262144
如不起作用:在命令行中执行如下命令即可修改虚拟内存大小
#echo 262144 | sudo tee /proc/sys/vm/max_map_count
修改/etc/security/limits.d/90-nproc.conf
# vi /etc/security/limits.d/90-nproc.conf
* soft nproc 2048
注:
如更改后还有错误提示,可以新开启个窗口就会加载到新的配置