日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

4. Linux 集群安装

發布時間:2023/12/10 linux 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 4. Linux 集群安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1. 配置yum

yum clean all yum makecache yum install wget

2.安裝JDK

(1) 將jdk-7u60-linux-i586.rpm通過WinSCP上傳到虛擬機中
(2) 安裝JDK:rpm -ivh jdk-7u65-linux-i586.rpm
(3) 配置jdk相關的環境變量

vi .bashrc export JAVA_HOME=/usr/java/latest export PATH=$PATH:$JAVA_HOME/bin source .bashrc

(4) 測試jdk安裝是否成功:java -version

3.安裝Perl

yum install -y gccwget http://www.cpan.org/src/5.0/perl-5.16.1.tar.gz tar -xzf perl-5.16.1.tar.gz cd perl-5.16.1 ./Configure -des -Dprefix=/usr/local/perl make && make test && make install perl -v

4.在4個虛擬機中安裝CentOS集群

(1)按照上述步驟,再安裝三臺一模一樣環境的linux機器
(2)另外三臺機器的hostname分別設置為eshop-cache02,eshop-cache03,eshop-cache04
(3)安裝好之后,在每臺機器的hosts文件里面,配置好所有的機器的ip地址到hostname的映射關系

比如說,在eshop-cache01的hosts里面

192.168.0.150 eshop-cache01 192.168.0.152 eshop-cache03 192.168.0.151 eshop-cache02 192.168.0.153 eshop-cache04

5.配置4臺CentOS為ssh免密碼互相通信

(1)首先在三臺機器上配置對本機的ssh免密碼登錄
ssh-keygen -t rsa
生成本機的公鑰,過程中不斷敲回車即可,ssh-keygen命令默認會將公鑰放在/root/.ssh目錄下
cd /root/.ssh
cp id_rsa.pub authorized_keys
將公鑰復制為authorized_keys文件,此時使用ssh連接本機就不需要輸入密碼了

測試:ssh eshop-cache01,ssh eshop-cache03,ssh eshop-cache02,ssh eshop-cache04

成功

(2)接著配置三臺機器互相之間的ssh免密碼登錄
使用ssh-copy-id -i hostname命令將本機的公鑰拷貝到指定機器的authorized_keys文件中

Example

eshop-cache01 機器

ssh-copy-id -i eshop-cache02
ssh-copy-id -i eshop-cache03
ssh-copy-id -i eshop-cache04

eshop-cache02 機器

ssh-copy-id -i eshop-cache01
ssh-copy-id -i eshop-cache03
ssh-copy-id -i eshop-cache04


eshop-cache03 機器

ssh-copy-id -i eshop-cache01
ssh-copy-id -i eshop-cache02
ssh-copy-id -i eshop-cache04

eshop-cache04 機器

ssh-copy-id -i eshop-cache01
ssh-copy-id -i eshop-cache02
ssh-copy-id -i eshop-cache03

測試:

eshop-cache04 機器

ssh eshop-cache01 ,免密碼直接登錄

以上的步驟,還有一些簡單的辦法。借助SCP 遠程拷貝命令

例如:

SCP authorized_keys eshop-cache02:/root/.ssh
SCP authorized_keys eshop-cache03:/root/.ssh
SCP authorized_keys eshop-cache04:/root/.ssh

轉載于:https://www.cnblogs.com/likevin/p/8871865.html

總結

以上是生活随笔為你收集整理的4. Linux 集群安装的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。