Contents
- Introduction
- Customer use cases
- 1. Request free trial code
- 2. Create Linux VM
- 3. Install RHEL 7.2 LE
- 4. Install Ubuntu 16.04.1 LTS
- 5. Install and configure PowerVC
- 6. Capture and deploy the Linux VM for PowerVC
- 7. Install MongoDB
- 8. Install and run YCSB workload
- Appendix A: Install PowerVC on RHEL 7.2 LE
- Appendix B: Sample YCSB benchmarking script
- Additional contributors
- Downloadable resources
- Comments
Digital Business Start trial offer for IBM Power Enterprise Systems using MongoDB
A quick start guide
The Digital Business Start trial offer for Power Enterprise Servers with MongoDB is specifically tailored for customers who have IBM® Power Systems™ E850C, E870C, E880C, E850, E870, or E880 servers in their environment and want to enable inactive cores and memory to deploy MongoDB on a Linux operating system (OS).
This quick start guide is designed for POWER8® administrators who already have a working knowledge of Power servers, but not necessarily of configuring and installing Linux in their environments. Taking advantage of this free trial offer will allow administrators to experiment with some of the latest open source operating systems and NoSQL databases available today, specifically MongoDB running on Red Hat Enterprise Linux (RHEL) 7.2 Little Endian (LE) or Ubuntu 16.04.1 LTS.
There are three different customer use cases described in this guide and depending on the one that addresses your specific requirements you'll learn how to:
- Request a free trial capacity enablement code to enable inactive cores and memory
- Create a Linux VM using one of several configuration options
- Install the Linux OS (RHEL 7.2 LE or Ubuntu 16.04.1 LTS)
- Import the Linux image into the IBM PowerVC™ Management
- Deploy a Linux virtual machine (VM) using one of several configuration options
- Install MongoDB
- Download and run the Yahoo! Cloud Serving Benchmark (YCSB) workload to verify the MongoDB environment
Customer use cases
This section contains sample use case scenarios which should help you decide where to start and what to deploy. The following table shows the approximate time it will take to complete each of the use cases. Note: Time variances rely heavily upon your experience and skill level.
Table 1. Estimated time to complete setup of each customer use case
Use case # | PowerVM | PowerVC | PowerVC and Linux image | Estimated time to install and be up and running |
---|---|---|---|---|
1 | Yes | Yes | Yes | 30-90 minutes |
2 | Yes | Yes | No | 1-4 hours |
3 | Yes | - | - | 1-4 hours |
Customer use case 1
This use case is for Power users who are proficient with PowerVC, PowerVM, and have Linux images (RHEL 7.2 LE or Ubuntu 16.04.1 LTS) already imported into PowerVC. To get MongoDB installed and setup for this scenario, you'll complete the following steps:
- Request the free trial resource enablement code
- Deploy the Linux VM using one of the configurations from Table 2 below
- Install MongoDB
- Download and run the YCSB workload
Customer use case 2
This use case is for Power users who are proficient with PowerVC and PowerVM, but who may not be familiar with Linux and do not currently have Linux images imported into PowerVC. To get MongoDB installed and setup for this scenario, you'll complete the following steps:
- Request the free trial resource enablement code
- Create a VM using one of the configurations in Table 2 below
- Install the Linux OS you'll be running:
- Capture the Linux image into PowerVC and deploy a new VM cloned from the captured image.
- Install MongoDB
- Download and run the YCSB workload
Customer use case 3
This use case is for Power users who are using PowerVM and may or may not be familiar with Linux. To get MongoDB installed and setup for this scenario, you'll complete the following steps:
- Request the free trial resource enablement code
- Create a VM using one of the configurations in Table 2 below
- Install the Linux OS you'll be running:
- Install MongoDB
- Download and run the YCSB workload
Request a free trial capacity enablement code
Trial Capacity on Demand (CoD) is provided when you make a request for trial capacity enablement, typically through the CoD Project Office.
For this special offer, the process has been simplified to extend the typical 30-day trial period for up to three months. If you are interested in taking advantage of this free trial offer, contact your local IBM representative or IBM Business Partner and request that they submit a MongoDB Proof of Concept Authorization form on your behalf. Download the form:
- IBM Sales Representative
- IBM Business Partner (requires PartnerWorld userID and password)
A standard trial capacity request grants eight processor core activations and 64 GB of memory (provided those resources are available). You can also make an exception request for all processors, all memory, or both to be activated. An exception request can typically be made only once over the life of the machine. These CoD requests are typically good for 30 days. With this offer, however, extensions are possible for up to three months in increments of 30 days each. Talk to your Sales Representative for more information. After the request is made, it may take up to three business days to process. The code will be sent to the email address you provide and will also be posted to the CoD website.
When you receive the CoD code, you'll need to activate it by following the steps outlined in the following PDF: IBM Capacity on Demand. Note that a Hardware Management Console (HMC) is required to administer the CoD offering. Additional requirements and assumptions are listed in the next section.
After you initialize the CoD code, the trial period is available for 30 power-on days. The trial period only advances while the server is powered on. Any additional time left from a previous installed CoD trial license will not be added to the 30 days of the new trial offer. For this special offer, up to three months of usage will be issued in 30 day trial code entries.
System requirements and assumptions
- A Hardware Management Console (HMC) is required to activate the trial capacity on demand (CoD) license code and for creating Virtual I/O Servers (VIOS)
- IBM PowerVM™ is required for creating Virtual I/O Servers
- Hardware:
IBM Power System E850, E870, E880, E850C, E870C, or E880C - Network access
- If you're using IBM PowerVC you’ll need to use virtual storage and virtual network for all VMs
Table 2. Core and memory activation IFL configurations with suggested disk sizes for RHEL 7.2 LE or Ubuntu 16.04.1 LTS
Digital Business Start configuration size | IFL | CPU | vCPU | Memory (GB) | FC SAN Storage (NPIV or vSCSI) |
---|---|---|---|---|---|
small | 1 | 4 | 4 | 32 GB | 50 GB |
medium | 2 | 8 | 8 | 64 GB | 100 GB |
large | 3 | 12 | 12 | 96 GB | 500 GB |
Create a Linux virtual machine (VM) using PowerVM
PowerVM is required for VIOS, which is in turn required for Virtual I/O LPARs. Virtual I/O LPARs, which are also known as virtual machines (VMs) should be created through the HMC following standard procedures. It is assumed that you are familiar with VM provisioning using PowerVM on POWER hardware. If PowerVC is being used in your environment and has a Linux image imported to it, deploy a VM with the desired resources listed in Table 2 and go to the MongoDB installation section.
For more information about configuring a VM with PowerVM, see the following IBM Redbooks:
Install RHEL 7.2 LE
If you plan to run MongoDB on RHEL 7.2 LE, follow these steps to get it installed and configured, otherwise go to the Install Ubuntu 16.04.1 LTS.
Obtain a RHEL license (required)
If needed, you can get a free 60 day evaluation license by following the directions at this link: http://ibm.biz/BdswD4. Make sure to request a license for the optional and supplementary paths as well as the base installation repo paths that come with your Red Hat Network (RHN) subscription.
Note: For Red Hat Enterprise Linux 7.x, some of the prerequisites for
installing PowerVC and cloud-init
have moved from the Red Hat
Enterprise Linux OS install media to an Optional Software channel that can
be accessed by using the RHN subscription.
Install RHEL 7.2 LE
After you've enabled your Red Hat subscription, download the RHEL 7.2 LE image to an existing NIM server, a DVD, or a Flash drive, and use the SMS menu to point to the install device to start the installation. For detailed RHEL installation instructions, see the documentation found on the Red Hat Customer Portal, under Getting Started.
Install the required additional packages for RHEL
- Verify that the network is configured with external access available.
If the network is not configured, use
nmtui
to open the Network Manager and edit the connection. Then run service network restart to restart the Network Manager. - Reliable Scalable Cluster Technology (rsct) packages may be required
for Linux VMs to work properly with some HMCs. Failure to install the
rsct packages may result in a No RMC Connection
warning message being reported by the HMC for that VM. PowerVC will
not be able to import the VM, including the RHEL 7.2 LE image if the
RMC is not able to connect to the HMC.
Pre-requisites for the rsct packages are: ksh
The rsct packages can be found here: http://www14.software.ibm.com/webapp/set2/sas/f/lopdiags/redhat/hmcmanaged/rhel7.html
Download the following LE rpm packages and install them:
- SRC / 3.2.2
- RSCT basic
- RSCT core
- RSCT utilities
# yum install ksh -y # rpm -Uvh src-3.2.2.0-16265.ppc64le.rpm # rpm -Uvh rsct.basic-3.2.2.0-16265.ppc64le.rpm rsct.core-3.2.2.0-16265.ppc64le.rpm rsct.core.utils-3.2.2.0-16265.ppc64le.rpm
Disable SELinux
SELinux is required by MongoDB and PowerVC to be in either the permissive mode or permanently disabled.
To set SELinux to permissive mode (which means that access attempts violating the SELinux policy will be logged, but not prevented) run this command:
# setenforce 0 # sestatus
Install Ubuntu 16.04.1 LTS
If you plan to run MongoDB on Ubuntu 16.04.1 LTS, follow these steps to get it installed and configured, otherwise go the Install RHEL 7.2 LE instructions.
Download and install a copy of Ubuntu for ppc64le to an existing NIM server, a DVD, or a Flash drive, and use the SMS menu to point to the install device to start the installation.
Download a copy of Ubuntu 16.04.1 from here: https://www.ubuntu.com/download/server. Note that no license is required.
Install the required additional packages
After Ubuntu is installed, perform some preliminary setup steps:
- To log in as root:
$ sudo passwd root $ su root
- To install some basic packages:
# apt-get install openssh-server nfs-common
- To enable root login via ssh change the line:
# sudo sed -i 's/prohibit-password/yes/' /etc/ssh/sshd_config # sudo systemctl restart sshd
- Reliable Scalable Cluster Technology (rsct) packages may be required
for Linux VMs to work properly with HMC. Failure to install the rsct
packages may result in a No RMC Connection warning
message being reported by the HMC for that VM. PowerVC will not be
able to import the VM, including the Ubuntu image, if the RMC is not
able to connect to the HMC. Run this command:
# sudo apt-get install rsct*
Install and configure PowerVC
PowerVC (IBM Power Virtualization Center) is a powerful advanced virtualization and cloud management tool that operates from its own host without taking up a lot of resources. PowerVC can be installed on a server with just 2 vCPUs and 10 GB of memory.
If you already utilize PowerVC in an AIX or Linux environment, then you may want to skip this section and deploy a Linux VM using the templates that most closely match the resources listed in Table 2 above.
If you have PowerVC managing your non-Linux VM environment, then you may want to skip to the Preparing the RHEL 7.2 LE VM for Capture or Preparing the Ubuntu 16.4.1 LTS VM for Capture sections as appropriate for your environment.
If you have never used PowerVC, and would like to give it a try, continue to install PowerVC. For review, to expand your knowledge of PowerVC, or to answer specific questions not covered here, visit the IBM PowerVC – Virtualization Center at: http://www-03.ibm.com/systems/power/software/virtualization-management/
For more detailed step-by-step guidance covering all PowerVC Linux tasks, see Chapter 4 of the IBM Redbook: IBM PowerVC Version 1.3.2 Introduction and Configuration.
Install PowerVC
The Appendix provides detailed steps for installing PowerVC on RHEL 7.2 LE. Prior to installation, ensure that you understand the PowerVC resources requirements, as listed in the table below:
Table 3. PowerVC resource requirements
Number of VMs | Minimum | Up to 400 | 401-1000 | 1001-2000 | 2001-3000 | 3001-5000 |
---|---|---|---|---|---|---|
Processor capacity | 1 | 2 | 4 | 8 | 8 | 12 |
Virtual CPUs | 2 | 2 | 4 | 8 | 8 | 12 |
Memory (GB) | 10 | 10 | 12 | 20 | 28 | 44 |
Swap Space (GB) | 10 | 10 | 12 | 20 | 28 | 44 |
Disk Space (GB) | 40 | 43 | 60 | 80 | 100 | 140 |
For more information about PowerVC resource requirements, see the Power VC hardware and software requirements in the IBM Knowledge Center.
Start using PowerVC
After PowerVC is installed, open a web browser to start using PowerVM to manage PowerVC: https://<ipaddress or hostname of PowerVC server >
The initial login id will be root with the root password of the server it is launched from.
Discover system components
See Chapter 4 of the IBM Redbook, IBM PowerVC Version 1.3.2 Introduction and Configuration, for step-by-step instructions for discovering and configuring all the Linux environment resources.
Much of the configuration information will be imported as the discovery process of each resource completes. Follow the directions in the configuration guide to Add Host (HMC), Storage, Network, and then follow the steps below to prepare to import the VM with the selected Linux OS installed on it, which will be discovered under the Host tab.
Capture and deploy the Linux VM for PowerVC
This section covers preparing the installed Linux OS VM for capture, capturing the image onto PowerVC, and then deploying a new VM cloned from the newly imported image.
Follow the instructions for the Linux OS you're running:
Prepare RHEL 7.2 LE VM for capture by installing cloud-init
There are a few pre-requisites that must be met before a VM can be imported, or have its image “captured.” They are:
- The VIOS on which the VM runs is managed by IBM PowerVC
- The VM uses virtual network and storage; the network and storage devices are provided by the VIOS
- If using multi-path on PowerVM, you must configure Linux for multipath I/O (MPIO) on the root device
- The rsct packages must be installed or the Linux VM may fail to be managed by PowerVC
RHEL7.2 LE (host) VM preparation
- Add the EPEL (Extra Packages for Enterprise Linux) yum repository
# wget http://dl.fedoraproject.org/pub/epel/7/ppc64/e/epel-release-7-9.noarch.rpm # rpm -Uvh epel-release-7*.rpm
- If cloud-init already exists on the VM, uninstall it:
# rpm –qa |grep cloud # rpm –e <full package name>
- Install cloud-init dependencies:
# yum install python python-boto policycoreutils-python python-jsonpatch python-prettytable # yum install python-cheetah
If the install of python-cheetah fails with a dependency issue; download and install python-pygments from the RHEL 7.2.LE supplemental DVD/ repo. If the libwebp-0.3.0-5.ael7b.ppc64le.rpm fails to install, it is located on the RHEL 7.2LE install DVD. - Get the cloud-init rpm located on the PowerVC server that will manage
the VM:
# scp root@<POWERVC system name/ IP>:/opt/ibm/powervc/images/cloud-init/rhel/cloud-init-0.7.4-8.el7.noarch.rpm # rpm -Uvh cloud-init-0.7.4-8.el7.noarch.rpm
Copy /opt/ibm/PowerVC/images/cloud-init/rhel/cloud-init-0.7.4-8.el7.noarch.rpm to the RHEL 7.2 VM. - Modify the variables in the cloud.cfg file as shown below:
# vi /etc/cloud/cloud.cfg disable_root: 0 ssh_pwauth: 1 ssh_deletekeys: 1 <append the following lines:> disable_ec2_metadata: True datasource_list: ['ConfigDrive']
Note: If you want to change the name of the systems after deployment, remove “- update_hostname” from /etc/cloud/cloud.cfg. If you do not remove it, cloud-init resets the host name to the original host name deployed on system restarts.
Import the RHEL7.2 LE VM and capture the image
Complete the post cloud-init installation preparation steps:
- Verify that SELinux is disabled or set to permissive mode
- Network Manager must be installed and enabled:
# service NetworkManager status
- Install net-tools if not already installed.
# yum install net-tools
- Edit all of the /etc/sysconfig/network-scripts/ifcfg-eth* files to update or add, “NM_CONTROLLED = no settings”
- Remove the MAC address so it will not be propagated on future clones: Edit the /etc/sysconfig/network-scripts/ifcfg-eth* file and delete the HWADDR=”xx” line
- The VM must be powered off before starting the capture
The VM must be managed before the Boot LUN can be imported, or “captured”, as an image:
- From the PowerVC GUI, click Hosts in the left pane and then highlight the appropriate Host Server.
- Select Manage Existing Virtual Machines
- Select either specific Virtual Machines or All
- Select Manage (Select the VM and manage it, if selecting a specific VM)
As soon as the VM has been managed, it is ready to have its image imported:
- Select the Virtual Machines tab in the left window pane
- Highlight the VM with the RHEL 7.2 LE image
- Select Capture
Prepare the Ubuntu 16.04.1 LTS VM for capture by installing cloud-init
- If cloud-init already exists on the VM, uninstall it
- Get the cloud-init rpm, which is located on the PowerVC server that will manage the VM and copy /opt/ibm/PowerVC/images/cloud-init/ubuntu/ cloud-init_0.7.7~bzr1091-0ubuntu2_all.deb to the Ubuntu VM
- Ubuntu requires package pre-requisites. By using gdebi <pkg.deb>
all dependencies will be installed as well as the package specified.
# apt list --installed |grep cloud # scp root@<powervc server>:/opt/ibm/powervc/images/cloud-init/ubuntu/cloud-init_0.7.7~bzr1091-0ubuntu2_all.deb # apt-get install gdebi # sudo gdebi cloud-init_0.7.7~bzr1091-0ubuntu2_all.deb # sudo apt-mark hold cloud-init
- Run
apt-mark hold cloud-init
to prevent it from being overwritten on an update - Modify the variables in the cloud.cfg file as shown below:
# vi /etc/cloud/cloud.cfg disable_root: 0 disable_ec2_metadata: True <append the following line> datasource_list: ['ConfigDrive']
Note: If you want to change the name of the systems after deployment, remove “- update_hostname” from /etc/cloud/cloud.cfg. If you do not remove it, cloud-init resets the host name to the original host name deployed on system restarts.
Import the Ubuntu 16.04.1 LTS VM and capture the image
- The VM must be powered off before starting the capture.
- The VM must be managed before the image LUN can be captured as an
image:
- From the PowerVC GUI, click Hosts in the left pane and then highlight the appropriate Host Server.
- Select Manage Existing Virtual Machines
- Select either specific Virtual Machines or All
- Select Manage (Select the VM and manage it, if selecting a specific VM)
- As soon as the VM has been managed, it is ready to have its image
imported:
- Select the Virtual Machines tab in the left window pane
- Highlight the VM with the Ubuntu 16.04.1 LTS image
- Select Capture
Create a PowerVC template
In this step you'll create a template using the number of processors and the memory allotment you selected from Table 2: Core and memory activation IFL configurations with suggested disk sizes for RHEL 7.2 LE or Ubuntu 16.04.1 LTS.
See section 4.13, “Compute template setup” in the IBM Redbook, IBM PowerVC Version 1.3.2 Introduction and Configuration if you need instructions for creating the template.
Deploy the VM
After you've created the template, you'll use it to deploy a VM using the Linux image you captured in the previous steps.
For step-by-step instructions, see section 4.15.7 of the IBM Redbook, IBM PowerVC Version 1.3.2 Introduction and Configuration
Post install considerations for RHEL 7.2 LE:
- Depending on which parameters are selected before cloning, the newly
deployed VM may boot with the same name as the original clone. It will
not be accessible from the network as it will have a new MAC address.
To change the host name after boot, run this command:
# hostnamectl set-hostname <new VM Name> # hostnamectl status # reboot
- Configure network parameters:
# ip link to get the new MAC address # service network restart # service NetworkManager status /restart
- Make sure that you register the new RHEL 7.2 LE VM with Red Hat to
enable licenses. Verify that they exist in the redhat.repo before
going to the MongoDB installation section.
See the Install RHEL 7.2 LE section for more directions
Install MongoDB
Follow the MongoDB install instructions for the Linux OS you're running.
For additional install instructions and tips, refer to the following IBM developerWorks article: Get started with MongoDB on IBM Power Systems running Linux
For tuning tips, refer to the following IBM developerWorks article: Tuning guide for MongoDB on IBM Power Systems
Install MongoDB on RHEL 7.2 LE
To install MongoDB on RHEL 7.2 LE, follow these steps:
- Configure a repository
Create the /etc/yum.repos.d/mongodb-enterprise.repo file and add the following content:# vi /etc/yum.repos.d/mongodb-enterprise.repo [mongodb-enterprise] name=MongoDB Enterprise Repository baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/3.4/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
- Install MongoDB using yum
- Install the mongodb-enterprise-tools pre-requisite packages,
cyrus-sasl and cyrus-sasl-gssapi:
# yum install cyrus-sasl cyrus-sasl-gssapi -y
- Download the tools package from the following site and install
it as an rpm package before installing mongodb-enterprise: https://repo.MongoDB.com/yum/redhat/7Server/MongoDB-enterprise/3.4/ppc64le/RPMS/mongodb-enterprise-tools-3.4.2-1.el7.ppc64le.rpm
Note: Currently there is a problem with using yum to install the tools package. Pre-installing is the work around.# rpm -Uvh mongodb-enterprise-tools-3.4.2-1.el7.ppc64le.rpm # yum install –y mongodb-enterprise
- Install the mongodb-enterprise-tools pre-requisite packages,
cyrus-sasl and cyrus-sasl-gssapi:
- Prepare to run MongoDB on RHEL 7.2 LE
Verify that SELinux is either in the permissive mode or disabled and set ulimits to a larger value than the default:# sestatus SELinux status: disabled # ulimit -n 10000
- Start MongoDB on RHEL 7.2 LE
To ensure that the mongod daemon starts on boot, run thechkconfig
command, then start the mongo daemon process:# chkconfig mongod on # service mongod start Redirecting to /bin/systemctl start mongod.service
- Verify that MongoDB is running
Check in the /var/log/mongodb/mongod.log to verify that the MongoDB is up and running. Look for the connection to the default port, unless set to another id, which should be 27017 by default.
To stop MongoDB, run the following command:# sudo service mongod stop
To restart MongoDB, run the following command:# sudo service mongod restart
Install MongoDB Enterprise Server on Ubuntu 16.04.1 LTS
The community version of MongoDB is free, however you will not be able to run the YSCB Benchmark script unless you have the MongoDB Enterprise Server version installed. The MongoDB Enterprise level operating system requires a key to download and install it. You can take advantage of a free trial offer by following these steps:
- Get started by going to this page: https://www.mongodb.com/download-center?cm_mc_uid=60750457636214738033688&cm_mc_sid_50200000=1486722354#enterprise
- Select Enterprise Server
- Select Ubuntu 16.04 ppc64le (IBM POWER) from the Platform pull-down menu
- Click Download
- Complete the form fields and select Submit
- Click Installation Guide to go to the install instructions, which includes the trial public key you'll need to complete the install.
To install MongoDB Enterprise Server on Ubuntu 16.04.1 LTS, follow the instructions outlined on this page: https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-ubuntu/ and that are documented below:
- Install the public key. Note that the key will be in the MongodDB
instructions (URL above) after you complete the trial agreement form.
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv <enter key here>
- Create an /etc/apt/sources.list.d/mongodb-enterprise.list file for
MongoDB
#echo "deb [ arch=amd64,arm64,ppc64el,s390x ] http://repo.mongodb.com/apt/ubuntu xenial/mongodb-enterprise/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
- Reload local package database
# sudo apt-get update
- Install the MongoDB Enterprise packages
# sudo apt-get install -y mongodb-enterprise
- Prepare to run MongoDB Enterprise Server
Set the ulimit to a larger value than the default:# ulimit -n 10000
- Start MongoDB Enterprise Server
# sudo service mongod start
If you change the user that runs the MongoDB process, you must modify the access control rights to the /var/lib/mongodb and /var/log/mongodb directories to give this user access to these directories.
The MongoDB instance stores its data files in /var/lib/mongodb and its log files in /var/log/mongodb by default, and runs using the mongodb user account. You can specify alternate log and data file directories in /etc/mongod.conf. See systemLog.path and storage.dbPath for additional information. - Verify that MongoDB is running
Check in the /var/log/mongodb/mongod.log to verify that the MongoDB is up and running. Look for the connection to the default port, unless set to another id, which should be 27017 by default.
- To stop MongoDB, run the following command:
# sudo service mongod stop
- To restart MongoDB, run the following command:
# sudo service mongod restart
- To check MongoDB status, run the following command:
# sudo service mongodb status
Install and run the YCSB workload
The Yahoo! Cloud Serving Benchmark (YCSB) is a popular, open-source big data benchmarking tool that has been widely used to compare the performance of NoSQL data-base systems.
YCSB pre-requisites:
- JAVA JDK (developer)
- Maven
- Curl
Follow the YCSB install instructions for the Linux OS you're running:
Look here for more information: https://github.com/brianfrankcooper/YCSB/wiki/Getting-Started
Install YCSB on RHEL 7.2 LE
- Install prerequisite packages on RHEL 7.2 LE
Installing JAVA-JDK on RHEL 7.2 LE:#yum install java-1.8.0-openjdk-devel #javac –version javac 1.8.0_121
Export JAVA_HOME path in the user .bashrc, then run source to enable it:#vi .bashrc add --> export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk #source .bashrc #echo $JAVA_HOME
- Install Apache-Maven
Using yum install of the later versions of Apache Maven will configure the path variables for Java JDK and mvn. Avoid downloading the tar package and manually installing if possible.
Verify that Maven is up and running by checking the version. Note: mvn version is not the same as maven version! If runningmvn –version
fails, it may be due to not having the proper PATH variables set.#yum install maven (apache-maven) # mvn -version Apache Maven 3.0.5 (Red Hat 3.0.5-17) Maven home: /usr/share/maven Java version: 1.8.0_121, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.ppc64le/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-327.el7.ppc64le", arch: "ppc64le", family: "unix"
- Download and install YCSB from GitHub
Follow the instructions found here: http://wiki.github.com/brianfrankcooper/YCSB/ - Install curl, if needed, as a prerequisite to downloading YCSB
- Use curl to download YSCB
- Use tar to extract the compressed file
# yum install curl # curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.12.0/ycsb-0.12.0.tar.gz # tar xfvz ycsb-0.12.0.tar.gz # cd ycsb-0.12.0 # ./bin/ycsb load mongodb-async -s -P workloads/workloada > outputLoad.txt
- Verify that MongoDB is active
MongoDB must be active before running the YCSB workload. Verify that the daemon is running with the following command:ps –ef |grep mongo
- Move to the yscb directory and run one of the workload commands to verify the environment is sound.
Install YCSB on Ubuntu 16.04.1 LTS
- Install prerequisite packages on Ubuntu 16.04.1 LTS
- Install JAVA JDK on Ubuntu 16.04.1
# sudo apt-get install openjdk-8-jdk # javac -version javac 1.8.0_121 # sudo update-alternatives --config java
Make sure that /usr/lib/jvm/java-8-openjdk-ppc64el/jre/bin/java is selected as the default. - Use the output from
sudo update-alternatives --config java
to set JAVA_HOME in /etc/profile, then run source to enable it:# sudo nano /etc/profile add --> export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-ppc64el" # source /etc/profile # echo $JAVA_HOME /usr/lib/jvm/java-8-openjdk-ppc64el
- Install JAVA JDK on Ubuntu 16.04.1
- Install Apache-Maven
Usingapt-get install
of the later versions of Apache Maven will configure the path variables for Java JDK and mvn. Avoid downloading the tar package and manually installing if possible.
Verify that Maven is up and running by checking the version. Note: mvn version is not the same as maven version! If runningmvn –version
fails, it may be due to not having the proper PATH variables set.# apt-get install maven (apache-maven) # mvn -version Apache Maven 3.0.5 (Red Hat 3.0.5-17) Maven home: /usr/share/maven Java version: 1.8.0_121, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.ppc64le/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-327.el7.ppc64le", arch: "ppc64le", family: "unix"
- Download and install YCSB from GitHub
Follow the instructions found here: http://wiki.github.com/brianfrankcooper/YCSB/ - Install curl, if needed, as a prerequisite to downloading YCSB
- Use curl to download YSCB
- Use tar to extract the compressed file
# apt-get install curl # curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.12.0/ycsb-0.12.0.tar.gz # tar xfvz ycsb-0.12.0.tar.gz # cd ycsb-0.12.0 # ./bin/ycsb load mongodb-async -s -P workloads/workloada > outputLoad.txt
- Verify that MongoDB is active
MongoDB must be active before running the YCSB workload. Verify that the daemon is running with the following command:ps –ef |grep mongo
- Move to the yscb directory and run one of the workload commands to verify the environment is sound.
See Appendix B for a sample YCSB Benchmarking script that can be used as a starting point for verifying throughput on your system. This script only utilizes one of the three basic workloads available for download with YCSB.
Note that there are parameters requiring manual input via editing before running the script. For instance, the system name needs to be set. There are other variable parameters, such as threads and number of clients, to aid in manipulating benchmark criteria. The script needs to be created (copied into a file) in the yscb-0.12.0 directory before running.
Appendix A: Install PowerVC on RHEL 7.2 LE
The following instructions assume that RHEL 7.2 LE is installed on a server and licensed for the installation, supplementary, and optional repo paths.
Install the prerequisite packages
There are multiple prerequisite packages required, but installing libvirt-python will pick up the rest:
# yum install libvirt-python Installed: libvirt-python.ppc64le 0:2.0.0-2.el7 Dependency Installed: autogen-libopts.ppc64le 0:5.18-5.el7 cyrus-sasl.ppc64le 0:2.1.26-20.el7_2 cyrus-sasl-md5.ppc64le 0:2.1.26-20.el7_2 gnutls-dane.ppc64le 0:3.3.24-1.el7 gnutls-utils.ppc64le 0:3.3.24-1.el7 ldns.ppc64le 0:1.6.16-10.el7 libvirt-client.ppc64le 0:2.0.0-10.el7_3.4 nmap-ncat.ppc64le 2:6.40-7.el7 unbound-libs.ppc64le 0:1.4.20-28.el7 Complete!
Set the ulimit
to unlimited and if you're using anything
other than eth0, reset HOST_INTERFACE before installing:
# ulimit –f unlimited # export HOST_INTERFACE=<current default Ethernet port, example: eth1>
Download and Install PowerVC
Download the tar file then extract and install the appropriate version. The one displayed is for RHEL7.x.
# wget http://pokgsa.ibm.com/projects/p/powervc/build/release/1.3.2.0/gm-rc4/20161206-1637/powervc-install-ppcle-1.3.2.0.tgz # tar -zxvf powervc-install-ppc-rhel-1.3.2.0.tgz # cd powervc-1.3.2.0 # ./install
Sample install output and configuration
# ./install ################################################################################ Starting the IBM PowerVC 1.3.2.0 Installation on: 2017-02-02T21:11:06-06:00 ################################################################################ Select the edition to install: 1 - IBM PowerVC Standard 2 - IBM Cloud PowerVC Manager 9 - Exit Select the offering type to install: 1 - Standard managing PowerVM 2 - Standard managing PowerKVM 9 - Exit LOG file is /opt/ibm/PowerVC/log/PowerVC_install_2017-02-02-211106.log Checking disk space Checking file size limit of the file system. Current maximum file size : unlimited Extracting license content Enter 1 ,-- to accept license Enter 1 --- Do you want the PowerVC setup to configure the firewall? 1-Yes or 2-No? NOTE: The firewalld service will be disabled as the iptables service is used by PowerVC. 1 NOTE: The following list of system configurations will be modified as part of installation. /etc/sudoers /etc/httpd/conf.d/ssl.conf /etc/sysctl.conf /etc/httpd/conf/httpd.conf Continue with the installation: 1-Yes or 2-No? =============================================================================
For more information, visit the following web pages:
- https://www.ibm.com/support/knowledgecenter/en/SSXK2N_1.3.2/com.ibm.PowerVC.standard.help.doc/kc_welcome- standard-supermap.html
- https://www.ibm.com/support/knowledgecenter/en/SSXK2N_1.3.2/com.ibm.PowerVC.standard.help.doc/PowerVC_installing_download_hmc.html
Appendix B: Sample YCSB benchmarking script
# this is a sample script to run ycsb with mongodb. # use this as a reference # may consider using this script to run ycsb workload with modifications #!/bin/bash ################################################### ### the section below needs review and modification ### ################################################### # modify the hostname HOSTNAME=ct-alp1-3 # modify the port number if been used by any other process PORT=27017 # modify mongo home if installed at different location MONGO_HOME=/usr # this sample workload runs with 2 threads THREADS=2 # number of YCSB clinets YCSB_CLIENTS=20 # full path of the ycsb binary. modify if installed at different location YCSB=/ycsb-0.12.0/bin/ycsb # workload type - workloada is a representation of mixed workload 50-50 read-write WORKLOAD=workloada ############################################################## ### no modification of the script needed after this point #### ############################################################## SMT=$(ppc64_cpu --smt |sed 's/=//') RANDOM=${RANDOM} DATETIME=`date +%F_%H%M` RUNNAME=${RANDOM}_${HOSTNAME}_${PORT}_`date +%Y%m%d%H%M%s%S`_${SMT}_${YCSB_CLIENTS}-clients ### starting up performance matrix collections processes ### mpstat -P ALL 30 800 >/tmp/mpstat_${RUNNAME}.out & iostat -xkt 30 800 >/tmp/iostat_${RUNNAME}.out & vmstat 30 800 >/tmp/vmstat_${RUNNAME}.out & #### Cleanup DB #### rm runname.txt killall mongod sleep 2 rm -rf /dev/shm/data mkdir /dev/shm/data ### Starting mongodb database ### $MONGO_HOME/bin/mongod --dbpath /dev/shm/data --storageEngine wiredTiger --port ${PORT} > /tmp/mongod.out 2>&1 & SLEEP=10 echo "Wait $SLEEP seconds for mongod to become stable...." sleep $SLEEP $MONGO_HOME/bin/mongo --host ${HOSTNAME} --port ${PORT} << EOMON use ycsb db.dropDatabase() EOMON #if can not connect to the database, then exit (($?)) && { echo "Couldn't connect the Database, try to $0 again" ; exit 1; } echo ${RUNNAME}>>runname.txt RUN=`cat runname.txt` mkdir ${RUN} FILE1A=${RUN}/${WORKLOAD}_LOAD_${PORT}_${RUN}.txt ### Load data into DB ### echo "loading the data into database ..." $YCSB load mongodb -threads ${THREADS} -s -P workloads/${WORKLOAD} -p "mongodb.url=mongodb://${HOSTNAME}:${PORT}/ycsb" -p recordcount=1000000 > ${FILE1A} echo "loading data done ..." #### Run workloads #### YCSB_Clients=$YCSB_CLIENTS FILE_ALL_RUNS=${RUN}/SUMMARY_RUN_${PORT}_${RUN}_${THREADS}-threads.txt for w in $WORKLOAD; do FILE=${RUN}/${w}_RUN_${PORT}_${RUN}_${THREADS}-threads.txt # Start YCSB run clients CLIENTS="" for c in $(seq 1 1 $YCSB_Clients);do $YCSB run mongodb -threads ${THREADS} -s -P workloads/${w} -p "mongodb.url=mongodb://${HOSTNAME}:${PORT}/ycsb" -p operationcount=1000000 > ${FILE}.$c & PROC=$! CLIENTS="$CLIENTS $PROC" done for CLIENT in $CLIENTS; do wait $CLIENT done printf "===============================================================\n" >>${FILE}.result printf "%12s :%12s\n" "Workload" "$w" >>${FILE}.result printf "===============================================================\n" >>${FILE}.result THROUGHPUT=`grep OVERALL ${FILE}.[0-9]* | grep Throughput | awk '{sum+=$3} END { printf "%4.5f\n",sum}'` printf "%12s : %10.2f ops/sec\n" "Throughput," $THROUGHPUT >>${FILE}.result for i in $(grep AverageLatency ${FILE}.1 | awk '{print $1}');do LATENCY=$(grep -F "$i AverageLatency" ${FILE}.[0-9] |awk '{sum+=$3} END {printf "%4.2f\n",sum/NR}') printf "%12s AverageLatnecy: %10.2f us\n" $i $LATENCY >>${FILE}.result done printf "===============================================================\n\n" >>${FILE}.result cat ${FILE}.result >> ${FILE_ALL_RUNS}.result sleep 1 done ### cleaning up ### for i in `ps -ef | grep stat | awk '{print $2}'` do kill -9 $i >/dev/null 2>&1 done sleep 1 ### printing out summary of the run ### cat ${FILE_ALL_RUNS}.result
Additional contributors
The authors would like to thank the following people for their contribution to the content in this article:
Beth Hoffman, IBM Executive IT Specialist - Big Data Analytics ISV Solution Architect; Vess Natchev, IBM Power Cloud Team Leader: Kyle Wurgler, IBM Power Analytics Team Lead; Edward R. (Ted) Cheslek IBM Linux installation and automation specialist; Chang W. (Eddie) Chin, IBM Systems & Storage Test Specialist; Sarah Hanson, ISST PowerKVM Test Architect; Calvin Sze, IBM OpenSystem Enablement Optimation; Yogesh Patgar, IBM Systems Test Lead ISST-AIX