Use OpenVPN to Access Clusters
Configure the OpenVPN Client before using VPN services of the BMR cluster. This section introduces how to configure the OpenVPN Client on Mac OS X, Linux, and Windows operating systems.
Mac OS X
Mac OS X (10.11.2) is taken as an example to describe the following operation steps:
- Download Tunnelblick installation files. Official website: https://github.com/Tunnelblick/Tunnelblick/releases/tag/v3.8.0. Download address: https://bmr.bj.bcebos.com/tools/openvpn/mac/Tunnelblick_3.8.0_build_5370.dmg.
- Install Tunnelblick tools. Choose the default installation.
- Download OpenVPN Client configuration files. Log in to the console, select “Product Service” -> “Baidu MapReduce-Cluster List”, enter the cluster list page, click the cluster name to enter the cluster details page, and click and download “openvpn-conf.zip” in the "Tools Download" section.
- Decompress the “openvpn-conf.zip” files, and then enter the directory “openvpn-conf/client/”. After the double click of “client.ovpn”, Tunnelblick launches the OpenVPN Client installation configurations, as the following figure shows. Select to share the configurations to "All Users" or "Just Me".
- Click "Connect" at the lower right after Tunnelblick completes the OpenVPN Client installation configurations.
- Open the browser, and then use the Master node’s private IP to access cluster services. Obtain the private IP from the "Node Information" section of the cluster details page.
Linux (centos6.5)
Centos 6.5 is taken as an example.
Preparation
Install lzo and libpam:
# download the lzo source code package on http://bmr.bj.bcebos.com/tools/openvpn/linux/lzo-2.09.tar.gz
tar zxf lzo-2.09.tar.gz
cd lzo-2.09
./configure
make
make install
# download the libpam source code package on http://bmr.bj.bcebos.com/tools/openvpn/linux/Linux-PAM-1.2.1.tar.bz2
tar xvf Linux-PAM-1.2.1.tar.bz2
cd Linux-PAM-1.2.1
./configure
make
make install
Use yum to Install OpenVPN Client
- Download and install the OpenVPN. Execute the command
yum install openvpn
. - Download and decompress OpenVPN Client configuration files. Log in to the console, select "Product Service -> Baidu MapReduce-Cluster List", enter the cluster list page, click the cluster name to enter the cluster details page, click and download “openvpn-conf.zip” in the "Tools Download" section, and decompress the package.
-
Copy all files under the directory “openvpn-conf/client/” to the OpenVPN installation directory “/etc/openvpn”. The command is as follows:
cp client/* /etc/openvpn service openvpn start
Use Source Codes to Install OpenVPN Client
- Download the OpenVPN source codes. The download address of source codes is http://bmr.bj.bcebos.com/tools/openvpn/linux/openvpn-2.3.10.tar.gz.
-
Decompress and install source codes. The command is as follows:
tar zxf openvpn-2.3.10.tar.gz
cd openvpn-2.3.10
./configure # if you are a non-root user, please add --prefix to specify the installation path
make
make install
- Download and decompress OpenVPN Client configuration files. Log in to the console, select "Product Service -> Baidu MapReduce-Cluster List", enter the cluster list page, click the cluster name to enter the cluster details page, click and download “openvpn-conf.zip” in the "Tools Download" section, and decompress the package.
-
Enter the OpenVPN Client directory, and then launch the OpenVPN. The command is as follows:
cd openvpn-conf/client /usr/sbin/openvpn --config client.conf # if you are a non-root user, please use sudo
Windows
Windows 7 (64bit) is taken as an example.
- Download and install the OpenVPN. Open http://bmr.bj.bcebos.com/tools/openvpn/windows/openvpn-install-2.3.10-I002-x86_64.exe, download the file, and install it by default.
- Download OpenVPN Client configuration files. Log in to the console, select "Product Service -> Baidu MapReduce-Cluster List", enter the cluster list page, click the cluster name to enter the cluster details page, and click and download “openvpn-conf.zip” in the "Tools Download" section.
- Decompress the “openvpn-conf.zip” file, and then copy all files under the directory “openvpn-conf/client/” to the OpenVPN installation directory “OpenVPN\config”.
- In the OpenVPN installation directory, open the program “openvpnserv.exe” to automatically connect the OpenVPN Server, as the following figure shows: