SlideShare una empresa de Scribd logo
1 de 43
Hardware Agnostic: Cassandra on Raspberry Pi
Andy Cobley | Lecturer, University of Dundee, Scotland
*Cassandra is hardware agnostic
*So why not run it on a Raspberry Pi ?
*How hard can it be ?
*What can we do with it once it works?
Cassandra on Raspberry Pi
*Andy Cobley
*School of Computing
*University of Dundee
*Twitter: @andycobley
Who Am I ?
*Single chip Linux computer
*500 Meg ram
*Boots off an SD card
*Ethernet port
*(graphics and all you need for a general purpose computer)
Whats a Raspberry Pi ?
Pi with pound coin
*And here’s the Cassandra cluster *
And, here’s one for real
* Power Permitting !
*Cassandra is designed to be fast, fast at writing, fast at reading.
*This laptop with one instance of Cassandra will do 12,000 write
operations
*Raspberry Pi will do 200 !
The Bad News
*Running a external USB drive is actually worse !
*Probably be hardware feature
More bad news !
Raspberry Pi Schematic
*Oracle Java vs OpenJDK
And then there’s Java!
*Raspbian is Debian for the PI
*Uses the Hard floating point accelerator
*Much faster than Debian
*Current Oracle JDK won’t run on it !
And Raspbian
*http://www.oracle.com/technetwork/java/embedded/downloads/java
se/index.html
*Java SE Embedded version 6
*Cassandra might prefer 6
*But
*https://blogs.oracle.com/henrik/entry/oracle_releases_jdk_for_linux
*Preview at:
*https://jdk8.java.net/fxarmpreview/
Oracle java
*Actually not much difference in performance
Hard vs Soft Float
*Cassandra uses compression for performance
*Started in version 1.0
2x-4x reduction in data size
25-35% performance improvement on reads
5-10% performance improvement on writes
The Problem with compression
*Two types:
Google Snappy Compressor (Faster read/writes)
DeflateCompressor (Java zip, slower , better
compression)
*Snappy Compression not available on Pi
(requires native methods, so someone might get it to
work!)
Compression types
*Startup script allocates memory
*Calculates based on number of processors
*Pi reports Zero processors !
*Boom !
*Now fixed
And the startup script
*In Cassandra-env.sh
*JVM_OPTS="$JVM_OPTS -
Djava.rmi.server.hostname=192.168.1.15”
*Or else nodetool will not work between nodes
JMX Config
*C* 1.22. added UseCondCardMark as a JVM Opt
*"for better lock handling especially on hotspot with multicore
processor”
*In cassandra-env.sh
#if [ "$JVM_VERSION" > "1.7" ] ; then
# JVM_OPTS="$JVM_OPTS -
XX:+UseCondCardMark"
#fi
JVM OPT UseCondCardMark
*We’ve forgotten one thing
*The Pi cost £25
*You can power 4 from USB hub (no need for a power supply on
each one)
*So:
The Good News !
So, have a 64 node computer for £2000
University of Southhampton
*32 node Beowolf cluster:
*Joshua Kiepert, Boise University
Or this
*Adding nodes adds performance
*Adding nodes adds replicas of data
*BUT
*Make sure your ring is balanced,
*Pi’s don’t like to be unbalanced.
Adding nodes is good
*Vnodes (in 1.2) would be very nice
*However at this point I haven’t got 1.2 on Pi running on a cluster
Vnodes
Performance with 3/4 nodes
Performance with 5/6 nodes
*./stress -d 192.168.1.10,192.168.1.11,192.168.1.12 -o insert -I
DeflateCompressor
*Note: nodes to use
*You will get different performance if you insert to less nodes than
you have in your ring
Stress test commands
*Adding a node (in the absence of Vnodes)
Must seed form a known node
Use a program to calculate new keys
Bring up new node with the correct key in
cassandra.yaml
Use node tool to move other nodes
Adding Nodes Procedure
*Python code
import sys
if (len(sys.argv) > 1):
num = int(sys.argv[1])
else:
num = int(raw_input("How many nodes? :"))
for i in range(0,num):
print 'node %d: %d' % (i, (i*(2**127)/num))
Calculating keys
*Use nodetool
sudo ./nodetool -h 192.168.1.10 move
42535295865117307932921825928971026432
*And cleanup
./nodetool -h 192.168.1.10 cleanup
Moving existing nodes
*On Debian, you can free memory from the graphics chip
Cd /boot
sudo cp start.elf start.elf.old
sudo cp arm224_start.elf to start.elf
reboot
Getting more memory
*Under Rasbian
*Run with a monitor plugged for the first time
*Set options for screen memory
*Perhaps disable boot to GUI
Getting more Memory
*I prefer static network addresses
*Edit /etc/network/interfaces
iface eth0 inet static
address 192.168.1.41
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
*
Network address
*Make a master SD card
*Copy it !
*Make sure the master version has no data on it.
*Consider ”Puppet” (though I don’t use it)
Multiple nodes
*See https://github.com/acobley/CassandraStartup
*Put the file in /etc/init.d
*update-rc.d cassandra defaults
Starting as a service
*So for £200 we get an 8 node C* cluster
*It can be reconfigured, blown away, stress tested and generally
abused
*We can simulate data racks, data centers and I hope even long
network delays.
*Hopefully our upcoming MSc in Data Science will use these clusters
Pi is for teaching
*We know C* can be configured to be aware of:
Network racks
Data Centers
*We know we can have replicas are stored across these racks
*How can we play with this cheaply ?
C* is network aware
Proposed teaching tool
10mbs
Hubb
Noise
injection
Switch
2
Switch
1
Pi 1
Pi 2
Pi 3
Pi 1
Pi 2
Pi 3
*Cassandra wouldn’t run on a PI
*It does now.
*Running it on a Pi shook out some Cassandra bugs
*You can run it in a secure lab
Pi is discovery
*Most important, this was pure Geeky Fun
Pi is for fun
*Data Science:
*http://www.computing.dundee.ac.uk/study/postgrad/degreedetails.a
sp?17
Obligatory Plug
*Raspberry Pi is cheap
*C* needs some work to run on it
*You can make clusters cheaply for experimentation
*It’s fun !
C* is Hardware Agnostic
THANK YOU

Más contenido relacionado

La actualidad más candente

Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)
hastexo
 

La actualidad más candente (13)

PXE Network Booting The Raspberry Pi
PXE Network Booting The Raspberry PiPXE Network Booting The Raspberry Pi
PXE Network Booting The Raspberry Pi
 
Juju 基礎編
Juju 基礎編Juju 基礎編
Juju 基礎編
 
Juju + KubernetesでGPU の活用
Juju + KubernetesでGPU の活用Juju + KubernetesでGPU の活用
Juju + KubernetesでGPU の活用
 
Hydra
HydraHydra
Hydra
 
Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)
 
Big data Analytics hands-on sessions
Big data Analytics hands-on sessionsBig data Analytics hands-on sessions
Big data Analytics hands-on sessions
 
Ruby, Amazon Web Services and You
Ruby, Amazon Web Services and YouRuby, Amazon Web Services and You
Ruby, Amazon Web Services and You
 
NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)
 
PostgreSQL on ZFS Lightning Talk
PostgreSQL on ZFS Lightning TalkPostgreSQL on ZFS Lightning Talk
PostgreSQL on ZFS Lightning Talk
 
Tvs 473, Tvs 673, Tvs 873
Tvs 473, Tvs 673, Tvs 873 Tvs 473, Tvs 673, Tvs 873
Tvs 473, Tvs 673, Tvs 873
 
風若 foonyah v0.0.2
風若 foonyah v0.0.2風若 foonyah v0.0.2
風若 foonyah v0.0.2
 
node-fs
node-fsnode-fs
node-fs
 
My First AMD EPYC 7251 memo
My First AMD EPYC 7251 memoMy First AMD EPYC 7251 memo
My First AMD EPYC 7251 memo
 

Similar a Data stax cassandra_summit_2013_cassandra_raspberrypi-rc1

Chef on SmartOS
Chef on SmartOSChef on SmartOS
Chef on SmartOS
Eric Saxby
 

Similar a Data stax cassandra_summit_2013_cassandra_raspberrypi-rc1 (20)

C* Summit 2013: Hardware Agnostic - Cassandra on Raspberry Pi by Andy Cobley
C* Summit 2013: Hardware Agnostic - Cassandra on Raspberry Pi by Andy CobleyC* Summit 2013: Hardware Agnostic - Cassandra on Raspberry Pi by Andy Cobley
C* Summit 2013: Hardware Agnostic - Cassandra on Raspberry Pi by Andy Cobley
 
C* Summit EU 2013: Hardware Agnostic: Cassandra on Raspberry Pi
C* Summit EU 2013: Hardware Agnostic: Cassandra on Raspberry Pi C* Summit EU 2013: Hardware Agnostic: Cassandra on Raspberry Pi
C* Summit EU 2013: Hardware Agnostic: Cassandra on Raspberry Pi
 
How to Hack Edison
How to Hack EdisonHow to Hack Edison
How to Hack Edison
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110Raspberry pi on java 20121110
Raspberry pi on java 20121110
 
Начало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev KitНачало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev Kit
 
NetBSD workshop
NetBSD workshopNetBSD workshop
NetBSD workshop
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry Pi
 
Polstra 44con2012
Polstra 44con2012Polstra 44con2012
Polstra 44con2012
 
Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012
 
Using GPUs to handle Big Data with Java by Adam Roberts.
Using GPUs to handle Big Data with Java by Adam Roberts.Using GPUs to handle Big Data with Java by Adam Roberts.
Using GPUs to handle Big Data with Java by Adam Roberts.
 
DEF CON 23 - Phil Polstra - one device to pwn them all
DEF CON 23 - Phil Polstra - one device to pwn them allDEF CON 23 - Phil Polstra - one device to pwn them all
DEF CON 23 - Phil Polstra - one device to pwn them all
 
Intoduction to physical computing using Raspberry Pi, 18-02-2016
Intoduction to physical computing using Raspberry Pi, 18-02-2016Intoduction to physical computing using Raspberry Pi, 18-02-2016
Intoduction to physical computing using Raspberry Pi, 18-02-2016
 
Raspberry Pi a la CFML
Raspberry Pi a la CFMLRaspberry Pi a la CFML
Raspberry Pi a la CFML
 
Raspberry pi a la cfml
Raspberry pi a la cfmlRaspberry pi a la cfml
Raspberry pi a la cfml
 
Docker
DockerDocker
Docker
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020
 
IoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitIoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT Devkit
 
Chef on SmartOS
Chef on SmartOSChef on SmartOS
Chef on SmartOS
 
High performance content hosting
High performance content hosting High performance content hosting
High performance content hosting
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Data stax cassandra_summit_2013_cassandra_raspberrypi-rc1

Notas del editor

  1. (Picture Credits below: Glenn Harris 2012) http://www.southampton.ac.uk/~sjc/raspberrypi/pi_supercomputer_southampton.htm