创建虚拟机,修改主机名,配置IP,搭建YUM源,详细的就不解释了,直接粘贴代码
创建虚拟机
[root@room9pc52 qemu]# sed ‘s/node/node61/’ node.xml > node61.xml
[root@room9pc52 qemu]# sed ‘s/node/node62/’ node.xml > node62.xml
[root@room9pc52 qemu]# sed ‘s/node/node63/’ node.xml > node63.xml
[root@room9pc52 qemu]# sed ‘s/node/node64/’ node.xml > node64.xml
[root@room9pc52 qemu]# sed ‘s/node/node65/’ node.xml > node65.xml
[root@room9pc52 qemu]# sed ‘s/node/node66/’ node.xml > node66.xml
[root@room9pc52 qemu]# sed ‘s/node/node67/’ node.xml > node67.xml
[root@room9pc52 qemu]#
[root@room9pc52 qemu]# cd /var/lib/libvirt/images/
[root@room9pc52 images]# qemu-img create -b node.qcow2 -f qcow2 node61.qcow2
Formatting ‘node61.qcow2′, fmt=qcow2 size=17179869184 backing_file=’node.qcow2’ encryption=off cluster_size=65536 lazy_refcounts=off
[root@room9pc52 images]# qemu-img create -b node.qcow2 -f qcow2 node62.qcow2
Formatting ‘node62.qcow2′, fmt=qcow2 size=17179869184 backing_file=’node.qcow2’ encryption=off cluster_size=65536 lazy_refcounts=off
[root@room9pc52 images]# qemu-img create -b node.qcow2 -f qcow2 node63.qcow2
Formatting ‘node63.qcow2′, fmt=qcow2 size=17179869184 backing_file=’node.qcow2’ encryption=off cluster_size=65536 lazy_refcounts=off
[root@room9pc52 images]# qemu-img create -b node.qcow2 -f qcow2 node64.qcow2
Formatting ‘node64.qcow2′, fmt=qcow2 size=17179869184 backing_file=’node.qcow2’ encryption=off cluster_size=65536 lazy_refcounts=off
[root@room9pc52 images]# qemu-img create -b node.qcow2 -f qcow2 node65.qcow2
Formatting ‘node65.qcow2′, fmt=qcow2 size=17179869184 backing_file=’node.qcow2’ encryption=off cluster_size=65536 lazy_refcounts=off
[root@room9pc52 images]# qemu-img create -b node.qcow2 -f qcow2 node66.qcow2
Formatting ‘node66.qcow2′, fmt=qcow2 size=17179869184 backing_file=’node.qcow2’ encryption=off cluster_size=65536 lazy_refcounts=off
[root@room9pc52 images]# qemu-img create -b node.qcow2 -f qcow2 node67.qcow2
Formatting ‘node67.qcow2′, fmt=qcow2 size=17179869184 backing_file=’node.qcow2’ encryption=off cluster_size=65536 lazy_refcounts=off
[root@room9pc52 images]#
[root@room9pc52 images]# cd /etc/libvirt/qemu/
[root@room9pc52 qemu]# virsh define node61.xml
定义域 node61(从 node61.xml)
[root@room9pc52 qemu]# virsh define node62.xml
定义域 node62(从 node62.xml)
[root@room9pc52 qemu]# virsh define node63.xml
定义域 node63(从 node63.xml)
[root@room9pc52 qemu]# virsh define node64.xml
定义域 node64(从 node64.xml)
[root@room9pc52 qemu]# virsh define node65.xml
定义域 node65(从 node65.xml)
[root@room9pc52 qemu]# virsh define node66.xml
定义域 node66(从 node66.xml)
[root@room9pc52 qemu]# virsh define node67.xml
定义域 node67(从 node67.xml)
修改参数
[root@room9pc52 qemu]# virsh start node61
域 node61 已开始
[root@room9pc52 qemu]# virsh start node62
域 node62 已开始
[root@room9pc52 qemu]# virsh start node63
域 node63 已开始
[root@room9pc52 qemu]# virsh start node64
域 node64 已开始
[root@room9pc52 qemu]# virsh start node65
域 node65 已开始
[root@room9pc52 qemu]# virsh start node66
域 node66 已开始
[root@room9pc52 qemu]# virsh start node67
域 node67 已开始
真机制作YUM源
[root@room9pc52 elk 1]# ls
accounts.json.gz elk.tar
alog.gz filebeat-1.2.3-x86_64.rpm
bigdesk-master.zip kibana-4.5.2-1.x86_64.rpm
elasticsearch-2.3.4.rpm logs.jsonl.gz
elasticsearch-head-master.zip logstash-2.3.4-1.noarch.rpm
elasticsearch-kopf-master.zip NSD_ELK_01.pdf
elk_01(1).txt shakespeare.json.gz
[root@room9pc52 elk 1]# cp -r *.rpm /var/ftp/elk/
[root@room9pc52 elk 1]# ls /var/ftp/elk/
elasticsearch-2.3.4.rpm kibana-4.5.2-1.x86_64.rpm
filebeat-1.2.3-x86_64.rpm logstash-2.3.4-1.noarch.rpm
[root@room9pc52 elk 1]# createrepo /var/ftp/elk/
Spawning worker 0 with 1 pkgs
Spawning worker 1 with 1 pkgs
Spawning worker 2 with 1 pkgs
Spawning worker 3 with 1 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@room9pc52 elk 1]# ls /var/ftp/elk/
elasticsearch-2.3.4.rpm kibana-4.5.2-1.x86_64.rpm repodata
filebeat-1.2.3-x86_64.rpm logstash-2.3.4-1.noarch.rpm
[root@room9pc52 elk 1]#
连接到node61去操作,其他机器不贴了,都是一样的
[root@room9pc52 qemu]# virsh console node61
连接到域 node61
换码符为 ^]
CentOS Linux 7 (Core)
Kernel 3.10.0-693.el7.x86_64 on an x86_64
localhost login: root
Password:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Generated by dracut initrd
DEVICE=”eth0″
NAME=”eth0″
ONBOOT=yes
IPV6INIT=no
TYPE=Ethernet
IPADDR=192.168.1.61
PREFIX=24
GATEWAY=192.168.1.254
[root@localhost ~]# cat /etc/yum.repos.d/local.repo
[local_repo]
name=CentOS-$releasever – Base
baseurl=”ftp://192.168.1.254/system”
enabled=1
gpgcheck=1
[elk]
name=elk
baseurl=”ftp://192.168.1.254/elk”
enabled=1
gpgcheck=0
[root@localhost ~]# yum repolist
Loaded plugins: fastestmirror
base | 3.6 kB 00:00
elk | 2.9 kB 00:00
extras | 3.4 kB 00:00
local_repo | 3.6 kB 00:00
updates | 3.4 kB 00:00
(1/7): elk/primary_db | 12 kB 00:00
(2/7): local_repo/group_gz | 156 kB 00:00
(3/7): local_repo/primary_db | 5.7 MB 00:00
(4/7): extras/7/x86_64/primary_db | 204 kB 00:00
(5/7): base/7/x86_64/group_gz | 166 kB 00:00
(6/7): base/7/x86_64/primary_db | 5.9 MB 00:01
(7/7): updates/7/x86_64/primary_db | 6.0 MB 00:01
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 – Base 9,911
elk elk 4
extras/7/x86_64 CentOS-7 – Extras 432
local_repo CentOS-7 – Base 9,591
updates/7/x86_64 CentOS-7 – Updates 1,561
repolist: 21,499
部署elasticsearch的第一个节点
安装JAVAJDK
[root@se1 ~]# yum install -y java-1.8.0-openjdk
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系
–> 正在检查事务
—> 软件包 java-1.8.0-openjdk.x86_64.1.1.8.0.181-3.b13.el7_5 将被 安装
–> 正在处理依赖关系 java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.181-3.b13.el7_5,它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 xorg-x11-fonts-Type1,它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libpng15.so.15(PNG15_0)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjvm.so(SUNWprivate_1.1)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjpeg.so.62(LIBJPEG_6.2)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjava.so(SUNWprivate_1.1)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 fontconfig(x86-64),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libpng15.so.15()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjvm.so()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjpeg.so.62()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjava.so()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libgif.so.4()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXtst.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXrender.so.1()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXi.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXext.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXcomposite.so.1()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libX11.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在检查事务
—> 软件包 fontconfig.x86_64.0.2.10.95-11.el7 将被 安装
–> 正在处理依赖关系 fontpackages-filesystem,它被软件包 fontconfig-2.10.95-11.el7.x86_64 需要
–> 正在处理依赖关系 font(:lang=en),它被软件包 fontconfig-2.10.95-11.el7.x86_64 需要
—> 软件包 giflib.x86_64.0.4.1.6-9.el7 将被 安装
–> 正在处理依赖关系 libSM.so.6()(64bit),它被软件包 giflib-4.1.6-9.el7.x86_64 需要
–> 正在处理依赖关系 libICE.so.6()(64bit),它被软件包 giflib-4.1.6-9.el7.x86_64 需要
—> 软件包 java-1.8.0-openjdk-headless.x86_64.1.1.8.0.181-3.b13.el7_5 将被 安装
–> 正在处理依赖关系 tzdata-java >= 2015d,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 nss-softokn(x86-64) >= 3.36.0,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 nss(x86-64) >= 3.36.0,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 copy-jdk-configs >= 2.2,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 lksctp-tools(x86-64),它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 jpackage-utils,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
—> 软件包 libX11.x86_64.0.1.6.5-1.el7 将被 安装
–> 正在处理依赖关系 libX11-common >= 1.6.5-1.el7,它被软件包 libX11-1.6.5-1.el7.x86_64 需要
–> 正在处理依赖关系 libxcb.so.1()(64bit),它被软件包 libX11-1.6.5-1.el7.x86_64 需要
—> 软件包 libXcomposite.x86_64.0.0.4.4-4.1.el7 将被 安装
—> 软件包 libXext.x86_64.0.1.3.3-3.el7 将被 安装
—> 软件包 libXi.x86_64.0.1.7.9-1.el7 将被 安装
—> 软件包 libXrender.x86_64.0.0.9.10-1.el7 将被 安装
—> 软件包 libXtst.x86_64.0.1.2.3-1.el7 将被 安装
—> 软件包 libjpeg-turbo.x86_64.0.1.2.90-5.el7 将被 安装
—> 软件包 libpng.x86_64.2.1.5.13-7.el7_2 将被 安装
—> 软件包 xorg-x11-fonts-Type1.noarch.0.7.5-9.el7 将被 安装
–> 正在处理依赖关系 ttmkfdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在处理依赖关系 ttmkfdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在处理依赖关系 mkfontdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在处理依赖关系 mkfontdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在检查事务
—> 软件包 copy-jdk-configs.noarch.0.3.3-10.el7_5 将被 安装
—> 软件包 fontpackages-filesystem.noarch.0.1.44-8.el7 将被 安装
—> 软件包 javapackages-tools.noarch.0.3.4.1-11.el7 将被 安装
–> 正在处理依赖关系 python-javapackages = 3.4.1-11.el7,它被软件包 javapackages-tools-3.4.1-11.el7.noarch 需要
–> 正在处理依赖关系 libxslt,它被软件包 javapackages-tools-3.4.1-11.el7.noarch 需要
—> 软件包 libICE.x86_64.0.1.0.9-9.el7 将被 安装
—> 软件包 libSM.x86_64.0.1.2.2-2.el7 将被 安装
—> 软件包 libX11-common.noarch.0.1.6.5-1.el7 将被 安装
—> 软件包 libxcb.x86_64.0.1.12-1.el7 将被 安装
–> 正在处理依赖关系 libXau.so.6()(64bit),它被软件包 libxcb-1.12-1.el7.x86_64 需要
—> 软件包 lksctp-tools.x86_64.0.1.0.17-2.el7 将被 安装
—> 软件包 nss.x86_64.0.3.28.4-8.el7 将被 升级
–> 正在处理依赖关系 nss = 3.28.4-8.el7,它被软件包 nss-sysinit-3.28.4-8.el7.x86_64 需要
–> 正在处理依赖关系 nss(x86-64) = 3.28.4-8.el7,它被软件包 nss-tools-3.28.4-8.el7.x86_64 需要
—> 软件包 nss.x86_64.0.3.36.0-7.el7_5 将被 更新
–> 正在处理依赖关系 nss-util >= 3.36.0-1,它被软件包 nss-3.36.0-7.el7_5.x86_64 需要
–> 正在处理依赖关系 nspr >= 4.19.0,它被软件包 nss-3.36.0-7.el7_5.x86_64 需要
–> 正在处理依赖关系 libnssutil3.so(NSSUTIL_3.31)(64bit),它被软件包 nss-3.36.0-7.el7_5.x86_64 需要
—> 软件包 nss-softokn.x86_64.0.3.28.3-6.el7 将被 升级
—> 软件包 nss-softokn.x86_64.0.3.36.0-5.el7_5 将被 更新
–> 正在处理依赖关系 nss-softokn-freebl(x86-64) >= 3.36.0-5.el7_5,它被软件包 nss-softokn-3.36.0-5.el7_5.x86_64 需要
—> 软件包 stix-fonts.noarch.0.1.1.0-5.el7 将被 安装
—> 软件包 ttmkfdir.x86_64.0.3.0.9-42.el7 将被 安装
—> 软件包 tzdata-java.noarch.0.2018e-3.el7 将被 安装
—> 软件包 xorg-x11-font-utils.x86_64.1.7.5-20.el7 将被 安装
–> 正在处理依赖关系 libfontenc.so.1()(64bit),它被软件包 1:xorg-x11-font-utils-7.5-20.el7.x86_64 需要
–> 正在处理依赖关系 libXfont.so.1()(64bit),它被软件包 1:xorg-x11-font-utils-7.5-20.el7.x86_64 需要
–> 正在检查事务
—> 软件包 libXau.x86_64.0.1.0.8-2.1.el7 将被 安装
—> 软件包 libXfont.x86_64.0.1.5.2-1.el7 将被 安装
—> 软件包 libfontenc.x86_64.0.1.1.3-3.el7 将被 安装
—> 软件包 libxslt.x86_64.0.1.1.28-5.el7 将被 安装
—> 软件包 nspr.x86_64.0.4.13.1-1.0.el7_3 将被 升级
—> 软件包 nspr.x86_64.0.4.19.0-1.el7_5 将被 更新
—> 软件包 nss-softokn-freebl.x86_64.0.3.28.3-6.el7 将被 升级
—> 软件包 nss-softokn-freebl.x86_64.0.3.36.0-5.el7_5 将被 更新
—> 软件包 nss-sysinit.x86_64.0.3.28.4-8.el7 将被 升级
—> 软件包 nss-sysinit.x86_64.0.3.36.0-7.el7_5 将被 更新
—> 软件包 nss-tools.x86_64.0.3.28.4-8.el7 将被 升级
—> 软件包 nss-tools.x86_64.0.3.36.0-7.el7_5 将被 更新
—> 软件包 nss-util.x86_64.0.3.28.4-3.el7 将被 升级
—> 软件包 nss-util.x86_64.0.3.36.0-1.el7_5 将被 更新
—> 软件包 python-javapackages.noarch.0.3.4.1-11.el7 将被 安装
–> 正在处理依赖关系 python-lxml,它被软件包 python-javapackages-3.4.1-11.el7.noarch 需要
–> 正在检查事务
—> 软件包 python-lxml.x86_64.0.3.2.1-4.el7 将被 安装
–> 解决依赖关系完成
依赖关系解决
=====================================================================================================================
Package 架构 版本 源 大小
=====================================================================================================================
正在安装:
java-1.8.0-openjdk x86_64 1:1.8.0.181-3.b13.el7_5 updates 250 k
为依赖而安装:
copy-jdk-configs noarch 3.3-10.el7_5 updates 21 k
fontconfig x86_64 2.10.95-11.el7 base 229 k
fontpackages-filesystem noarch 1.44-8.el7 base 9.9 k
giflib x86_64 4.1.6-9.el7 base 40 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.181-3.b13.el7_5 updates 32 M
javapackages-tools noarch 3.4.1-11.el7 base 73 k
libICE x86_64 1.0.9-9.el7 base 66 k
libSM x86_64 1.2.2-2.el7 base 39 k
libX11 x86_64 1.6.5-1.el7 base 606 k
libX11-common noarch 1.6.5-1.el7 base 164 k
libXau x86_64 1.0.8-2.1.el7 base 29 k
libXcomposite x86_64 0.4.4-4.1.el7 base 22 k
libXext x86_64 1.3.3-3.el7 base 39 k
libXfont x86_64 1.5.2-1.el7 base 152 k
libXi x86_64 1.7.9-1.el7 base 40 k
libXrender x86_64 0.9.10-1.el7 base 26 k
libXtst x86_64 1.2.3-1.el7 base 20 k
libfontenc x86_64 1.1.3-3.el7 base 31 k
libjpeg-turbo x86_64 1.2.90-5.el7 base 134 k
libpng x86_64 2:1.5.13-7.el7_2 base 213 k
libxcb x86_64 1.12-1.el7 base 211 k
libxslt x86_64 1.1.28-5.el7 base 242 k
lksctp-tools x86_64 1.0.17-2.el7 base 88 k
python-javapackages noarch 3.4.1-11.el7 base 31 k
python-lxml x86_64 3.2.1-4.el7 base 758 k
stix-fonts noarch 1.1.0-5.el7 base 1.3 M
ttmkfdir x86_64 3.0.9-42.el7 base 48 k
tzdata-java noarch 2018e-3.el7 updates 185 k
xorg-x11-font-utils x86_64 1:7.5-20.el7 base 87 k
xorg-x11-fonts-Type1 noarch 7.5-9.el7 base 521 k
为依赖而更新:
nspr x86_64 4.19.0-1.el7_5 updates 127 k
nss x86_64 3.36.0-7.el7_5 updates 835 k
nss-softokn x86_64 3.36.0-5.el7_5 updates 315 k
nss-softokn-freebl x86_64 3.36.0-5.el7_5 updates 222 k
nss-sysinit x86_64 3.36.0-7.el7_5 updates 62 k
nss-tools x86_64 3.36.0-7.el7_5 updates 515 k
nss-util x86_64 3.36.0-1.el7_5 updates 78 k
事务概要
=====================================================================================================================
安装 1 软件包 (+30 依赖软件包)
升级 ( 7 依赖软件包)
总下载量:39 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/38): fontpackages-filesystem-1.44-8.el7.noarch.rpm | 9.9 kB 00:00:00
(2/38): copy-jdk-configs-3.3-10.el7_5.noarch.rpm | 21 kB 00:00:00
(3/38): giflib-4.1.6-9.el7.x86_64.rpm | 40 kB 00:00:00
(4/38): javapackages-tools-3.4.1-11.el7.noarch.rpm | 73 kB 00:00:00
(5/38): java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64.rpm | 250 kB 00:00:00
(6/38): fontconfig-2.10.95-11.el7.x86_64.rpm | 229 kB 00:00:00
(7/38): libSM-1.2.2-2.el7.x86_64.rpm | 39 kB 00:00:00
(8/38): libICE-1.0.9-9.el7.x86_64.rpm | 66 kB 00:00:00
(9/38): libXau-1.0.8-2.1.el7.x86_64.rpm | 29 kB 00:00:00
(10/38): libX11-1.6.5-1.el7.x86_64.rpm | 606 kB 00:00:00
(11/38): libX11-common-1.6.5-1.el7.noarch.rpm | 164 kB 00:00:00
(12/38): libXext-1.3.3-3.el7.x86_64.rpm | 39 kB 00:00:00
(13/38): libXcomposite-0.4.4-4.1.el7.x86_64.rpm | 22 kB 00:00:00
(14/38): libXrender-0.9.10-1.el7.x86_64.rpm | 26 kB 00:00:00
(15/38): libXi-1.7.9-1.el7.x86_64.rpm | 40 kB 00:00:00
(16/38): libXfont-1.5.2-1.el7.x86_64.rpm | 152 kB 00:00:00
(17/38): libfontenc-1.1.3-3.el7.x86_64.rpm | 31 kB 00:00:00
(18/38): libXtst-1.2.3-1.el7.x86_64.rpm | 20 kB 00:00:00
(19/38): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm | 134 kB 00:00:00
(20/38): libxcb-1.12-1.el7.x86_64.rpm | 211 kB 00:00:00
(21/38): libxslt-1.1.28-5.el7.x86_64.rpm | 242 kB 00:00:00
(22/38): nspr-4.19.0-1.el7_5.x86_64.rpm | 127 kB 00:00:00
(23/38): libpng-1.5.13-7.el7_2.x86_64.rpm | 213 kB 00:00:00
(24/38): lksctp-tools-1.0.17-2.el7.x86_64.rpm | 88 kB 00:00:00
(25/38): nss-softokn-3.36.0-5.el7_5.x86_64.rpm | 315 kB 00:00:00
(26/38): nss-3.36.0-7.el7_5.x86_64.rpm | 835 kB 00:00:01
(27/38): nss-sysinit-3.36.0-7.el7_5.x86_64.rpm | 62 kB 00:00:00
(28/38): nss-softokn-freebl-3.36.0-5.el7_5.x86_64.rpm | 222 kB 00:00:00
(29/38): nss-util-3.36.0-1.el7_5.x86_64.rpm | 78 kB 00:00:00
(30/38): python-lxml-3.2.1-4.el7.x86_64.rpm | 758 kB 00:00:00
(31/38): ttmkfdir-3.0.9-42.el7.x86_64.rpm | 48 kB 00:00:00
(32/38): nss-tools-3.36.0-7.el7_5.x86_64.rpm | 515 kB 00:00:00
(33/38): python-javapackages-3.4.1-11.el7.noarch.rpm | 31 kB 00:00:00
(34/38): xorg-x11-font-utils-7.5-20.el7.x86_64.rpm | 87 kB 00:00:00
(35/38): stix-fonts-1.1.0-5.el7.noarch.rpm | 1.3 MB 00:00:01
(36/38): tzdata-java-2018e-3.el7.noarch.rpm | 185 kB 00:00:01
(37/38): xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm | 521 kB 00:00:01
(38/38): java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64.rpm | 32 MB 00:00:06
———————————————————————————————————————
总计 5.7 MB/s | 39 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : nspr-4.19.0-1.el7_5.x86_64 1/45
正在更新 : nss-util-3.36.0-1.el7_5.x86_64 2/45
正在安装 : libfontenc-1.1.3-3.el7.x86_64 3/45
正在安装 : libxslt-1.1.28-5.el7.x86_64 4/45
正在安装 : fontpackages-filesystem-1.44-8.el7.noarch 5/45
正在安装 : libjpeg-turbo-1.2.90-5.el7.x86_64 6/45
正在安装 : libICE-1.0.9-9.el7.x86_64 7/45
正在安装 : libSM-1.2.2-2.el7.x86_64 8/45
正在安装 : stix-fonts-1.1.0-5.el7.noarch 9/45
正在安装 : fontconfig-2.10.95-11.el7.x86_64 10/45
正在安装 : python-lxml-3.2.1-4.el7.x86_64 11/45
正在安装 : python-javapackages-3.4.1-11.el7.noarch 12/45
正在安装 : javapackages-tools-3.4.1-11.el7.noarch 13/45
正在安装 : libXfont-1.5.2-1.el7.x86_64 14/45
正在安装 : 1:xorg-x11-font-utils-7.5-20.el7.x86_64 15/45
正在更新 : nss-softokn-freebl-3.36.0-5.el7_5.x86_64 16/45
正在更新 : nss-softokn-3.36.0-5.el7_5.x86_64 17/45
正在更新 : nss-sysinit-3.36.0-7.el7_5.x86_64 18/45
正在更新 : nss-3.36.0-7.el7_5.x86_64 19/45
正在安装 : tzdata-java-2018e-3.el7.noarch 20/45
正在安装 : libXau-1.0.8-2.1.el7.x86_64 21/45
正在安装 : libxcb-1.12-1.el7.x86_64 22/45
正在安装 : libX11-common-1.6.5-1.el7.noarch 23/45
正在安装 : libX11-1.6.5-1.el7.x86_64 24/45
正在安装 : libXext-1.3.3-3.el7.x86_64 25/45
正在安装 : libXi-1.7.9-1.el7.x86_64 26/45
正在安装 : libXtst-1.2.3-1.el7.x86_64 27/45
正在安装 : giflib-4.1.6-9.el7.x86_64 28/45
正在安装 : libXrender-0.9.10-1.el7.x86_64 29/45
正在安装 : libXcomposite-0.4.4-4.1.el7.x86_64 30/45
正在安装 : lksctp-tools-1.0.17-2.el7.x86_64 31/45
正在安装 : copy-jdk-configs-3.3-10.el7_5.noarch 32/45
正在安装 : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 33/45
正在安装 : ttmkfdir-3.0.9-42.el7.x86_64 34/45
正在安装 : xorg-x11-fonts-Type1-7.5-9.el7.noarch 35/45
正在安装 : 2:libpng-1.5.13-7.el7_2.x86_64 36/45
正在安装 : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 37/45
正在更新 : nss-tools-3.36.0-7.el7_5.x86_64 38/45
清理 : nss-tools-3.28.4-8.el7.x86_64 39/45
清理 : nss-sysinit-3.28.4-8.el7.x86_64 40/45
清理 : nss-3.28.4-8.el7.x86_64 41/45
清理 : nss-softokn-3.28.3-6.el7.x86_64 42/45
清理 : nss-util-3.28.4-3.el7.x86_64 43/45
清理 : nspr-4.13.1-1.0.el7_3.x86_64 44/45
清理 : nss-softokn-freebl-3.28.3-6.el7.x86_64 45/45
验证中 : libXext-1.3.3-3.el7.x86_64 1/45
验证中 : libX11-1.6.5-1.el7.x86_64 2/45
验证中 : libXi-1.7.9-1.el7.x86_64 3/45
验证中 : python-javapackages-3.4.1-11.el7.noarch 4/45
验证中 : libICE-1.0.9-9.el7.x86_64 5/45
验证中 : giflib-4.1.6-9.el7.x86_64 6/45
验证中 : libjpeg-turbo-1.2.90-5.el7.x86_64 7/45
验证中 : nspr-4.19.0-1.el7_5.x86_64 8/45
验证中 : libXrender-0.9.10-1.el7.x86_64 9/45
验证中 : libXfont-1.5.2-1.el7.x86_64 10/45
验证中 : python-lxml-3.2.1-4.el7.x86_64 11/45
验证中 : 2:libpng-1.5.13-7.el7_2.x86_64 12/45
验证中 : nss-3.36.0-7.el7_5.x86_64 13/45
验证中 : fontpackages-filesystem-1.44-8.el7.noarch 14/45
验证中 : ttmkfdir-3.0.9-42.el7.x86_64 15/45
验证中 : nss-util-3.36.0-1.el7_5.x86_64 16/45
验证中 : copy-jdk-configs-3.3-10.el7_5.noarch 17/45
验证中 : stix-fonts-1.1.0-5.el7.noarch 18/45
验证中 : libXcomposite-0.4.4-4.1.el7.x86_64 19/45
验证中 : libXtst-1.2.3-1.el7.x86_64 20/45
验证中 : lksctp-tools-1.0.17-2.el7.x86_64 21/45
验证中 : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 22/45
验证中 : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 23/45
验证中 : libxcb-1.12-1.el7.x86_64 24/45
验证中 : xorg-x11-fonts-Type1-7.5-9.el7.noarch 25/45
验证中 : libxslt-1.1.28-5.el7.x86_64 26/45
验证中 : nss-tools-3.36.0-7.el7_5.x86_64 27/45
验证中 : javapackages-tools-3.4.1-11.el7.noarch 28/45
验证中 : libX11-common-1.6.5-1.el7.noarch 29/45
验证中 : nss-sysinit-3.36.0-7.el7_5.x86_64 30/45
验证中 : libXau-1.0.8-2.1.el7.x86_64 31/45
验证中 : nss-softokn-freebl-3.36.0-5.el7_5.x86_64 32/45
验证中 : libSM-1.2.2-2.el7.x86_64 33/45
验证中 : fontconfig-2.10.95-11.el7.x86_64 34/45
验证中 : tzdata-java-2018e-3.el7.noarch 35/45
验证中 : libfontenc-1.1.3-3.el7.x86_64 36/45
验证中 : nss-softokn-3.36.0-5.el7_5.x86_64 37/45
验证中 : 1:xorg-x11-font-utils-7.5-20.el7.x86_64 38/45
验证中 : nspr-4.13.1-1.0.el7_3.x86_64 39/45
验证中 : nss-softokn-3.28.3-6.el7.x86_64 40/45
验证中 : nss-util-3.28.4-3.el7.x86_64 41/45
验证中 : nss-softokn-freebl-3.28.3-6.el7.x86_64 42/45
验证中 : nss-3.28.4-8.el7.x86_64 43/45
验证中 : nss-sysinit-3.28.4-8.el7.x86_64 44/45
验证中 : nss-tools-3.28.4-8.el7.x86_64 45/45
已安装:
java-1.8.0-openjdk.x86_64 1:1.8.0.181-3.b13.el7_5
作为依赖被安装:
copy-jdk-configs.noarch 0:3.3-10.el7_5 fontconfig.x86_64 0:2.10.95-11.el7
fontpackages-filesystem.noarch 0:1.44-8.el7 giflib.x86_64 0:4.1.6-9.el7
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.181-3.b13.el7_5 javapackages-tools.noarch 0:3.4.1-11.el7
libICE.x86_64 0:1.0.9-9.el7 libSM.x86_64 0:1.2.2-2.el7
libX11.x86_64 0:1.6.5-1.el7 libX11-common.noarch 0:1.6.5-1.el7
libXau.x86_64 0:1.0.8-2.1.el7 libXcomposite.x86_64 0:0.4.4-4.1.el7
libXext.x86_64 0:1.3.3-3.el7 libXfont.x86_64 0:1.5.2-1.el7
libXi.x86_64 0:1.7.9-1.el7 libXrender.x86_64 0:0.9.10-1.el7
libXtst.x86_64 0:1.2.3-1.el7 libfontenc.x86_64 0:1.1.3-3.el7
libjpeg-turbo.x86_64 0:1.2.90-5.el7 libpng.x86_64 2:1.5.13-7.el7_2
libxcb.x86_64 0:1.12-1.el7 libxslt.x86_64 0:1.1.28-5.el7
lksctp-tools.x86_64 0:1.0.17-2.el7 python-javapackages.noarch 0:3.4.1-11.el7
python-lxml.x86_64 0:3.2.1-4.el7 stix-fonts.noarch 0:1.1.0-5.el7
ttmkfdir.x86_64 0:3.0.9-42.el7 tzdata-java.noarch 0:2018e-3.el7
xorg-x11-font-utils.x86_64 1:7.5-20.el7 xorg-x11-fonts-Type1.noarch 0:7.5-9.el7
作为依赖被升级:
nspr.x86_64 0:4.19.0-1.el7_5 nss.x86_64 0:3.36.0-7.el7_5 nss-softokn.x86_64 0:3.36.0-5.el7_5
nss-softokn-freebl.x86_64 0:3.36.0-5.el7_5 nss-sysinit.x86_64 0:3.36.0-7.el7_5 nss-tools.x86_64 0:3.36.0-7.el7_5
nss-util.x86_64 0:3.36.0-1.el7_5
完毕!
验证一下JAVA的版本
[root@se1 ~]# java -version
openjdk version “1.8.0_181”
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
写一下本地HOSTS
[root@se1 ~]# vim /etc/hosts
[root@se1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.61 se1
192.168.1.62 se2
192.168.1.63 se3
192.168.1.64 se4
192.168.1.65 se5
确认SE状态为关闭
[root@se1 ~]# sestatus
SELinux status: disabled
开始安装elasticsearch
[root@se1 ~]# yum install -y elasticsearch
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系
–> 正在检查事务
—> 软件包 elasticsearch.noarch.0.2.3.4-1 将被 安装
–> 解决依赖关系完成
依赖关系解决
=====================================================================================================================
Package 架构 版本 源 大小
=====================================================================================================================
正在安装:
elasticsearch noarch 2.3.4-1 elk 26 M
事务概要
=====================================================================================================================
安装 1 软件包
总下载量:26 M
安装大小:29 M
Downloading packages:
elasticsearch-2.3.4.rpm | 26 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Creating elasticsearch group… OK
Creating elasticsearch user… OK
正在安装 : elasticsearch-2.3.4-1.noarch 1/1
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
sudo systemctl start elasticsearch.service
验证中 : elasticsearch-2.3.4-1.noarch 1/1
已安装:
elasticsearch.noarch 0:2.3.4-1
完毕!
修改一下配置文件
[root@se1 ~]# grep -v “^#” /etc/elasticsearch/elasticsearch.yml | grep -v “^$”
cluster.name: myelk
node.name: se1
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: [“se1”, “se2”, “se3”]
重启服务
[root@se1 ~]# systemctl restart elasticsearch.service
[root@se1 ~]# systemctl enable elasticsearch.service
Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
[root@se1 ~]# ss -antup | grep 9200
tcp LISTEN 0 50 :::9200 :::* users:((“java”,pid=1046,fd=110))
[root@se1 ~]#
网页上确认可以正常访问9200端口
[root@room9pc52 ~]# curl 192.168.1.61:9200
{
“name” : “se1”,
“cluster_name” : “myelk”,
“version” : {
“number” : “2.3.4”,
“build_hash” : “e455fd0c13dceca8dbbdbb1665d068ae55dabe3f”,
“build_timestamp” : “2016-06-30T11:24:31Z”,
“build_snapshot” : false,
“lucene_version” : “5.5.0”
},
“tagline” : “You Know, for Search”
}
[root@room9pc52 ~]#
同步61上面的配置文件hosts和elasticsearch.yml,注意,同步过去,不要忘记修改主机名,不然全是一样的
[root@se1 ~]# for i in {62..65} ; do scp /etc/hosts 192.168.1.$i:/etc/hosts ;done
The authenticity of host ‘192.168.1.62 (192.168.1.62)’ can’t be established.
ECDSA key fingerprint is SHA256:Y+OBT/LN+vb2rhuOvlMTWVF5/EJ3oBIdYjxjLB8OdaI.
ECDSA key fingerprint is MD5:07:e5:ec:41:7a:e4:ad:35:5b:6f:1b:59:d3:33:23:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.62’ (ECDSA) to the list of known hosts.
[email protected]’s password:
hosts 100% 243 287.8KB/s 00:00
The authenticity of host ‘192.168.1.63 (192.168.1.63)’ can’t be established.
ECDSA key fingerprint is SHA256:JcEZ87RQms1R13tB0eGi8aD+ai+H9qYEYNDqOvnVICY.
ECDSA key fingerprint is MD5:05:32:3e:2d:80:3e:2d:a1:22:d9:42:d5:79:17:26:34.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.63’ (ECDSA) to the list of known hosts.
[email protected]’s password:
hosts 100% 243 394.4KB/s 00:00
The authenticity of host ‘192.168.1.64 (192.168.1.64)’ can’t be established.
ECDSA key fingerprint is SHA256:8axSZjRuqYMzqz/3wNsmvnq0vFTbBLAS/cvNyJHYTKI.
ECDSA key fingerprint is MD5:53:df:64:6d:e5:9c:67:10:9c:6c:81:49:c0:d3:38:50.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.64’ (ECDSA) to the list of known hosts.
[email protected]’s password:
hosts 100% 243 373.2KB/s 00:00
The authenticity of host ‘192.168.1.65 (192.168.1.65)’ can’t be established.
ECDSA key fingerprint is SHA256:pGdPEN/OM7aKiW7ACaGAyrUo2BhayinSMNytumuHiiE.
ECDSA key fingerprint is MD5:e6:75:8b:64:d1:da:4f:89:11:ff:91:4a:b1:f1:64:a1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.65’ (ECDSA) to the list of known hosts.
[email protected]’s password:
hosts 100% 243 245.9KB/s 00:00
[root@se1 ~]# for i in {62..65} ; do scp /etc/elasticsearch/elasticsearch.yml 192.168.1.$i:/etc/elasticsearch/elasticsearch.yml ;done
[email protected]’s password:
elasticsearch.yml 100% 3172 10.8MB/s 00:00
[email protected]’s password:
elasticsearch.yml 100% 3172 2.9MB/s 00:00
[email protected]’s password:
elasticsearch.yml 100% 3172 4.9MB/s 00:00
[email protected]’s password:
elasticsearch.yml 100% 3172 11.3MB/s 00:00
[root@se1 ~]#
按照se1\2\3\4\5的顺序重启服务,我把node2的操作贴一下,3、4、5是一样的
[root@room9pc52 ~]# ssh 192.168.1.62
The authenticity of host ‘192.168.1.62 (192.168.1.62)’ can’t be established.
ECDSA key fingerprint is SHA256:Y+OBT/LN+vb2rhuOvlMTWVF5/EJ3oBIdYjxjLB8OdaI.
ECDSA key fingerprint is MD5:07:e5:ec:41:7a:e4:ad:35:5b:6f:1b:59:d3:33:23:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.62’ (ECDSA) to the list of known hosts.
[email protected]’s password:
Last login: Sun Oct 21 09:23:59 2018
[root@se2 ~]#
[root@se2 ~]#
[root@se2 ~]#
[root@se2 ~]# yum install -y java-1.8.0-openjdk elasticsearch
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
正在解决依赖关系
–> 正在检查事务
—> 软件包 elasticsearch.noarch.0.2.3.4-1 将被 安装
—> 软件包 java-1.8.0-openjdk.x86_64.1.1.8.0.181-3.b13.el7_5 将被 安装
–> 正在处理依赖关系 java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.181-3.b13.el7_5,它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 xorg-x11-fonts-Type1,它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libpng15.so.15(PNG15_0)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjvm.so(SUNWprivate_1.1)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjpeg.so.62(LIBJPEG_6.2)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjava.so(SUNWprivate_1.1)(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 fontconfig(x86-64),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libpng15.so.15()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjvm.so()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjpeg.so.62()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libjava.so()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libgif.so.4()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXtst.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXrender.so.1()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXi.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXext.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libXcomposite.so.1()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 libX11.so.6()(64bit),它被软件包 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在检查事务
—> 软件包 fontconfig.x86_64.0.2.10.95-11.el7 将被 安装
–> 正在处理依赖关系 fontpackages-filesystem,它被软件包 fontconfig-2.10.95-11.el7.x86_64 需要
–> 正在处理依赖关系 font(:lang=en),它被软件包 fontconfig-2.10.95-11.el7.x86_64 需要
—> 软件包 giflib.x86_64.0.4.1.6-9.el7 将被 安装
–> 正在处理依赖关系 libSM.so.6()(64bit),它被软件包 giflib-4.1.6-9.el7.x86_64 需要
–> 正在处理依赖关系 libICE.so.6()(64bit),它被软件包 giflib-4.1.6-9.el7.x86_64 需要
—> 软件包 java-1.8.0-openjdk-headless.x86_64.1.1.8.0.181-3.b13.el7_5 将被 安装
–> 正在处理依赖关系 tzdata-java >= 2015d,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 nss-softokn(x86-64) >= 3.36.0,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 nss(x86-64) >= 3.36.0,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 copy-jdk-configs >= 2.2,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 lksctp-tools(x86-64),它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
–> 正在处理依赖关系 jpackage-utils,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 需要
—> 软件包 libX11.x86_64.0.1.6.5-1.el7 将被 安装
–> 正在处理依赖关系 libX11-common >= 1.6.5-1.el7,它被软件包 libX11-1.6.5-1.el7.x86_64 需要
–> 正在处理依赖关系 libxcb.so.1()(64bit),它被软件包 libX11-1.6.5-1.el7.x86_64 需要
—> 软件包 libXcomposite.x86_64.0.0.4.4-4.1.el7 将被 安装
—> 软件包 libXext.x86_64.0.1.3.3-3.el7 将被 安装
—> 软件包 libXi.x86_64.0.1.7.9-1.el7 将被 安装
—> 软件包 libXrender.x86_64.0.0.9.10-1.el7 将被 安装
—> 软件包 libXtst.x86_64.0.1.2.3-1.el7 将被 安装
—> 软件包 libjpeg-turbo.x86_64.0.1.2.90-5.el7 将被 安装
—> 软件包 libpng.x86_64.2.1.5.13-7.el7_2 将被 安装
—> 软件包 xorg-x11-fonts-Type1.noarch.0.7.5-9.el7 将被 安装
–> 正在处理依赖关系 ttmkfdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在处理依赖关系 ttmkfdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在处理依赖关系 mkfontdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在处理依赖关系 mkfontdir,它被软件包 xorg-x11-fonts-Type1-7.5-9.el7.noarch 需要
–> 正在检查事务
—> 软件包 copy-jdk-configs.noarch.0.3.3-10.el7_5 将被 安装
—> 软件包 fontpackages-filesystem.noarch.0.1.44-8.el7 将被 安装
—> 软件包 javapackages-tools.noarch.0.3.4.1-11.el7 将被 安装
–> 正在处理依赖关系 python-javapackages = 3.4.1-11.el7,它被软件包 javapackages-tools-3.4.1-11.el7.noarch 需要
–> 正在处理依赖关系 libxslt,它被软件包 javapackages-tools-3.4.1-11.el7.noarch 需要
—> 软件包 libICE.x86_64.0.1.0.9-9.el7 将被 安装
—> 软件包 libSM.x86_64.0.1.2.2-2.el7 将被 安装
—> 软件包 libX11-common.noarch.0.1.6.5-1.el7 将被 安装
—> 软件包 libxcb.x86_64.0.1.12-1.el7 将被 安装
–> 正在处理依赖关系 libXau.so.6()(64bit),它被软件包 libxcb-1.12-1.el7.x86_64 需要
—> 软件包 lksctp-tools.x86_64.0.1.0.17-2.el7 将被 安装
—> 软件包 nss.x86_64.0.3.28.4-8.el7 将被 升级
–> 正在处理依赖关系 nss = 3.28.4-8.el7,它被软件包 nss-sysinit-3.28.4-8.el7.x86_64 需要
–> 正在处理依赖关系 nss(x86-64) = 3.28.4-8.el7,它被软件包 nss-tools-3.28.4-8.el7.x86_64 需要
—> 软件包 nss.x86_64.0.3.36.0-7.el7_5 将被 更新
–> 正在处理依赖关系 nss-util >= 3.36.0-1,它被软件包 nss-3.36.0-7.el7_5.x86_64 需要
–> 正在处理依赖关系 nspr >= 4.19.0,它被软件包 nss-3.36.0-7.el7_5.x86_64 需要
–> 正在处理依赖关系 libnssutil3.so(NSSUTIL_3.31)(64bit),它被软件包 nss-3.36.0-7.el7_5.x86_64 需要
—> 软件包 nss-softokn.x86_64.0.3.28.3-6.el7 将被 升级
—> 软件包 nss-softokn.x86_64.0.3.36.0-5.el7_5 将被 更新
–> 正在处理依赖关系 nss-softokn-freebl(x86-64) >= 3.36.0-5.el7_5,它被软件包 nss-softokn-3.36.0-5.el7_5.x86_64 需要
—> 软件包 stix-fonts.noarch.0.1.1.0-5.el7 将被 安装
—> 软件包 ttmkfdir.x86_64.0.3.0.9-42.el7 将被 安装
—> 软件包 tzdata-java.noarch.0.2018e-3.el7 将被 安装
—> 软件包 xorg-x11-font-utils.x86_64.1.7.5-20.el7 将被 安装
–> 正在处理依赖关系 libfontenc.so.1()(64bit),它被软件包 1:xorg-x11-font-utils-7.5-20.el7.x86_64 需要
–> 正在处理依赖关系 libXfont.so.1()(64bit),它被软件包 1:xorg-x11-font-utils-7.5-20.el7.x86_64 需要
–> 正在检查事务
—> 软件包 libXau.x86_64.0.1.0.8-2.1.el7 将被 安装
—> 软件包 libXfont.x86_64.0.1.5.2-1.el7 将被 安装
—> 软件包 libfontenc.x86_64.0.1.1.3-3.el7 将被 安装
—> 软件包 libxslt.x86_64.0.1.1.28-5.el7 将被 安装
—> 软件包 nspr.x86_64.0.4.13.1-1.0.el7_3 将被 升级
—> 软件包 nspr.x86_64.0.4.19.0-1.el7_5 将被 更新
—> 软件包 nss-softokn-freebl.x86_64.0.3.28.3-6.el7 将被 升级
—> 软件包 nss-softokn-freebl.x86_64.0.3.36.0-5.el7_5 将被 更新
—> 软件包 nss-sysinit.x86_64.0.3.28.4-8.el7 将被 升级
—> 软件包 nss-sysinit.x86_64.0.3.36.0-7.el7_5 将被 更新
—> 软件包 nss-tools.x86_64.0.3.28.4-8.el7 将被 升级
—> 软件包 nss-tools.x86_64.0.3.36.0-7.el7_5 将被 更新
—> 软件包 nss-util.x86_64.0.3.28.4-3.el7 将被 升级
—> 软件包 nss-util.x86_64.0.3.36.0-1.el7_5 将被 更新
—> 软件包 python-javapackages.noarch.0.3.4.1-11.el7 将被 安装
–> 正在处理依赖关系 python-lxml,它被软件包 python-javapackages-3.4.1-11.el7.noarch 需要
–> 正在检查事务
—> 软件包 python-lxml.x86_64.0.3.2.1-4.el7 将被 安装
–> 解决依赖关系完成
依赖关系解决
=====================================================================================================================
Package 架构 版本 源 大小
=====================================================================================================================
正在安装:
elasticsearch noarch 2.3.4-1 elk 26 M
java-1.8.0-openjdk x86_64 1:1.8.0.181-3.b13.el7_5 updates 250 k
为依赖而安装:
copy-jdk-configs noarch 3.3-10.el7_5 updates 21 k
fontconfig x86_64 2.10.95-11.el7 base 229 k
fontpackages-filesystem noarch 1.44-8.el7 base 9.9 k
giflib x86_64 4.1.6-9.el7 base 40 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.181-3.b13.el7_5 updates 32 M
javapackages-tools noarch 3.4.1-11.el7 base 73 k
libICE x86_64 1.0.9-9.el7 base 66 k
libSM x86_64 1.2.2-2.el7 base 39 k
libX11 x86_64 1.6.5-1.el7 base 606 k
libX11-common noarch 1.6.5-1.el7 base 164 k
libXau x86_64 1.0.8-2.1.el7 base 29 k
libXcomposite x86_64 0.4.4-4.1.el7 base 22 k
libXext x86_64 1.3.3-3.el7 base 39 k
libXfont x86_64 1.5.2-1.el7 base 152 k
libXi x86_64 1.7.9-1.el7 base 40 k
libXrender x86_64 0.9.10-1.el7 base 26 k
libXtst x86_64 1.2.3-1.el7 base 20 k
libfontenc x86_64 1.1.3-3.el7 base 31 k
libjpeg-turbo x86_64 1.2.90-5.el7 base 134 k
libpng x86_64 2:1.5.13-7.el7_2 base 213 k
libxcb x86_64 1.12-1.el7 base 211 k
libxslt x86_64 1.1.28-5.el7 base 242 k
lksctp-tools x86_64 1.0.17-2.el7 base 88 k
python-javapackages noarch 3.4.1-11.el7 base 31 k
python-lxml x86_64 3.2.1-4.el7 base 758 k
stix-fonts noarch 1.1.0-5.el7 base 1.3 M
ttmkfdir x86_64 3.0.9-42.el7 base 48 k
tzdata-java noarch 2018e-3.el7 updates 185 k
xorg-x11-font-utils x86_64 1:7.5-20.el7 base 87 k
xorg-x11-fonts-Type1 noarch 7.5-9.el7 base 521 k
为依赖而更新:
nspr x86_64 4.19.0-1.el7_5 updates 127 k
nss x86_64 3.36.0-7.el7_5 updates 835 k
nss-softokn x86_64 3.36.0-5.el7_5 updates 315 k
nss-softokn-freebl x86_64 3.36.0-5.el7_5 updates 222 k
nss-sysinit x86_64 3.36.0-7.el7_5 updates 62 k
nss-tools x86_64 3.36.0-7.el7_5 updates 515 k
nss-util x86_64 3.36.0-1.el7_5 updates 78 k
事务概要
=====================================================================================================================
安装 2 软件包 (+30 依赖软件包)
升级 ( 7 依赖软件包)
总下载量:66 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/39): elasticsearch-2.3.4.rpm | 26 MB 00:00:00
(2/39): fontpackages-filesystem-1.44-8.el7.noarch.rpm | 9.9 kB 00:00:00
(3/39): giflib-4.1.6-9.el7.x86_64.rpm | 40 kB 00:00:00
(4/39): copy-jdk-configs-3.3-10.el7_5.noarch.rpm | 21 kB 00:00:00
(5/39): javapackages-tools-3.4.1-11.el7.noarch.rpm | 73 kB 00:00:00
(6/39): fontconfig-2.10.95-11.el7.x86_64.rpm | 229 kB 00:00:00
(7/39): libSM-1.2.2-2.el7.x86_64.rpm | 39 kB 00:00:00
(8/39): libX11-1.6.5-1.el7.x86_64.rpm | 606 kB 00:00:00
(9/39): libICE-1.0.9-9.el7.x86_64.rpm | 66 kB 00:00:00
(10/39): java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64.rpm | 250 kB 00:00:00
(11/39): libXau-1.0.8-2.1.el7.x86_64.rpm | 29 kB 00:00:00
(12/39): libXcomposite-0.4.4-4.1.el7.x86_64.rpm | 22 kB 00:00:00
(13/39): libXext-1.3.3-3.el7.x86_64.rpm | 39 kB 00:00:00
(14/39): libX11-common-1.6.5-1.el7.noarch.rpm | 164 kB 00:00:00
(15/39): libXfont-1.5.2-1.el7.x86_64.rpm | 152 kB 00:00:00
(16/39): libXi-1.7.9-1.el7.x86_64.rpm | 40 kB 00:00:00
(17/39): libXtst-1.2.3-1.el7.x86_64.rpm | 20 kB 00:00:00
(18/39): libXrender-0.9.10-1.el7.x86_64.rpm | 26 kB 00:00:00
(19/39): libfontenc-1.1.3-3.el7.x86_64.rpm | 31 kB 00:00:00
(20/39): libpng-1.5.13-7.el7_2.x86_64.rpm | 213 kB 00:00:00
(21/39): libxslt-1.1.28-5.el7.x86_64.rpm | 242 kB 00:00:00
(22/39): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm | 134 kB 00:00:00
(23/39): lksctp-tools-1.0.17-2.el7.x86_64.rpm | 88 kB 00:00:00
(24/39): nspr-4.19.0-1.el7_5.x86_64.rpm | 127 kB 00:00:00
(25/39): nss-3.36.0-7.el7_5.x86_64.rpm | 835 kB 00:00:00
(26/39): libxcb-1.12-1.el7.x86_64.rpm | 211 kB 00:00:00
(27/39): nss-softokn-3.36.0-5.el7_5.x86_64.rpm | 315 kB 00:00:00
(28/39): nss-softokn-freebl-3.36.0-5.el7_5.x86_64.rpm | 222 kB 00:00:00
(29/39): nss-sysinit-3.36.0-7.el7_5.x86_64.rpm | 62 kB 00:00:00
(30/39): nss-tools-3.36.0-7.el7_5.x86_64.rpm | 515 kB 00:00:01
(31/39): nss-util-3.36.0-1.el7_5.x86_64.rpm | 78 kB 00:00:00
(32/39): python-javapackages-3.4.1-11.el7.noarch.rpm | 31 kB 00:00:00
(33/39): ttmkfdir-3.0.9-42.el7.x86_64.rpm | 48 kB 00:00:00
(34/39): xorg-x11-font-utils-7.5-20.el7.x86_64.rpm | 87 kB 00:00:00
(35/39): tzdata-java-2018e-3.el7.noarch.rpm | 185 kB 00:00:00
(36/39): java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64.rpm | 32 MB 00:00:05
(37/39): xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm | 521 kB 00:00:01
(38/39): stix-fonts-1.1.0-5.el7.noarch.rpm | 1.3 MB 00:00:01
(39/39): python-lxml-3.2.1-4.el7.x86_64.rpm | 758 kB 00:00:02
———————————————————————————————————————
总计 9.8 MB/s | 66 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : nspr-4.19.0-1.el7_5.x86_64 1/46
正在更新 : nss-util-3.36.0-1.el7_5.x86_64 2/46
正在安装 : libfontenc-1.1.3-3.el7.x86_64 3/46
正在安装 : libxslt-1.1.28-5.el7.x86_64 4/46
正在安装 : fontpackages-filesystem-1.44-8.el7.noarch 5/46
正在安装 : libjpeg-turbo-1.2.90-5.el7.x86_64 6/46
正在安装 : libICE-1.0.9-9.el7.x86_64 7/46
正在安装 : libSM-1.2.2-2.el7.x86_64 8/46
正在安装 : stix-fonts-1.1.0-5.el7.noarch 9/46
正在安装 : fontconfig-2.10.95-11.el7.x86_64 10/46
正在安装 : python-lxml-3.2.1-4.el7.x86_64 11/46
正在安装 : python-javapackages-3.4.1-11.el7.noarch 12/46
正在安装 : javapackages-tools-3.4.1-11.el7.noarch 13/46
正在安装 : libXfont-1.5.2-1.el7.x86_64 14/46
正在安装 : 1:xorg-x11-font-utils-7.5-20.el7.x86_64 15/46
正在更新 : nss-softokn-freebl-3.36.0-5.el7_5.x86_64 16/46
正在更新 : nss-softokn-3.36.0-5.el7_5.x86_64 17/46
正在更新 : nss-sysinit-3.36.0-7.el7_5.x86_64 18/46
正在更新 : nss-3.36.0-7.el7_5.x86_64 19/46
正在安装 : tzdata-java-2018e-3.el7.noarch 20/46
正在安装 : libXau-1.0.8-2.1.el7.x86_64 21/46
正在安装 : libxcb-1.12-1.el7.x86_64 22/46
正在安装 : libX11-common-1.6.5-1.el7.noarch 23/46
正在安装 : libX11-1.6.5-1.el7.x86_64 24/46
正在安装 : libXext-1.3.3-3.el7.x86_64 25/46
正在安装 : libXi-1.7.9-1.el7.x86_64 26/46
正在安装 : libXtst-1.2.3-1.el7.x86_64 27/46
正在安装 : giflib-4.1.6-9.el7.x86_64 28/46
正在安装 : libXrender-0.9.10-1.el7.x86_64 29/46
正在安装 : libXcomposite-0.4.4-4.1.el7.x86_64 30/46
正在安装 : lksctp-tools-1.0.17-2.el7.x86_64 31/46
正在安装 : copy-jdk-configs-3.3-10.el7_5.noarch 32/46
正在安装 : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 33/46
正在安装 : ttmkfdir-3.0.9-42.el7.x86_64 34/46
正在安装 : xorg-x11-fonts-Type1-7.5-9.el7.noarch 35/46
正在安装 : 2:libpng-1.5.13-7.el7_2.x86_64 36/46
正在安装 : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 37/46
正在更新 : nss-tools-3.36.0-7.el7_5.x86_64 38/46
Creating elasticsearch group… OK
Creating elasticsearch user… OK
正在安装 : elasticsearch-2.3.4-1.noarch 39/46
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
sudo systemctl start elasticsearch.service
清理 : nss-tools-3.28.4-8.el7.x86_64 40/46
清理 : nss-sysinit-3.28.4-8.el7.x86_64 41/46
清理 : nss-3.28.4-8.el7.x86_64 42/46
清理 : nss-softokn-3.28.3-6.el7.x86_64 43/46
清理 : nss-util-3.28.4-3.el7.x86_64 44/46
清理 : nspr-4.13.1-1.0.el7_3.x86_64 45/46
清理 : nss-softokn-freebl-3.28.3-6.el7.x86_64 46/46
验证中 : libXext-1.3.3-3.el7.x86_64 1/46
验证中 : libX11-1.6.5-1.el7.x86_64 2/46
验证中 : libXi-1.7.9-1.el7.x86_64 3/46
验证中 : python-javapackages-3.4.1-11.el7.noarch 4/46
验证中 : libICE-1.0.9-9.el7.x86_64 5/46
验证中 : giflib-4.1.6-9.el7.x86_64 6/46
验证中 : libjpeg-turbo-1.2.90-5.el7.x86_64 7/46
验证中 : nspr-4.19.0-1.el7_5.x86_64 8/46
验证中 : libXrender-0.9.10-1.el7.x86_64 9/46
验证中 : libXfont-1.5.2-1.el7.x86_64 10/46
验证中 : python-lxml-3.2.1-4.el7.x86_64 11/46
验证中 : 2:libpng-1.5.13-7.el7_2.x86_64 12/46
验证中 : nss-3.36.0-7.el7_5.x86_64 13/46
验证中 : fontpackages-filesystem-1.44-8.el7.noarch 14/46
验证中 : ttmkfdir-3.0.9-42.el7.x86_64 15/46
验证中 : nss-util-3.36.0-1.el7_5.x86_64 16/46
验证中 : copy-jdk-configs-3.3-10.el7_5.noarch 17/46
验证中 : stix-fonts-1.1.0-5.el7.noarch 18/46
验证中 : libXcomposite-0.4.4-4.1.el7.x86_64 19/46
验证中 : libXtst-1.2.3-1.el7.x86_64 20/46
验证中 : lksctp-tools-1.0.17-2.el7.x86_64 21/46
验证中 : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 22/46
验证中 : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64 23/46
验证中 : libxcb-1.12-1.el7.x86_64 24/46
验证中 : xorg-x11-fonts-Type1-7.5-9.el7.noarch 25/46
验证中 : libxslt-1.1.28-5.el7.x86_64 26/46
验证中 : nss-tools-3.36.0-7.el7_5.x86_64 27/46
验证中 : javapackages-tools-3.4.1-11.el7.noarch 28/46
验证中 : elasticsearch-2.3.4-1.noarch 29/46
验证中 : libX11-common-1.6.5-1.el7.noarch 30/46
验证中 : nss-sysinit-3.36.0-7.el7_5.x86_64 31/46
验证中 : libXau-1.0.8-2.1.el7.x86_64 32/46
验证中 : nss-softokn-freebl-3.36.0-5.el7_5.x86_64 33/46
验证中 : libSM-1.2.2-2.el7.x86_64 34/46
验证中 : fontconfig-2.10.95-11.el7.x86_64 35/46
验证中 : tzdata-java-2018e-3.el7.noarch 36/46
验证中 : libfontenc-1.1.3-3.el7.x86_64 37/46
验证中 : nss-softokn-3.36.0-5.el7_5.x86_64 38/46
验证中 : 1:xorg-x11-font-utils-7.5-20.el7.x86_64 39/46
验证中 : nspr-4.13.1-1.0.el7_3.x86_64 40/46
验证中 : nss-softokn-3.28.3-6.el7.x86_64 41/46
验证中 : nss-util-3.28.4-3.el7.x86_64 42/46
验证中 : nss-softokn-freebl-3.28.3-6.el7.x86_64 43/46
验证中 : nss-3.28.4-8.el7.x86_64 44/46
验证中 : nss-sysinit-3.28.4-8.el7.x86_64 45/46
验证中 : nss-tools-3.28.4-8.el7.x86_64 46/46
已安装:
elasticsearch.noarch 0:2.3.4-1 java-1.8.0-openjdk.x86_64 1:1.8.0.181-3.b13.el7_5
作为依赖被安装:
copy-jdk-configs.noarch 0:3.3-10.el7_5 fontconfig.x86_64 0:2.10.95-11.el7
fontpackages-filesystem.noarch 0:1.44-8.el7 giflib.x86_64 0:4.1.6-9.el7
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.181-3.b13.el7_5 javapackages-tools.noarch 0:3.4.1-11.el7
libICE.x86_64 0:1.0.9-9.el7 libSM.x86_64 0:1.2.2-2.el7
libX11.x86_64 0:1.6.5-1.el7 libX11-common.noarch 0:1.6.5-1.el7
libXau.x86_64 0:1.0.8-2.1.el7 libXcomposite.x86_64 0:0.4.4-4.1.el7
libXext.x86_64 0:1.3.3-3.el7 libXfont.x86_64 0:1.5.2-1.el7
libXi.x86_64 0:1.7.9-1.el7 libXrender.x86_64 0:0.9.10-1.el7
libXtst.x86_64 0:1.2.3-1.el7 libfontenc.x86_64 0:1.1.3-3.el7
libjpeg-turbo.x86_64 0:1.2.90-5.el7 libpng.x86_64 2:1.5.13-7.el7_2
libxcb.x86_64 0:1.12-1.el7 libxslt.x86_64 0:1.1.28-5.el7
lksctp-tools.x86_64 0:1.0.17-2.el7 python-javapackages.noarch 0:3.4.1-11.el7
python-lxml.x86_64 0:3.2.1-4.el7 stix-fonts.noarch 0:1.1.0-5.el7
ttmkfdir.x86_64 0:3.0.9-42.el7 tzdata-java.noarch 0:2018e-3.el7
xorg-x11-font-utils.x86_64 1:7.5-20.el7 xorg-x11-fonts-Type1.noarch 0:7.5-9.el7
作为依赖被升级:
nspr.x86_64 0:4.19.0-1.el7_5 nss.x86_64 0:3.36.0-7.el7_5 nss-softokn.x86_64 0:3.36.0-5.el7_5
nss-softokn-freebl.x86_64 0:3.36.0-5.el7_5 nss-sysinit.x86_64 0:3.36.0-7.el7_5 nss-tools.x86_64 0:3.36.0-7.el7_5
nss-util.x86_64 0:3.36.0-1.el7_5
完毕!
[root@se2 ~]# systemctl restart elasticsearch
[root@se2 ~]# systemctl enable elasticsearch
Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
[root@se2 ~]#
[root@se2 ~]#
[root@se2 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.61 se1
192.168.1.62 se2
192.168.1.63 se3
192.168.1.64 se4
192.168.1.65 se5
[root@se2 ~]# cat /etc/elasticsearch/elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please see the documentation for further information on configuration options:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html>
#
# ———————————- Cluster ———————————–
#
# Use a descriptive name for your cluster:
#
cluster.name: myelk
#
# ———————————— Node ————————————
#
# Use a descriptive name for the node:
#
node.name: se2
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ———————————– Paths ————————————
#
# Path to directory where to store the data (separate multiple locations by comma):
#
# path.data: /path/to/data
#
# Path to log files:
#
# path.logs: /path/to/logs
#
# ———————————– Memory ———————————–
#
# Lock the memory on startup:
#
# bootstrap.mlockall: true
#
# Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory
# available on the system and that the owner of the process is allowed to use this limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ———————————- Network ———————————–
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# ——————————— Discovery ———————————-
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is [“127.0.0.1”, “[::1]”]
#
discovery.zen.ping.unicast.hosts: [“se1”, “se2”, “se3”]
#
# Prevent the “split brain” by configuring the majority of nodes (total number of nodes / 2 + 1):
#
# discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ———————————- Gateway ———————————–
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ———————————- Various ———————————–
#
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true
[root@se2 ~]#
访问测试集群状态
ES 集群验证:返回字段解析:
”status”: ”green“ 集群状态:绿色为正常、黄色表示有问题但不是很严重、红色表示严重故障
”number_of_nodes”: 5, 表示集群中节点的数量
[root@room9pc52 ~]# curl 192.168.1.61:9200/_cluster/health?pretty
{
“cluster_name” : “myelk”,
“status” : “green”,
“timed_out” : false,
“number_of_nodes” : 5,
“number_of_data_nodes” : 5,
“active_primary_shards” : 0,
“active_shards” : 0,
“relocating_shards” : 0,
“initializing_shards” : 0,
“unassigned_shards” : 0,
“delayed_unassigned_shards” : 0,
“number_of_pending_tasks” : 0,
“number_of_in_flight_fetch” : 0,
“task_max_waiting_in_queue_millis” : 0,
“active_shards_percent_as_number” : 100.0
}
[root@room9pc52 ~]#
3 案例3:练习curl命令
3.1 问题
本案例要求:
练习使用curl命令
理解GET POST
使用curl命令访问ES集群
3.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:curl命令的使用
http的请求方法:
常用方法 GET,POST,HEAD
其他方法 OPTIONS,PUT,DELETE,TRACE和CONNECT
ES常用:
PUT –增
DELETE –删
POST –改
GET –查
系统命令curl:
是一个利用URL规则在命令行下工作的文件传输工具,可以说是一款很强大的http命令行工具。它支持多种请求模式,自定义请求头等强大功能,是一款综合工具
curl 常用参数介绍:
-A 修改请求 agent
-X 设置请求方法
-i 显示返回头信息
1)索引的分片信息,如图-1所示:
[root@room9pc01 ~]# curl -X GET http://192.168.1.61:9200/_cat
图-1
2)显示health的详细信息,如图-2所示:
[root@room9pc01 ~]# curl -X GET http://192.168.1.62:9200/_cat/health?v
图-2
3)查看nodes的帮助,如图-3所示:
[root@room9pc01 ~]# curl -X GET http://192.168.1.61:9200/_cat/nodes?help
图-3
代码如下
查看索引分片信息
[root@room9pc52 ~]# curl -X GET http://192.168.1.61:9200/_cat
=^.^=
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}
/_cat/segments
/_cat/segments/{index}
/_cat/count
/_cat/count/{index}
/_cat/recovery
/_cat/recovery/{index}
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/aliases/{alias}
/_cat/thread_pool
/_cat/plugins
/_cat/fielddata
/_cat/fielddata/{fields}
/_cat/nodeattrs
/_cat/repositories
/_cat/snapshots/{repository}
[root@room9pc52 ~]#
查看节点健康状态
[root@room9pc52 ~]# curl -X GET http://192.168.1.62:9200/_cat/health?v
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1540090287 10:51:27 myelk green 5 5 0 0 0 0 0 0 – 100.0%
查看nodes的帮助信息
[root@room9pc52 ~]# curl -X GET http://192.168.1.61:9200/_cat/nodes?help
id | id,nodeId | unique node id
pid | p | process id
host | h | host name
ip | i | ip address
port | po | bound transport port
version | v | es version
build | b | es build hash
jdk | j | jdk version
disk.avail | d,disk,diskAvail | available disk space
heap.current | hc,heapCurrent | used heap
heap.percent | hp,heapPercent | used heap ratio
heap.max | hm,heapMax | max configured heap
ram.current | rc,ramCurrent | used machine memory
ram.percent | rp,ramPercent | used machine memory ratio
ram.max | rm,ramMax | total machine memory
file_desc.current | fdc,fileDescriptorCurrent | used file descriptors
file_desc.percent | fdp,fileDescriptorPercent | used file descriptor ratio
file_desc.max | fdm,fileDescriptorMax | max file descriptors
cpu | cpu | recent cpu usage
load | l | most recent load avg
uptime | u | node uptime
node.role | r,role,dc,nodeRole | d:data node, c:client node
master | m | m:master-eligible, *:current master
name | n | node name
completion.size | cs,completionSize | size of completion
fielddata.memory_size | fm,fielddataMemory | used fielddata cache
fielddata.evictions | fe,fielddataEvictions | fielddata evictions
query_cache.memory_size | qcm,queryCacheMemory | used query cache
query_cache.evictions | qce,queryCacheEvictions | query cache evictions
request_cache.memory_size | rcm,requestCacheMemory | used request cache
request_cache.evictions | rce,requestCacheEvictions | request cache evictions
request_cache.hit_count | rchc,requestCacheHitCount | request cache hit counts
request_cache.miss_count | rcmc,requestCacheMissCount | request cache miss counts
flush.total | ft,flushTotal | number of flushes
flush.total_time | ftt,flushTotalTime | time spent in flush
get.current | gc,getCurrent | number of current get ops
get.time | gti,getTime | time spent in get
get.total | gto,getTotal | number of get ops
get.exists_time | geti,getExistsTime | time spent in successful gets
get.exists_total | geto,getExistsTotal | number of successful gets
get.missing_time | gmti,getMissingTime | time spent in failed gets
get.missing_total | gmto,getMissingTotal | number of failed gets
indexing.delete_current | idc,indexingDeleteCurrent | number of current deletions
indexing.delete_time | idti,indexingDeleteTime | time spent in deletions
indexing.delete_total | idto,indexingDeleteTotal | number of delete ops
indexing.index_current | iic,indexingIndexCurrent | number of current indexing ops
indexing.index_time | iiti,indexingIndexTime | time spent in indexing
indexing.index_total | iito,indexingIndexTotal | number of indexing ops
indexing.index_failed | iif,indexingIndexFailed | number of failed indexing ops
merges.current | mc,mergesCurrent | number of current merges
merges.current_docs | mcd,mergesCurrentDocs | number of current merging docs
merges.current_size | mcs,mergesCurrentSize | size of current merges
merges.total | mt,mergesTotal | number of completed merge ops
merges.total_docs | mtd,mergesTotalDocs | docs merged
merges.total_size | mts,mergesTotalSize | size merged
merges.total_time | mtt,mergesTotalTime | time spent in merges
percolate.current | pc,percolateCurrent | number of current percolations
percolate.memory_size | pm,percolateMemory | memory used by percolations
percolate.queries | pq,percolateQueries | number of registered percolation queries
percolate.time | pti,percolateTime | time spent percolating
percolate.total | pto,percolateTotal | total percolations
refresh.total | rto,refreshTotal | total refreshes
refresh.time | rti,refreshTime | time spent in refreshes
script.compilations | scrcc,scriptCompilations | script compilations
script.cache_evictions | scrce,scriptCacheEvictions | script cache evictions
search.fetch_current | sfc,searchFetchCurrent | current fetch phase ops
search.fetch_time | sfti,searchFetchTime | time spent in fetch phase
search.fetch_total | sfto,searchFetchTotal | total fetch ops
search.open_contexts | so,searchOpenContexts | open search contexts
search.query_current | sqc,searchQueryCurrent | current query phase ops
search.query_time | sqti,searchQueryTime | time spent in query phase
search.query_total | sqto,searchQueryTotal | total query phase ops
search.scroll_current | scc,searchScrollCurrent | open scroll contexts
search.scroll_time | scti,searchScrollTime | time scroll contexts held open
search.scroll_total | scto,searchScrollTotal | completed scroll contexts
segments.count | sc,segmentsCount | number of segments
segments.memory | sm,segmentsMemory | memory used by segments
segments.index_writer_memory | siwm,segmentsIndexWriterMemory | memory used by index writer
segments.index_writer_max_memory | siwmx,segmentsIndexWriterMaxMemory | maximum memory index writer may use before it must write buffered documents to a new segment
segments.version_map_memory | svmm,segmentsVersionMapMemory | memory used by version map
segments.fixed_bitset_memory | sfbm,fixedBitsetMemory | memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields
suggest.current | suc,suggestCurrent | number of current suggest ops
suggest.time | suti,suggestTime | time spend in suggest
suggest.total | suto,suggestTotal | number of suggest ops
[root@room9pc52 ~]#
4 案例4:练习插件
4.1 问题
本案例要求:
在其中一台机器上部署插件
使用bigdesk查看集群状态
使用head创建index
使用kopf查看数据
4.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:部署插件
插件装在哪一台机器上,只能在哪台机器上使用(这里安装在se5机器上面)
1)使用远程 uri 路径可以直接安装
[root@se5 ~]# cd /usr/share/elasticsearch/bin
[root@se5 bin]# ./plugin install \
ftp://192.168.1.254/elk/elasticsearch-head-master.zip //安装head插件
[root@se5 bin]# ./plugin install \
ftp://192.168.1.254/elk/elasticsearch-kopf-master.zip //安装kopf插件
[root@se5 bin]# [root@se5 bin]# ./plugin install \
ftp://192.168.1.254/elk/bigdesk-master.zip
//安装bigdesk插件
[root@se5 bin]# ./plugin list //查看安装的插件
Installed plugins in /usr/share/elasticsearch/plugins:
– head
– kopf
– bigdesk
2)访问head插件,如图-4所示:
[root@room9pc01 ~]# firefox http://192.168.1.65:9200/_plugin/head
图-4
3)访问kopf插件,如图-5所示:
[root@room9pc01 ~]# http://192.168.1.65:9200/_plugin/kopf
图-5
4)访问bigdesk插件,如图-6所示:
[root@room9pc01 ~]# http://192.168.1.65:9200/_plugin/bigdesk
图-6
步骤二:使用head创建index
[root@se5 bin]# curl -X PUT “http://192.168.1.65:9200/index” -d ‘
> {
> “settings”:{
> “index”:{
> “number_of_shards”:5, //分片数
> “number_of_replicas”:1 //副本数
> }
> }
> }’
{“acknowledged”:true}
步骤三:使用kopf查看数据,如图-7所示:
代码如下,注意在哪台机器上面装插件,就只能在哪台机器上面去操作,这里安装在node5上面
现在真机上,把实验需要的插件,配置文件都放在FTP上面
[root@room9pc52 elk 1]# ls
accounts.json.gz elk.tar
alog.gz filebeat-1.2.3-x86_64.rpm
bigdesk-master.zip kibana-4.5.2-1.x86_64.rpm
elasticsearch-2.3.4.rpm logs.jsonl.gz
elasticsearch-head-master.zip logstash-2.3.4-1.noarch.rpm
elasticsearch-kopf-master.zip NSD_ELK_01.pdf
elk_01(1).txt shakespeare.json.gz
[root@room9pc52 elk 1]# cp *.gz /var/ftp/elk/
[root@room9pc52 elk 1]# cp *.zip /var/ftp/elk/
[root@room9pc52 elk 1]# ls /var/ftp/elk/
accounts.json.gz filebeat-1.2.3-x86_64.rpm
alog.gz kibana-4.5.2-1.x86_64.rpm
bigdesk-master.zip logs.jsonl.gz
elasticsearch-2.3.4.rpm logstash-2.3.4-1.noarch.rpm
elasticsearch-head-master.zip repodata
elasticsearch-kopf-master.zip shakespeare.json.gz
[root@room9pc52 elk 1]#
然后去node5上面去操作,安装插件,注意,本地安装也可以,但是要使用URL的形式,也就是file:///xxx 这种
[root@se5 ~]# cd /usr/share/elasticsearch/bin/
[root@se5 bin]# ./plugin install ftp://192.168.1.254/elk/elasticsearch-head-master.zip
-> Installing from ftp://192.168.1.254/elk/elasticsearch-head-master.zip…
Trying ftp://192.168.1.254/elk/elasticsearch-head-master.zip …
Downloading ………DONE
Verifying ftp://192.168.1.254/elk/elasticsearch-head-master.zip checksums if available …
Exception in thread “Thread-1” java.lang.IllegalStateException: Not connected
at sun.net.ftp.impl.FtpClient.issueCommand(FtpClient.java:523)
at sun.net.ftp.impl.FtpClient.issueCommandCheck(FtpClient.java:550)
at sun.net.ftp.impl.FtpClient.setType(FtpClient.java:1678)
at sun.net.ftp.FtpClient.setBinaryType(FtpClient.java:676)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:432)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.downloadFile(HttpDownloadHelper.java:417)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.get(HttpDownloadHelper.java:304)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.run(HttpDownloadHelper.java:290)
Exception in thread “Thread-2” java.lang.IllegalStateException: Not connected
at sun.net.ftp.impl.FtpClient.issueCommand(FtpClient.java:523)
at sun.net.ftp.impl.FtpClient.issueCommandCheck(FtpClient.java:550)
at sun.net.ftp.impl.FtpClient.setType(FtpClient.java:1678)
at sun.net.ftp.FtpClient.setBinaryType(FtpClient.java:676)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:432)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.downloadFile(HttpDownloadHelper.java:417)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.get(HttpDownloadHelper.java:304)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.run(HttpDownloadHelper.java:290)
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed head into /usr/share/elasticsearch/plugins/head
[root@se5 bin]# ./plugin install ftp://192.168.1.254/elk/elasticsearch-kopf-master.zip
-> Installing from ftp://192.168.1.254/elk/elasticsearch-kopf-master.zip…
Trying ftp://192.168.1.254/elk/elasticsearch-kopf-master.zip …
Downloading ………………….DONE
Verifying ftp://192.168.1.254/elk/elasticsearch-kopf-master.zip checksums if available …
Exception in thread “Thread-1” java.lang.IllegalStateException: Not connected
at sun.net.ftp.impl.FtpClient.issueCommand(FtpClient.java:523)
at sun.net.ftp.impl.FtpClient.issueCommandCheck(FtpClient.java:550)
at sun.net.ftp.impl.FtpClient.setType(FtpClient.java:1678)
at sun.net.ftp.FtpClient.setBinaryType(FtpClient.java:676)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:432)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.downloadFile(HttpDownloadHelper.java:417)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.get(HttpDownloadHelper.java:304)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.run(HttpDownloadHelper.java:290)
Exception in thread “Thread-2” java.lang.IllegalStateException: Not connected
at sun.net.ftp.impl.FtpClient.issueCommand(FtpClient.java:523)
at sun.net.ftp.impl.FtpClient.issueCommandCheck(FtpClient.java:550)
at sun.net.ftp.impl.FtpClient.setType(FtpClient.java:1678)
at sun.net.ftp.FtpClient.setBinaryType(FtpClient.java:676)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:432)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.downloadFile(HttpDownloadHelper.java:417)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.get(HttpDownloadHelper.java:304)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.run(HttpDownloadHelper.java:290)
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed kopf into /usr/share/elasticsearch/plugins/kopf
[root@se5 bin]# ./plugin install ftp://192.168.1.254/elk/bigdesk-master.zip
-> Installing from ftp://192.168.1.254/elk/bigdesk-master.zip…
Trying ftp://192.168.1.254/elk/bigdesk-master.zip …
Downloading …DONE
Verifying ftp://192.168.1.254/elk/bigdesk-master.zip checksums if available …
Exception in thread “Thread-1” java.lang.IllegalStateException: Not connected
at sun.net.ftp.impl.FtpClient.issueCommand(FtpClient.java:523)
at sun.net.ftp.impl.FtpClient.issueCommandCheck(FtpClient.java:550)
at sun.net.ftp.impl.FtpClient.setType(FtpClient.java:1678)
at sun.net.ftp.FtpClient.setBinaryType(FtpClient.java:676)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:432)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.downloadFile(HttpDownloadHelper.java:417)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.get(HttpDownloadHelper.java:304)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.run(HttpDownloadHelper.java:290)
Exception in thread “Thread-2” java.lang.IllegalStateException: Not connected
at sun.net.ftp.impl.FtpClient.issueCommand(FtpClient.java:523)
at sun.net.ftp.impl.FtpClient.issueCommandCheck(FtpClient.java:550)
at sun.net.ftp.impl.FtpClient.setType(FtpClient.java:1678)
at sun.net.ftp.FtpClient.setBinaryType(FtpClient.java:676)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:432)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.downloadFile(HttpDownloadHelper.java:417)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.get(HttpDownloadHelper.java:304)
at org.elasticsearch.common.http.client.HttpDownloadHelper$GetThread.run(HttpDownloadHelper.java:290)
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed bigdesk into /usr/share/elasticsearch/plugins/bigdesk
[root@se5 bin]# ./plugin list
Installed plugins in /usr/share/elasticsearch/plugins:
– head
– kopf
– bigdesk
[root@se5 bin]#
测试,去浏览器挨个访问插件试一试,不贴图了
http://192.168.1.65:9200/_plugin/head
http://192.168.1.65:9200/_plugin/kopf
http://192.168.1.65:9200/_plugin/bigdesk
[root@se5 bin]# curl -X PUT “http://192.168.1.65:9200/index” -d’
> {
> “settings”:{
> “index”:{
> “number_of_shards”:5,
> “number_of_replicas”:1
> }
> }
> }’
{“acknowledged”:true}[root@se5 bin]#
5 案例5:插入,增加,删除查询数据
5.1 问题
本案例要求:
使用curl命令连接使用ES数据库
使用PUT方法增加数据
使用POST修改数据
使用GET查询数据
使用DELETE删除数据
5.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:增加数据
[root@se5 ~]# locale
[root@se5 ~]# LANG=en_US.UTF-8 //设置编码
[root@se5 ~]# curl -X PUT “http://192.168.1.65:9200/taindex/teacher/1” -d ‘{
“职业”:”诗人”,
“名字”:”李白”,
“称号”:”诗仙”,
“年代”:”唐”
}’
{“_index”:”taindex”,”_type”:”teacher”,”_id”:”1″,”_version”:2,”_shards”:{“total”:2,”successful”:2,”failed”:0},”created”:false}
步骤二:修改数据
[root@se5 ~]# curl -X PUT “http://192.168.1.65:9200/taindex/teacher/1” -d ‘{
“doc”:{
“年代”: “唐代”
}
}’
{“_index”:”taindex”,”_type”:”teacher”,”_id”:”1″,”_version”:3,”_shards”:{“total”:2,”successful”:2,”failed”:0},”created”:false}
步骤三:查询数据
[root@se5 ~]# curl -X GET “http://192.168.1.65:9200/taindex/teacher/3?pretty”
{
“_index” : “taindex”,
“_type” : “teacher”,
“_id” : “3”,
“found” : false
}
步骤四:删除数据
[root@se5 ~]# curl -X DELETE “http://192.168.1.65:9200/taindex/teacher/3?pretty”
{
“found” : false,
“_index” : “taindex”,
“_type” : “teacher”,
“_id” : “3”,
“_version” : 1,
“_shards” : {
“total” : 2,
“successful” : 2,
“failed” : 0
}
}
步骤五:删除索引
[root@se5 bin]# curl -X DELETE http://192.168.1.65:9200/taindex/
//删除索引
{“acknowledged”:true}
[root@se5 bin]# curl -X DELETE http://192.168.1.65:9200/* //删除所有索引
{“acknowledged”:true}
代码如下
先设置好语言
查看语言
[root@se5 bin]# locale
LANG=zh_CN.UTF-8
LC_CTYPE=”zh_CN.UTF-8″
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8
LC_COLLATE=”zh_CN.UTF-8″
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES=”zh_CN.UTF-8″
LC_PAPER=zh_CN.UTF-8
LC_NAME=”zh_CN.UTF-8″
LC_ADDRESS=”zh_CN.UTF-8″
LC_TELEPHONE=”zh_CN.UTF-8″
LC_MEASUREMENT=zh_CN.UTF-8
LC_IDENTIFICATION=”zh_CN.UTF-8″
LC_ALL=
设置语言
[root@se5 bin]# LANG=en_US.UTF-8
再确认一下
[root@se5 bin]# locale
LANG=en_US.UTF-8
LC_CTYPE=”en_US.UTF-8″
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8
LC_COLLATE=”en_US.UTF-8″
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES=”en_US.UTF-8″
LC_PAPER=zh_CN.UTF-8
LC_NAME=”en_US.UTF-8″
LC_ADDRESS=”en_US.UTF-8″
LC_TELEPHONE=”en_US.UTF-8″
LC_MEASUREMENT=zh_CN.UTF-8
LC_IDENTIFICATION=”en_US.UTF-8″
LC_ALL=
步骤一、增加数据
[root@se5 bin]# curl -X PUT “http://192.168.1.65:9200/taindex/teacher/1” -d ‘{
> “职业”:”诗人”,
> “名字”:”李白”,
> “称号”:”诗仙”,
> “年代”:”唐”
> }’
{“_index”:”taindex”,”_type”:”teacher”,”_id”:”1″,”_version”:1,”_shards”:{“total”:2,”successful”:2,”failed”:0},”created”:true}[root@se5 bin]#
步骤二、修改数据
{“_index”:”taindex”,”_type”:”teacher”,”_id”:”1″,”_version”:1,”_shards”:{“total”:2,”successful”:2,”failed”:0},”created”:true}[root@se5 bin]#
[root@se5 bin]#
[root@se5 bin]#
[root@se5 bin]#
[root@se5 bin]#
[root@se5 bin]#
[root@se5 bin]#
[root@se5 bin]# curl -X POST “http://192.168.1.65:9200/taindex/teacher/1” -d ‘{
> “doc”:{
> “年代”:”唐代”
> }
> }’
{“_index”:”taindex”,”_type”:”teacher”,”_id”:”1″,”_version”:2,”_shards”:{“total”:2,”successful”:2,”failed”:0},”created”:false}[root@se5 bin]#
步骤三:查询数据
[root@se5 bin]# curl -X GET “http://192.168.1.65:9200/taindex/teacher/3?pretty”
{
“_index” : “taindex”,
“_type” : “teacher”,
“_id” : “3”,
“found” : false
}
步骤四:删除数据
[root@se5 bin]# curl -X DELETE “http://192.168.1.65:9200/taindex/teacher/3?pretty”
{
“found” : false,
“_index” : “taindex”,
“_type” : “teacher”,
“_id” : “3”,
“_version” : 1,
“_shards” : {
“total” : 2,
“successful” : 2,
“failed” : 0
}
}
步骤五:删除索引
[root@se5 bin]# curl -X DELETE http://192.168.1.65:9200/taindex/
{“acknowledged”:
删除所有的索引
[root@se5 bin]# curl -X DELETE http://192.168.1.65:9200/*
{“acknowledged”:true}
6 案例6:安装Kibana
6.1 问题
本案例要求:
安装Kibana
配置启动服务查看5601端口是否正常
通过web页面访问Kibana
6.2 步骤
实现此案例需要按照如下步骤进行
步骤一:安装kibana
1)在另一台主机,配置ip为192.168.1.66,配置yum源,更改主机名
2)安装kibana
[root@kibana ~]# yum -y install kibana
[root@kibana ~]# rpm -qc kibana
/opt/kibana/config/kibana.yml
[root@kibana ~]# vim /opt/kibana/config/kibana.yml
2 server.port: 5601
//若把端口改为80,可以成功启动kibana,但ss时没有端口,没有监听80端口,服务里面写死了,不能用80端口,只能是5601这个端口
5 server.host: “0.0.0.0” //服务器监听地址
15 elasticsearch.url: http://192.168.1.61:9200
//声明地址,从哪里查,集群里面随便选一个
23 kibana.index: “.kibana” //kibana自己创建的索引
26 kibana.defaultAppId: “discover” //打开kibana页面时,默认打开的页面discover
53 elasticsearch.pingTimeout: 1500 //ping检测超时时间
57 elasticsearch.requestTimeout: 30000 //请求超时
64 elasticsearch.startupTimeout: 5000 //启动超时
[root@kibana ~]# systemctl restart kibana
[root@kibana ~]# systemctl enable kibana
Created symlink from /etc/systemd/system/multi-user.target.wants/kibana.service to /usr/lib/systemd/system/kibana.service.
[root@kibana ~]# ss -antup | grep 5601 //查看监听端口
3)浏览器访问kibana,如图-8所示:
[root@kibana ~]# firefox 192.168.1.66:5601
图-8
4)点击Status,查看是否安装成功,全部是绿色的对钩,说明安装成功,如图-9所示:
图-9
5)用head插件访问会有.kibana的索引信息,如图-10所示:
[root@se5 ~]# firefox http://192.168.1.65:9200/_plugin/head/
代码如下
一,安装kibana
到66节点上去安装kibana
配置yum源
[root@kibana ~]# cat /etc/yum.repos.d/local.repo
[local_repo]
name=CentOS-$releasever – Base
baseurl=”ftp://192.168.1.254/system”
enabled=1
gpgcheck=1
[elk]
name=elk
baseurl=”ftp://192.168.1.254/elk”
enabled=1
gpgcheck=0
[root@kibana ~]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
源标识 源名称 状态
base/7/x86_64 CentOS-7 – Base 9,911
elk elk 4
extras/7/x86_64 CentOS-7 – Extras 432
local_repo CentOS-7 – Base 9,591
updates/7/x86_64 CentOS-7 – Updates 1,561
repolist: 21,499
[root@kibana ~]#
[root@kibana ~]# yum install -y kibana
已加载插件:fastestmirror
elk | 2.9 kB 00:00:00
local_repo | 3.6 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
正在解决依赖关系
–> 正在检查事务
—> 软件包 kibana.x86_64.0.4.5.2-1 将被 安装
–> 解决依赖关系完成
依赖关系解决
=====================================================================================================================
Package 架构 版本 源 大小
=====================================================================================================================
正在安装:
kibana x86_64 4.5.2-1 elk 32 M
事务概要
=====================================================================================================================
安装 1 软件包
总下载量:32 M
安装大小:119 M
Downloading packages:
kibana-4.5.2-1.x86_64.rpm | 32 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : kibana-4.5.2-1.x86_64 1/1
验证中 : kibana-4.5.2-1.x86_64 1/1
已安装:
kibana.x86_64 0:4.5.2-1
修改kibana的配置文件
完毕!
[root@kibana ~]# vim /opt/kibana/config/kibana.yml
[root@kibana ~]# grep -v “^#” /opt/kibana/config/kibana.yml | grep -v “^$”
server.port: 5601
server.host: “0.0.0.0”
elasticsearch.url: “http://192.168.1.61:9200”
kibana.index: “.kibana”
kibana.defaultAppId: “discover”
elasticsearch.pingTimeout: 1500
elasticsearch.requestTimeout: 30000
elasticsearch.startupTimeout: 5000
重启服务,并确认端口
[root@kibana ~]# systemctl restart kibana
[root@kibana ~]# systemctl enable kibana
Created symlink from /etc/systemd/system/multi-user.target.wants/kibana.service to /usr/lib/systemd/system/kibana.service.
[root@kibana ~]# ss -antup | grep 5601
tcp LISTEN 0 128 *:5601 *:* users:((“node”,pid=976,fd=11))
[root@kibana ~]#
浏览器访问确认安装成功
http://192.168.1.66:5601/
点击Status,查看是否安装成功,全部是绿色的对钩,说明安装成功
用head插件访问会有.kibana的索引信息
http://192.168.1.65:9200/_plugin/head/