Centos 7 5節點 MPI集群配置

2021-09-05 03:42:51 字數 3744 閱讀 1314

主機名

ip

記憶體

ios

硬碟

cpu核數

hw-master

10.2.152.230

512g

centos-7.5

2*6t

64hw-node01

10.2.152.231

512g

centos-7.5

2*6t

64hw-node02

10.2.152.232

512g

centos-7.5

2*6t

64hw-node03

10.2.152.233

512g

centos-7.5

2*6t

64hw-node04

10.2.152.234

512g

centos-7.5

2*6t

64mpich-3.1.4.tar.gz

(2)編譯安裝

$:tar -xzvf mpich-3.1.4.tar.gz -c /home/share/mpich

$:cd /home/share/mpich/mpich-3.1.4

$:./configure --prefix=/usr/local/mpich

$:make && make install

(3)安裝後加入環境變數到/etc/profile檔案,並執行source /etc/profile

path=$path:/usr/local/mpich/bin

manpath=$manpath:/usr/local/mpich/man

export path manpath

(4)單節點測試

$:cd /home/share/mpich/mpich-3.1.4

$:cp -r examples/ /usr/local/mpich

$:cd /usr/local/mpich

$:mpirun -np 10 ./examples/cpi

輸出:process 1 of 10 is on hw-master

process 2 of 10 is on hw-master

process 3 of 10 is on hw-master

process 4 of 10 is on hw-master

process 5 of 10 is on hw-master

process 6 of 10 is on hw-master

process 7 of 10 is on hw-master

process 8 of 10 is on hw-master

process 9 of 10 is on hw-master

process 0 of 10 is on hw-master

wall clock time = 0.000058

(1)配置ssh免密碼登入

$:ssh-keygen -t rsa

$:ssh-copy-id [email protected]

$:ssh-copy-id [email protected]

$:ssh-copy-id [email protected]

$:ssh-copy-id [email protected]

$:ssh-copy-id [email protected]

(2)關閉防火牆和selinux

關閉防火牆

啟動: systemctl start firewalld

關閉: systemctl stop firewalld

檢視狀態: systemctl status firewalld 

開機禁用: systemctl disable firewalld

開機啟用:  systemctl enable firewalld

關閉selinux

檢視 $: getenforce

disabled表示關閉;enforcing表示開啟

$:/usr/sbin/sestatus -v

selinux status: disabled

臨時關閉

setenforce 1 //設定selinux 成為enforcing模式 (開)

setenforce 0 //設定selinux 成為permissive模式(關)

永久關閉

$:vi /etc/selinux/config

將selinux=enforcing改為selinux=disabled 

設定後需要重啟才能生效

(3)修改/etc/hosts檔案

$:cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

10.2.152.230 hw-master

10.2.152.231 hw-node01

10.2.152.232 hw-node02

10.2.152.233 hw-node03

10.2.152.234 hw-node04

(4)在主節點的目錄下增加servers檔案,記錄集群的機器名和對應的程序數

$:cd /home/share/mpich

$:cat servers

hw-master:2

hw-node01:2

hw-node02:2

hw-node03:2

hw-node04:2

(5)把5個節點的/usr/local/mpich/example/cpi這個計算圓周率的可執行檔案複製到/home/share/mpich目錄下

(6)在主節點的/home/share/mpich目錄下執行

$:mpiexec -n 10 -f servers ./cpi

輸出:process 6 of 10 is on hw-node03

process 0 of 10 is on hw-master

process 7 of 10 is on hw-node03

process 1 of 10 is on hw-master

process 8 of 10 is on hw-node04

process 9 of 10 is on hw-node04

process 2 of 10 is on hw-node01

process 3 of 10 is on hw-node01

process 4 of 10 is on hw-node02

process 5 of 10 is on hw-node02

wall clock time = 0.002362

到此說明集群已經搭建成功!!!!

Redis單機6節點集群模式安裝

wget1.2 安裝gccyum install gcc c 1.3 解壓redistar zxvf redis 4.0.2.tar.gz1.4 編譯cd redis 4.0.2 make1.5 修改配置檔案 bind 0.0.0.0 daemonize no daemonize yes 1.6 啟...

Elasticsearch集群某一節點分片數為0

接手公司乙個elasticsearch集群,平時使用沒啥問題,今天檢視自己配置的索引生命週期是否正確,通過kibana發現某一節點的分片數為0,如圖 從圖中可以看出最後乙個節點分片數為0,也就是集群中有乙個節點一直沒有寫入資料 所以,我開啟了elasticsearch head直觀的看一下,如圖 其...

clickhouse集群搭建 三節點為例

mkdir p opt software clickhouse cd opt software clickhouse rpm ivh clickhouse server common 19.3.6 1.el7.x86 64.rpm rpm ivh clickhouse common static 1...