1, CentOS install in a virtual machine
Start a virtual box virtual machine management software (vmware, my early years, found to be less stable, the main building was a large cluster hadoop data, found that sleep after each restart, clusters and hung up)
virtual box, found it stable, the cluster never hang lightly, so we have used the virtual box
Install virtual box
What is the use centos mirror, a relatively new version of CentOS is 7, and then upload the server operating system, then memory is generally relatively large, usually installed 64-bit, 32-bit memory limit of a maximum of 4G
CentOS 7 to the mirror (1) using programs offered, CentOS-7-x86_64-Minimal -1611.iso.
(2) create a virtual machine: Open Virtual Box, click the "New" button, click "Next" and enter a name for the virtual machine elasticsearch01, select the operating system to Linux, choose version Red Hat-64bit, 4096MB memory allocation, behind all with the default option in the virtual Disk file location and size, be sure to choose a directory to store the virtual machine files, and click the "create" button to start creating virtual machines.
(3) Set the virtual machine network adapter: Select the created virtual machine, click the "Settings" button in the network column, connections, select "Bridged Adapter".
(4) installed in the virtual machine operating system CentOS 7: Select the created virtual machine, click the "Start" button, select the installation media (ie local CentOS 7 image file), according to the course can choose to automatically install
(5) after the installation, CentOS will remind you to restart it, it is to reboot, you can reboot it.
(6) Network Configuration
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
Let it allocate a dynamic ip address
ONBOOT=yes
service network restart
ip addr
Then set a static ip address
BOOTPROTO=static
IPADDR=192.168.31.250
NETMASK=255.255.255.0
GATEWAY=192.168.31.1
service network restart
ip addr
Configuring DNS
Check the status of NetManager: systemctl status NetworkManager.service
check NetManager management network interface: nmcli dev status
check NetManager management of network connections: nmcli connection show
set dns: nmcli con mod enp0s3 ipv4.dns " 114.114.114.114 8.8.8.8"
Let dns configuration to take effect: nmcli con up enp0s3
(7) configure the hosts
vi / etc / hosts
for the local switch to the hostname ip address mapping
(8) arranged SecureCRT
SecureCRT this case can be used for operation from the unit connected to the virtual machine
In general, virtual machine management software, virtual box, can be used to create and manage virtual machines, but generally do not go directly to the operation inside the virtualbox, because too much trouble, there is no way to copy and paste
SecureCRT, the windows host, the virtual box to connect to the virtual machine
Charges, I have here a perfect crack version, along with courses for everyone, crack
(9) off the firewall
systemctl stop firewalld.service
systemctl disable firewalld.service
Close windows firewall
1 , turn off the firewall
service iptables stop
chkconfig iptables off
vi /etc/selinux/config
SELINUX=disabled
To set up behind the cluster, the cluster between some big data technology, you have given the local firewall, it may be no way connected to each other, can cause build failures
(10) is configured yum
yum clean all
yum makecache
yum install wget
------------------------------------------------------------------------------------------
2, in each CentOS are installed Java
WinSCP, that is, between windows and linux host virtual machines communicate to each other a tool file
(1) Install JDK
1, the jdk-8u131-linux-x64.rpm WinSCP uploaded by the virtual machine
2, mounting the JDK: RPM -ivh jdk-8u131-linux-x64.rpm
. 3, the configuration environment variables related jdk
VI .bashrc
Export the JAVA_HOME = / usr / the Java / Latest
Export the PATH = $ the PATH: $ JAVA_HOME / bin
Source .bashrc
4, test jdk installation was successful: java -version
------------------------------------------------------------------------------------------
3, install the CentOS cluster in four virtual machines
(1) According to the above steps, then the installation of three identical linux machine environment
(2) In the three machines were set to hostname elasticsearch02, elasticsearch03, elasticsearch04
after (3) installed, in which each machine hosts file, the configuration good all machines ip address to hostname mapping relationship of
For example, hosts inside the elasticsearch01
192.168.31.250 elasticsearch01
192.168.31.xxx elasticsearch02
192.168.31.xxx elasticsearch03
192.168.31.xxx elasticsearch04
------------------------------------------------------------------------------------------
4, 4 arranged CentOS cryptographic communication with each other to avoid ssh
(1) disposed on the first three machines of the machine ssh password-free login
ssh-keygen -t rsa
public key raw cost machines, the process can continue to hit enter, ssh-keygen command will default on the public under /root/.ssh directory
CD /root/.ssh
CP id_rsa.pub authorized_keys
copy the public key as authorized_keys file, this time using ssh connect the machine you do not need to enter the password
(2) disposed next to each other three machines Free ssh password
using ssh-copy-id -i hostname of the machine Public Key command to copy the specified file machine authorized_keys