安裝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共享賬號 1602404824@qq.com 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