ELK基础环境安装准备

发布于:2025-08-09 ⋅ 阅读:(20) ⋅ 点赞:(0)

1.操作系统版本
在这里插入图片描述
2.修改国内的软件源

sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo
         
      
yum makecache


推荐阅读:
	https://mirrors.tuna.tsinghua.edu.cn/help/centos/

3.修改终端显示

cat <<EOF >>  ~/.bashrc 
PS1='[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\]\[\e[31;1m\] \W\[\e[0m\]]\$ '
EOF

source ~/.bashrc 

4.修改sshd服务优化

[root@hk8s ~]# 
[root@hk8s ~]# 
[root@hk8s ~]# grep UseDNS /etc/ssh/sshd_config 
#UseDNS yes
UseDNS no
[root@hk8s ~]# 
[root@hk8s ~]# grep ^UseDNS /etc/ssh/sshd_config 
UseDNS no
[root@hk8s ~]# 
[root@hk8s ~]# 

5.关闭防火墙

[root@hk8s ~]# systemctl is-enabled firewalld
enabled
[root@hk8s ~]# 
[root@hk8s ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@hk8s ~]# 
[root@hk8s ~]# systemctl is-enabled firewalld
disabled
[root@hk8s ~]# 

6.禁用Selinux

[root@hk8s ~]# getenforce 
Enforcing
[root@hk8s ~]# 
[root@hk8s ~]# setenforce 0
[root@hk8s ~]# 
[root@hk8s ~]# getenforce 
Permissive
[root@hk8s ~]# 
[root@hk8s ~]# sed -ri 's#(SELINUX=)enforcing#\1disabled#' /etc/selinux/config
[root@hk8s ~]# 

7.安装常用的工具

 yum -y install lrzsz vim net-tools wget tree unzip

8.修改主机列表

[root@hk8s ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

# Add by Jason Yin for Elastic Statck.
10.0.0.101 elk101.k8s.com
10.0.0.102 elk102.k8s.com
10.0.0.103 elk103.k8s.com
[root@hk8s ~]# 


温馨提示:
	所有节点的hosts文件内容解析要同步哟~

9.集群时间同步

推荐阅读:
	https://www.cnblogs.com/yinzhengjie/p/12292549.html

10.JDK部署

JDK下载地址:
	https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
	
[root@elk101.hk8s.com ~]# ll
总用量 141540
-rw-r--r--. 1 root root 144935989 516 11:54 jdk-8u291-linux-x64.tar.gz
[root@elk101.hk8s.com ~]# 
[root@elk101.hk8s.com ~]# tar zxf jdk-8u291-linux-x64.tar.gz -C /oldboy/softwares/
[root@elk101.hk8s.com ~]#
[root@elk101.hk8s.com ~]# cd /oldboy/softwares/
[root@elk101.hk8s.com /oldboy/softwares]# 
[root@elk101.hk8s.com /oldboy/softwares]# ll
总用量 0
drwxr-xr-x. 8 10143 10143 273 48 03:26 jdk1.8.0_291
[root@elk101.hk8s.com /oldboy/softwares]# 
[root@elk101.hk8s.com /oldboy/softwares]# ln -sv jdk1.8.0_291 jdk
"jdk" -> "jdk1.8.0_291"
[root@elk101.hk8s.com /oldboy/softwares]# 
[root@elk101.hk8s.com /oldboy/softwares]# ll
总用量 0
lrwxrwxrwx. 1 root  root   12 516 11:56 jdk -> jdk1.8.0_291
drwxr-xr-x. 8 10143 10143 273 48 03:26 jdk1.8.0_291
[root@elk101.hk8s.com /oldboy/softwares]# 
[root@elk101.hk8s.com /oldboy/softwares]# vim /etc/profile.d/jdk.sh 
[root@elk101.hk8s.com /oldboy/softwares]# 
[root@elk101.hk8s.com /oldboy/softwares]# cat /etc/profile.d/jdk.sh 
#!/bin/bash

export JAVA_HOME=/oldboy/softwares/jdk
export PATH=$PATH:$JAVA_HOME/bin
[root@elk101.hk8s.com /oldboy/softwares]# 
[root@elk101.hk8s.com /oldboy/softwares]# source /etc/profile.d/jdk.sh 
[root@elk101.hk8s.com /oldboy/softwares]# 
[root@elk101.hk8s.com /oldboy/softwares]# java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
[root@elk101.hk8s.com /oldboy/softwares]# 

网站公告

今日签到

点亮在社区的每一天
去签到