首页 技术 正文
技术 2022年11月9日
0 收藏 690 点赞 4,486 浏览 2206 个字

JDK8

做个记录,以防以后忘记能够查看。

1.elastic是java编写的,先搭建运行环境,6.6.2版本必须要jdk8以上版本才可运行,先官网下载jdk,上传服务器

https://www.oracle.com/technetwork/java/javase/downloads/index.html

2.yum安装一些常用的编译器和工具

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel vim ntsysv

3.安装jdk

rpm -ivh jdk-8u192-linux-x64.rpm 

4.查看是否安装成功

[root@admin software]# java -version
java version “1.8.0_192”
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

Elasticsearch

传送门

https://www.elastic.co/downloads/elasticsearch

elasticsearch6.6.2在Centos6.9的安装

5.解压elastic

tar -xvf elasticsearch-6.6.2.tar.gz

6.elastic对权限有严格控制,不能有root启动,先添加一个用户

useradd es
chown -R es:es elasticsearch-6.6.2 --拥有者
chmod 770 elasticsearch-6.6.2 --权限

7.切换用户

su es

8.切换目录

cd elasticsearch-6.6.2/bin
./elasticsearc

9.启动发现一个错误

elasticsearch6.6.2在Centos6.9的安装

这是因为虚拟内存不足,我们到elasticsearch的config下修改为

elasticsearch6.6.2在Centos6.9的安装

保存启动

elasticsearch6.6.2在Centos6.9的安装

我们验证一下,克隆一个窗口。

[root@admin ~]# curl “localhost:9200”

出现elastic的信息,证明我们成功了

elasticsearch6.6.2在Centos6.9的安装

10.这仅仅只能服务器内网访问,要想浏览器也能访问,必须修改elastic配置,Ctrl+C停止运行的elastic

vi ../config/elasticsearch.yml 

elasticsearch6.6.2在Centos6.9的安装

11.重新启动,竟然报错了,我们一个一个解决

elasticsearch6.6.2在Centos6.9的安装

第一是进程打开文件数太小了,第二个是线程数量太小,第三是内存数量太小,第四个是说拦截安装,这是因centos6不支持secComp,检测失败。因为我是虚拟机安装的,发现自己只给虚拟机1g内存,线程数肯定是不够的,先关闭虚拟机,提高虚拟机硬件配置,内存调为2048m,重新启动虚拟机。

[root@admin ~]# vi /etc/security/limits.conf

添加

* soft nofile 65536* hard nofile 65536* soft nproc 4096* hard nproc 4096

[root@admin limits.d]# vi /etc/security/limits.d/90-nproc.conf

修改为

elasticsearch6.6.2在Centos6.9的安装

编辑 /etc/sysctl.conf,追加以下内容:
vm.max_map_count=655360

解决最后一个问题

[root@admin config]# vi elasticsearch.yml

elasticsearch6.6.2在Centos6.9的安装

全部完成后,切换用户,启动elastic。记得在访问时先关闭防火墙,浏览器访问

elasticsearch6.6.2在Centos6.9的安装

给大家推荐一个elastic超好用的工具======>elasticsearch-head,传送门

https://files.cnblogs.com/files/dslx/chromeFOR.COM_elasticsearch-head_v0.1.3.zip

elasticsearch6.6.2在Centos6.9的安装

es分布式搭建

配置elasticsearch.yml

#允许跨域访问
http.cors.enabled: true
http.cors.allow-origin: "*"#集群名字
cluster.name: huangweicheng
#这个节点的名称
node.name: master
#告诉这个节点,他就指挥官,master
node.master: true

启动,看节点能不能正常启动

elasticsearch6.6.2在Centos6.9的安装

正常启动,可以看到他的节点名字已经变成我们命名的,现在我们部署另外两个节点

创建一个文件夹专门存储随从节点,两个节点一人一个文件夹

mkdir es_slave

将elasticsearch6.6.2复制两份到这个文件夹下

elasticsearch6.6.2在Centos6.9的安装

现在修改下两个节点的 elasticsearch.yml

bootstrap.memory_lock: false
bootstrap.system_call_filter: falsenetwork.host: 10.105.9.119
http.port: cluster.name: huangweicheng
node.name: slave1discovery.zen.ping.unicast.hosts: ["10.105.9.119"]

记得端口号一定要不同,把两个文件夹的拥有者改为 es,然后分别启动。

elasticsearch6.6.2在Centos6.9的安装

搭建完成。。。。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,490
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,290