Install YugabyteDB

Prerequisites

  • macOS 10.12 or later.

  • Verify that you have Python 2 installed. Support for Python 3 is in the works, status can be tracked on GitHub.

  1. $ python --version
  1. Python 2.7.10
  • wget or curl is available.

The instructions use the wget command to download files. If you prefer to use curl (included in macOS), you can replace wget with curl -O.

To install wget on your Mac, you can run the following command if you use Homebrew:

  1. $ brew install wget
  • Each tablet maps to its own file, so if you experiment with a few hundred tables and a few tablets per table, you can soon end up creating a large number of files in the current shell. Make sure that this command shows a big enough value.
  1. $ launchctl limit maxfiles

We recommend setting the soft and hard limits to 1048576.

Edit /etc/sysctl.conf, if it exists, to include the following:

  1. kern.maxfiles=1048576
  2. kern.maxproc=2500
  3. kern.maxprocperuid=2500
  4. kern.maxfilesperproc=1048576

If this file does not exist, then create the file /Library/LaunchDaemons/limit.maxfiles.plist and insert the following:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <plist version="1.0">
  4. <dict>
  5. <key>Label</key>
  6. <string>limit.maxfiles</string>
  7. <key>ProgramArguments</key>
  8. <array>
  9. <string>launchctl</string>
  10. <string>limit</string>
  11. <string>maxfiles</string>
  12. <string>1048576</string>
  13. <string>1048576</string>
  14. </array>
  15. <key>RunAtLoad</key>
  16. <true/>
  17. <key>ServiceIPC</key>
  18. <false/>
  19. </dict>
  20. </plist>

Enure that the plist file is owned by root:wheel and has permissions -rw-r—r—. To take effect, you need to reboot your computer or run this command:

  1. $ sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist

You might have to unload the service before loading it.

Download YugabyteDB

Download the YugabyteDB tar.gz file using the following wget command.

  1. $ wget https://downloads.yugabyte.com/yugabyte-2.1.0.0-darwin.tar.gz

To unpack the archive file and change to the YugabyteDB home directory, run the following command.

  1. $ tar xvfz yugabyte-2.1.0.0-darwin.tar.gz && cd yugabyte-2.1.0.0/

Configure

Some of the examples in the Explore core features section require extra loopback addresses that allow you to simulate the use of multiple hosts or nodes.

To add six loopback addresses, run the following commands, which require sudo access.

  1. sudo ifconfig lo0 alias 127.0.0.2
  2. sudo ifconfig lo0 alias 127.0.0.3
  3. sudo ifconfig lo0 alias 127.0.0.4
  4. sudo ifconfig lo0 alias 127.0.0.5
  5. sudo ifconfig lo0 alias 127.0.0.6
  6. sudo ifconfig lo0 alias 127.0.0.7

Note: The loopback addresses do not persist upon rebooting of your Mac.

To verify that the extra loopback addresses exist, run the following command.

  1. $ifconfig lo0

You should see some output like the following:

  1. lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
  2. options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
  3. inet 127.0.0.1 netmask 0xff000000
  4. inet6 ::1 prefixlen 128
  5. inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
  6. inet 127.0.0.2 netmask 0xff000000
  7. inet 127.0.0.3 netmask 0xff000000
  8. inet 127.0.0.4 netmask 0xff000000
  9. inet 127.0.0.5 netmask 0xff000000
  10. inet 127.0.0.6 netmask 0xff000000
  11. inet 127.0.0.7 netmask 0xff000000
  12. nd6 options=201<PERFORMNUD,DAD>

Next stepCreate a local cluster