In the previous blog- [Distributed Cluster Construction One] Virtual Machine Configuration (VMware+Centos7+SecureCRT+AppNode) talked about how to create a virtual machine. On this basis, if we deploy ElasticSearch in the virtual machine, After Kafka waited and changed a bunch of configurations, we definitely don't want to do it again on other machines, so it is necessary to clone a virtual machine. Note that you need to shut down the virtual machine before cloning
Take a snapshot
Before cloning, we can record the status of the current virtual machine, and then the clone will be copied based on the snapshot of the current virtual machine, right click on the virtual machine-snapshot-take snapshot
Clone virtual machine
After the snapshot is taken, the corresponding snapshot can be cloned through the clone operation. Right-click the virtual machine-manage-clone , and we can use the previously copied snapshot to clone:
Then adjust the directory: the
following message shows that the cloning is successful.
According to this method, we clone two virtual machines continuously to form a cluster of three virtual machines :
Configure clone virtual machine
Because three machines use the same IP to make us confused, we need to modify the IP addresses of the three machines and operate on the terminals of TML2 and TML3:
Modify ip address
Perform the following operations in the terminal to enter the network configuration page [Note, you need to enter the operation under the root user]
cd /etc/sysconfig/network-scripts/
Then edit the configuration file:
vi ifcfg-ens33
You can see the following configuration content:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=f76f157d-2d88-4a48-8809-5337ee077084
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.5.101
NETMASK=255.255.255.0
GATEWAY=192.168.5.2
On TML2 and TML3 respectively
把IPADDR=192.168.5.101修改为192.168.5.102和192.168.5.103
Restart network settings after modification:
service network restart
Check separately after modification:
AppNode also silently presets successfully, you only need to change the domain name to access different machines
TML1 http://192.168.5.101:8888/#/agent/1/sysinfo/network
TML2 http://192.168.5.102:8888/#/agent/1/sysinfo/network
TML3 http://192.168.5.103:8888/#/agent/1/sysinfo/network
Modify host name
Enter the AppNode of the corresponding machine and change the original host name to the ip address.
After the above operations are completed, restart the three virtual machines.
Check whether it is interoperable
Check the three machines separately and confirm that they can ping each other, then our three virtual machines are set up and
can be managed uniformly through AppNode:
Fix AppNode issues
There are some problems after cloning the virtual machine, for example, the authorized serial number of AppNode and the machine ip no longer match:
At this time, you need to uninstall and reinstall AppNode . First, enter the corresponding virtual machine terminal to completely uninstall AppNode.
Uninstall AppNode
Uninstall the controlled end. When prompted whether to confirm the uninstallation, please enter y and press Enter,
appnode agent remove
Uninstall the control center. When prompted whether to confirm the uninstallation, please enter y and press Enter.
appnode ccenter remove
Remove residual data and configuration. If you want to completely remove residual data and configuration files after uninstallation, delete the following three directories:
/opt/appnode/ccenter/
/opt/appnode/agent/
/opt/appnode/ui/
Do it with one command:
rm -rf /opt/appnode/{
ccenter,agent,ui}/
Reinstall AppNode
Because it has been uninstalled, domain name resolution errors will occur, so use the following command directly:
echo -e "nameserver 114.114.114.114\nnameserver 8.8.8.8" >> /etc/resolv.conf
Then use the install command
INSTALL_AGENT=1 INSTALL_APPS=sitemgr INIT_SWAPFILE=1 INSTALL_PKGS='nginx-stable,php56,mysql56' bash -c "$(curl -sS http://dl.appnode.com/install.sh)"
After the installation is complete, check it again and it will display normally: