Contents


Digital Business Start trial offer for IBM Power Enterprise Systems using MongoDB

A quick start guide

Comments

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 #PowerVMPowerVCPowerVC and Linux imageEstimated time to install and be up and running
1YesYesYes30-90 minutes
2YesYesNo1-4 hours
3Yes--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:

  1. Request the free trial resource enablement code
  2. Deploy the Linux VM using one of the configurations from Table 2 below
  3. Install MongoDB
  4. 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:

  1. Request the free trial resource enablement code
  2. Create a VM using one of the configurations in Table 2 below
  3. Install the Linux OS you'll be running:
  4. Capture the Linux image into PowerVC and deploy a new VM cloned from the captured image.
  5. Install MongoDB
  6. 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:

  1. Request the free trial resource enablement code
  2. Create a VM using one of the configurations in Table 2 below
  3. Install the Linux OS you'll be running:
  4. Install MongoDB
  5. Download and run the YCSB workload
1

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:

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 sizeIFLCPUvCPUMemory (GB)FC SAN Storage (NPIV or vSCSI)
small14432 GB50 GB
medium28864 GB100 GB
large3121296 GB500 GB
2

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:

3

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
4

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*
5

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 VMsMinimumUp to 400401-10001001-20002001-30003001-5000
Processor capacity1248812
Virtual CPUs2248812
Memory (GB)101012202844
Swap Space (GB)101012202844
Disk Space (GB)40436080100140

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.

6

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:

  1. From the PowerVC GUI, click Hosts in the left pane and then highlight the appropriate Host Server.
  2. Select Manage Existing Virtual Machines
  3. Select either specific Virtual Machines or All
  4. 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:

  1. Select the Virtual Machines tab in the left window pane
  2. Highlight the VM with the RHEL 7.2 LE image
  3. 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:
    1. From the PowerVC GUI, click Hosts in the left pane and then highlight the appropriate Host Server.
    2. Select Manage Existing Virtual Machines
    3. Select either specific Virtual Machines or All
    4. 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:
    1. Select the Virtual Machines tab in the left window pane
    2. Highlight the VM with the Ubuntu 16.04.1 LTS image
    3. 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

7

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:

  1. 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
  2. Install MongoDB using yum
  3. 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
  4. Start MongoDB on RHEL 7.2 LE
    To ensure that the mongod daemon starts on boot, run the chkconfig command, then start the mongo daemon process:
    # chkconfig mongod on
    # service mongod start
            Redirecting to /bin/systemctl start  mongod.service
  5. 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:

  1. Get started by going to this page: https://www.mongodb.com/download-center?cm_mc_uid=60750457636214738033688&cm_mc_sid_50200000=1486722354#enterprise
  2. Select Enterprise Server
  3. Select Ubuntu 16.04 ppc64le (IBM POWER) from the Platform pull-down menu
  4. Click Download
  5. Complete the form fields and select Submit
  6. 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:

  1. 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>
  2. 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
  3. Reload local package database
    # sudo apt-get update
  4. Install the MongoDB Enterprise packages
    # sudo apt-get install -y mongodb-enterprise
  5. Prepare to run MongoDB Enterprise Server
    Set the ulimit to a larger value than the default:
    # ulimit -n 10000
  6. 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.
  7. 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
8

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

  1. 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
  2. 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 running mvn –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"
  3. Download and install YCSB from GitHub
    Follow the instructions found here: http://wiki.github.com/brianfrankcooper/YCSB/
  4. Install curl, if needed, as a prerequisite to downloading YCSB
  5. Use curl to download YSCB
  6. 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
  7. 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
  8. 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

  1. 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
  2. Install Apache-Maven
    Using apt-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 running mvn –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"
  3. Download and install YCSB from GitHub
    Follow the instructions found here: http://wiki.github.com/brianfrankcooper/YCSB/
  4. Install curl, if needed, as a prerequisite to downloading YCSB
  5. Use curl to download YSCB
  6. 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
  7. 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
  8. 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:

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


Downloadable resources


Comments

Sign in or register to add and subscribe to comments.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Linux
ArticleID=1042739
ArticleTitle=Digital Business Start trial offer for IBM Power Enterprise Systems using MongoDB
publish-date=03152017