安装java
升级gc
sudo yum install centos-release-scl
sudo yum install devtoolset-8-gcc*
scl enable devtoolset-8 bash
gcc -v
切换gc到新版
mv /usr/bin/gcc /usr/bin/gcc-4.8.5
ln -s /opt/rh/devtoolset-8/root/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++-4.8.5
ln -s /opt/rh/devtoolset-8/root/bin/g++ /usr/bin/g++
gcc --version
g++ --version
下载java11安装包
- 下载地址 https://www.oracle.com/java/technologies/downloads/#java11
- orcale共享账号 [email protected] wf1996ROOT#
解压java包,配置环境变量
tar -zxvf jdk-11.0.13_linux-x64_bin.tar.gz
mv jdk-11.0.13 jdk11
mv /opt/jdk11 /usr/local/lib/
vim /etc/profile
# profile文件
export JAVA_HOME=/usr/local/lib/jdk11
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAV_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
source /opt/rh/devtoolset-8/enable
# profile生效
source /etc/profile
# environmentJAVA_HOME环境变量
JAVA_HOME="/usr/local/lib/jdk11"
# environment生效
source /etc/environment
# 检查环境变量是否生效
echo $JAVA_HOME
安装elasticsearch
下载解压
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip
unzip elasticsearch-5.5.1.zip
cd elasticsearch-5.5.1/
es禁止root账号使用,新建用户
# 创建新用户
useradd elastic
# 设置密码
passwd elastic
# 切换用户
su elastic
启动es
./bin/elasticsearch
# 如果这时报错"max virtual memory areas vm.maxmapcount [65530] is too low",要运行下面的命令,然后再启动。
sudo sysctl -w vm.max_map_count=262144
外网访问
# elasticsearch.yml配置文件
network.host: 0.0.0.0
开放9200端口,外网访问xxxx:9200
{
"name" : "HYRvkyI",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "LUQln_DXTl27-EjUvc67dw",
"version" : {
"number" : "5.5.1",
"build_hash" : "19c13d0",
"build_date" : "2017-07-18T20:44:24.823Z",
"build_snapshot" : false,
"lucene_version" : "6.6.0"
},
"tagline" : "You Know, for Search"
}
原创 https://www.cnblogs.com/jixiaohua/p/11732225.html
https://www.cnblogs.com/zk2020/p/15717411.html
https://www.ruanyifeng.com/blog/2017/08/elasticsearch.html