Updating a Client (Versions Earlier Than 3.x)¶
Note
This section applies to clusters of versions earlier than MRS 3.x. For MRS 3.x or later, see Updating a Client (Version 3.x or Later).
Updating a Client Configuration File¶
Scenario
An MRS cluster provides a client for you to connect to a server, view task results, or manage data. Before using an MRS client, you need to download and update the client configuration file if service configuration parameters are modified and a service is restarted or the service is merely restarted on MRS Manager.
During cluster creation, the original client is stored in the /opt/client directory on all nodes in the cluster by default. After the cluster is created, only the client of a Master node can be directly used. To use the client of a Core node, you need to update the client configuration file first.
Procedure
Method 1:
Log in to MRS Manager. For details, see Accessing MRS Manager (Versions Earlier Than MRS 3.x). Then, choose Services.
Click Download Client.
Set Client Type to Only configuration files, Download To to Server, and click OK to generate the client configuration file. The generated file is saved in the /tmp/MRS-client directory on the active management node by default. You can customize the file path.
Query and log in to the active Master node.
If you use the client in the cluster, run the following command to switch to user omm. If you use the client outside the cluster, switch to user root.
sudo su - omm
Run the following command to switch to the client directory, for example, /opt/Bigdata/client:
cd /opt/Bigdata/client
Run the following command to update client configurations:
sh refreshConfig.sh Client installation directory Full path of the client configuration file package
For example, run the following command:
sh refreshConfig.sh /opt/Bigdata/client /tmp/MRS-client/MRS_Services_Client.tar
If the following information is displayed, the configurations have been updated successfully.
ReFresh components client config is complete. Succeed to refresh components client config.
Method 2: applicable to MRS 1.9.2 or later
After the cluster is installed, run the following command to switch to user omm. If you use the client outside the cluster, switch to user root.
sudo su - omm
Run the following command to switch to the client directory, for example, /opt/Bigdata/client:
cd /opt/Bigdata/client
Run the following command and enter the name of an MRS Manager user with the download permission and its password (for example, the username is admin and the password is the one set during cluster creation) as prompted to update client configurations.
sh autoRefreshConfig.sh
After the command is executed, the following information is displayed, where XXX indicates the name of the component installed in the cluster. To update client configurations of all components, press Enter. To update client configurations of some components, enter the component names and separate them with commas (,).
Components "xxx" have been installed in the cluster. Please input the comma-separated names of the components for which you want to update client configurations. If you press Enter without inputting any component name, the client configurations of all components will be updated:
If the following information is displayed, the configurations have been updated successfully.
Succeed to refresh components client config.
If the following information is displayed, the username or password is incorrect.
login manager failed,Incorrect username or password.
Note
This script automatically connects to the cluster and invokes the refreshConfig.sh script to download and update the client configuration file.
By default, the client uses the floating IP address specified by wsom=xxx in the Version file in the installation directory to update the client configurations. To update the configuration file of another cluster, modify the value of wsom=xxx in the Version file to the floating IP address of the corresponding cluster before performing this step.
Fully Updating the Original Client of the Active Master Node¶
Scenario
During cluster creation, the original client is stored in the /opt/client directory on all nodes in the cluster by default. The following uses /opt/Bigdata/client as an example.
For a normal MRS cluster, you will use the pre-installed client on a Master node to submit a job on the management console page.
You can also use the pre-installed client on the Master node to connect to a server, view task results, and manage data.
After installing the patch on the cluster, you need to update the client on the Master node to ensure that the functions of the built-in client are available.
Procedure
Log in to MRS Manager. For details, see Accessing MRS Manager (Versions Earlier Than MRS 3.x). Then, choose Services.
Click Download Client.
Set Client Type to All client files, Download To to Server, and click OK to generate the client configuration file. The generated file is saved in the /tmp/MRS-client directory on the active management node by default. You can customize the file path.
Query and log in to the active Master node.
On the ECS, switch to user root and copy the installation package to the /opt directory.
sudo su - root
cp /tmp/MRS-client/MRS_Services_Client.tar /opt
Run the following command in the /opt directory to decompress the package and obtain the verification file and the configuration package of the client:
tar -xvf MRS_Services_Client.tar
Run the following command to verify the configuration file package of the client:
sha256sum -c MRS_Services_ClientConfig.tar.sha256
The command output is as follows:
MRS_Services_ClientConfig.tar: OK
Run the following command to decompress MRS_Services_ClientConfig.tar:
tar -xvf MRS_Services_ClientConfig.tar
Run the following command to move the original client to the /opt/Bigdata/client_bak directory:
mv /opt/Bigdata/client /opt/Bigdata/client_bak
Run the following command to install the client in a new directory. The client path must be /opt/Bigdata/client.
sh /opt/MRS_Services_ClientConfig/install.sh /opt/Bigdata/client
If the following information is displayed, the client has been successfully installed:
Components client installation is complete.
Run the following command to modify the user and user group of the /opt/Bigdata/client directory:
chown omm:wheel /opt/Bigdata/client -R
Run the following command to configure environment variables:
source /opt/Bigdata/client/bigdata_env
If Kerberos authentication is enabled for the current cluster, run the following command to authenticate the user. If Kerberos authentication is disabled for the current cluster, skip this step.
kinit MRS cluster user
Example: kinit admin
Run the client command of a component.
For example, run the following command to query the HDFS directory:
hdfs dfs -ls /
Fully Updating the Original Client of the Standby Master Node¶
Repeat 1 to 3 to log in to the standby Master node, and run the following command to switch to user omm:
sudo su - omm
Run the following command on the standby master node to copy the downloaded client package from the active master node:
scp omm@master1 nodeIP address:/tmp/MRS-client/MRS_Services_Client.tar /tmp/MRS-client/
Note
In this command, master1 node is the active master node.
/tmp/MRS-client/ is an example target directory of the standby master node.
Repeat 4 to 13 to update the client of the standby Master node.