Apache Flume Distributed Log Collection for Hadoop 2nd Edition Steve Hoffman instant download
Apache Flume Distributed Log Collection for Hadoop 2nd Edition Steve Hoffman instant download
https://ebookname.com/product/apache-flume-distributed-log-
collection-for-hadoop-2nd-edition-steve-hoffman/
https://ebookname.com/product/apache-cookbook-solutions-and-
examples-for-apache-administrators-2nd-edition-rich-bowen/
https://ebookname.com/product/apache-server-2-bible-2nd-edition-
mohammed-j-kabir/
https://ebookname.com/product/power-supplies-for-led-driving-2nd-
edition-steve-winder/
https://ebookname.com/product/couple-and-family-assessment-
contemporary-and-cutting-edge-strategies-3rd-edition-len-sperry/
Fitness for work the medical aspects Fifth Edition
Keith T Palmer
https://ebookname.com/product/fitness-for-work-the-medical-
aspects-fifth-edition-keith-t-palmer/
https://ebookname.com/product/growing-up-between-two-cultures-
issues-and-problems-of-muslim-children-1st-edition-farideh-
salili/
https://ebookname.com/product/project-risk-management-processes-
techniques-and-insights-2nd-edition-chris-chapman/
https://ebookname.com/product/therigatha-poems-of-the-first-
buddhist-women-1st-edition-charles-hallisey/
Inventing Money The Story of Long Term Capital
Management and the Legends Behind It 1st Edition
Nicholas Dunbar
https://ebookname.com/product/inventing-money-the-story-of-long-
term-capital-management-and-the-legends-behind-it-1st-edition-
nicholas-dunbar/
Apache Flume: Distributed
Log Collection for Hadoop
Second Edition
Steve Hoffman
BIRMINGHAM - MUMBAI
Apache Flume: Distributed Log Collection for Hadoop
Second Edition
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78439-217-8
www.packtpub.com
Credits
Reviewers Proofreader
Sachin Handiekar Simran Bhogal
Michael Keane Safis Editing
Stefan Will
Indexer
Commissioning Editor Rekha Nair
Dipika Gaonkar
Graphics
Acquisition Editor Sheetal Aute
Reshma Raman Abhinash Sahu
Copy Editors
Vikrant Phadke
Stuti Srivastava
About the Author
This is the first update to Steve's first book, Apache Flume: Distributed Log Collection
for Hadoop, Packt Publishing.
Sachin has a lot of interest in open source projects. He has contributed code to Apache
Camel and developed plugins for Spring Social, which can be found at GitHub
(https://github.com/sachin-handiekar).
Michael is a father of three, and besides work, he spends most of his time with his
family and coaching youth softball.
Stefan Will is a computer scientist with a degree in machine learning and pattern
recognition from the University of Bonn, Germany. For over a decade, he has worked
for several start-ups in Silicon Valley and Raleigh, North Carolina, in the area of search
and analytics. Presently, he leads the development of the search backend and real-time
analytics platform at Zendesk, a provider of customer service software.
www.PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at service@packtpub.com for more details.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
Compression codecs 43
Event Serializers 44
Text output 44
Text with headers 44
Apache Avro 45
User-provided Avro schema 46
File type 47
SequenceFile 47
DataStream 48
CompressedStream 48
Timeouts and workers 48
Sink groups 49
Load balancing 50
Failover 51
MorphlineSolrSink 52
Morphline configuration files 53
Typical SolrSink configuration 54
Sink configuration 56
ElasticSearchSink 57
LogStash Serializer 60
Dynamic Serializer 61
Summary 61
Chapter 5: Sources and Channel Selectors 63
The problem with using tail 63
The Exec source 65
Spooling Directory Source 67
Syslog sources 71
The syslog UDP source 72
The syslog TCP source 73
The multiport syslog TCP source 74
JMS source 77
Channel selectors 80
Replicating 80
Multiplexing 81
Summary 81
Chapter 6: Interceptors, ETL, and Routing 83
Interceptors 83
Timestamp 84
Host 85
Static 85
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Preface
Hadoop is a great open source tool for shifting tons of unstructured data into
something manageable so that your business can gain better insight into your
customers' needs. It's cheap (mostly free), scales horizontally as long as you have
space and power in your datacenter, and can handle problems that would crush your
traditional data warehouse. That said, a little-known secret is that your Hadoop cluster
requires you to feed it data. Otherwise, you just have a very expensive heat generator!
You will quickly realize (once you get past the "playing around" phase with Hadoop)
that you will need a tool to automatically feed data into your cluster. In the past, you
had to come up with a solution for this problem, but no more! Flume was started as a
project out of Cloudera, when its integration engineers had to keep writing tools over
and over again for their customers to automatically import data. Today, the project
lives with the Apache Foundation, is under active development, and boasts of users
who have been using it in their production environments for years.
In this book, I hope to get you up and running quickly with an architectural overview
of Flume and a quick-start guide. After that, we'll dive deep into the details of many of
the more useful Flume components, including the very important file channel for the
persistence of in-flight data records and the HDFS Sink for buffering and writing
data into HDFS (the Hadoop File System). Since Flume comes with a wide variety
of modules, chances are that the only tool you'll need to get started is a text editor
for the configuration file.
By the time you reach the end of this book, you should know enough to build a highly
available, fault-tolerant, streaming data pipeline that feeds your Hadoop cluster.
Chapter 2, A Quick Start Guide to Flume, serves to get you up and running quickly. It
includes downloading Flume, creating a "Hello, World!" configuration, and running it.
Chapter 3, Channels, covers the two major channels most people will use and the
configuration options available for each of them.
Chapter 4, Sinks and Sink Processors, goes into great detail on using the HDFS Flume
output, including compression options and options for formatting the data. Failover
options are also covered so that you can create a more robust data pipeline.
Chapter 5, Sources and Channel Selectors, introduces several of the Flume input
mechanisms and their configuration options. Also covered is switching between
different channels based on data content, which allows the creation of complex
data flows.
Chapter 6, Interceptors, ETL, and Routing, explains how to transform data in-flight
as well as extract information from the payload to use with Channel Selectors to
make routing decisions. Then this chapter covers tiering Flume agents using Avro
serialization, as well as using the Flume command line as a standalone Avro client
for testing and importing data manually.
Chapter 7, Putting It All Together, walks you through the details of an end-to-end use
case from the web server logs to a searchable UI, backed by Elasticsearch as well as
archival storage in HDFS.
Chapter 8, Monitoring Flume, discusses various options available for monitoring Flume
both internally and externally, including Monit, Nagios, Ganglia, and custom hooks.
You will also need an Internet connection so that you can download Flume to run
the Quick Start example.
[2]
Preface
Finally, you'll need your favorite text editor, since most of this book covers how
to configure various Flume components via an agent's text configuration file.
Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and
explanations of their meanings.
Code words in text are shown as follows: "If you want to use this feature, you set
the useDualCheckpoints property to true and specify a location for that second
checkpoint directory with the backupCheckpointDir property."
[3]
Preface
New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes for example, appear in the text like this: "Flume was
first introduced in Cloudera's CDH3 distribution in 2011."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for
us to develop titles that you really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.
[4]
Preface
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text
or the code—we would be grateful if you would report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the errata submission form link,
and entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded on our website, or added to any list of
existing errata, under the Errata section of that title. Any existing errata can be viewed
by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we
can pursue a remedy.
We appreciate your help in protecting our authors, and our ability to bring
you valuable content.
Questions
You can contact us at questions@packtpub.com if you are having a problem
with any aspect of the book, and we will do our best to address it.
[5]
Overview and Architecture
If you are reading this book, chances are you are swimming in oceans of data. Creating
mountains of data has become very easy, thanks to Facebook, Twitter, Amazon, digital
cameras and camera phones, YouTube, Google, and just about anything else you can
think of being connected to the Internet. As a provider of a website, 10 years ago, your
application logs were only used to help you troubleshoot your website. Today, this
same data can provide a valuable insight into your business and customers if you
know how to pan gold out of your river of data.
Furthermore, as you are reading this book, you are also aware that Hadoop was
created to solve (partially) the problem of sifting through mountains of data. Of
course, this only works if you can reliably load your Hadoop cluster with data for
your data scientists to pick apart.
Getting data into and out of Hadoop (in this case, the Hadoop File System, or
HDFS) isn't hard; it is just a simple command, such as:
% hadoop fs --put data.csv .
This works great when you have all your data neatly packaged and ready to upload.
However, your website is creating data all the time. How often should you batch
load data to HDFS? Daily? Hourly? Whatever processing period you choose,
eventually somebody always asks "can you get me the data sooner?" What you
really need is a solution that can deal with streaming logs/data.
Turns out you aren't alone in this need. Cloudera, a provider of professional services
for Hadoop as well as their own distribution of Hadoop, saw this need over and over
when working with their customers. Flume was created to fill this need and create a
standard, simple, robust, flexible, and extensible tool for data ingestion into Hadoop.
Overview and Architecture
Flume 0.9
Flume was first introduced in Cloudera's CDH3 distribution in 2011. It consisted
of a federation of worker daemons (agents) configured from a centralized master
(or masters) via Zookeeper (a federated configuration and coordination system).
From the master, you could check the agent status in a web UI as well as push
out configuration centrally from the UI or via a command-line shell (both really
communicating via Zookeeper to the worker agents).
Data could be sent in one of three modes: Best effort (BE), Disk Failover (DFO), and
End-to-End (E2E). The masters were used for the E2E mode acknowledgements and
multimaster configuration never really matured, so you usually only had one master,
making it a central point of failure for E2E data flows. The BE mode is just what it
sounds like: the agent would try to send the data, but if it couldn't, the data would
be discarded. This mode is good for things such as metrics, where gaps can easily be
tolerated, as new data is just a second away. The DFO mode stores undeliverable data
to the local disk (or sometimes, a local database) and would keep retrying until the
data could be delivered to the next recipient in your data flow. This is handy for those
planned (or unplanned) outages, as long as you have sufficient local disk space to
buffer the load.
In June, 2011, Cloudera moved control of the Flume project to the Apache Foundation.
It came out of the incubator status a year later in 2012. During the incubation year,
work had already begun to refactor Flume under the Star-Trek-themed tag, Flume-NG
(Flume the Next Generation).
The most obvious change in Flume 1.X is that the centralized configuration master(s)
and Zookeeper are gone. The configuration in Flume 0.9 was overly verbose, and
mistakes were easy to make. Furthermore, centralized configuration was really outside
the scope of Flume's goals. Centralized configuration was replaced with a simple on-
disk configuration file (although the configuration provider is pluggable so that it
can be replaced). These configuration files are easily distributed using tools such as
cf-engine, Chef, and Puppet. If you are using a Cloudera distribution, take a look at
Cloudera Manager to manage your configurations. About two years ago, they created
a free version with no node limit, so it may be an attractive option for you. Just be
sure you don't manage these configurations manually, or you'll be editing these files
manually forever.
[8]
Chapter 1
Another major difference in Flume 1.X is that the reading of input data and the
writing of output data are now handled by different worker threads (called
Runners). In Flume 0.9, the input thread also did the writing to the output (except
for failover retries). If the output writer was slow (rather than just failing outright),
it would block Flume's ability to ingest data. This new asynchronous design leaves
the input thread blissfully unaware of any downstream problem.
The first edition of this book covered all the versions of Flume up till Version 1.3.1.
This second edition will cover till Version 1.5.2 (the current version at the time of
writing this).
In a regular POSIX-style filesystem, if you open a file and write data, it still exists
on the disk before the file is closed. That is, if another program opens the same
file and starts reading, it will get the data already flushed by the writer to the disk.
Furthermore, if this writing process is interrupted, any portion that made it to disk
is usable (it may be incomplete, but it exists).
In HDFS, the file exists only as a directory entry; it shows zero length until the file
is closed. This means that if data is written to a file for an extended period without
closing it, a network disconnect with the client will leave you with nothing but an
empty file for all your efforts. This may lead you to the conclusion that it would be
wise to write small files so that you can close them as soon as possible.
The problem is that Hadoop doesn't like lots of tiny files. As the HDFS filesystem
metadata is kept in memory on the NameNode, the more files you create, the more
RAM you'll need to use. From a MapReduce prospective, tiny files lead to poor
efficiency. Usually, each Mapper is assigned a single block of a file as the input
(unless you have used certain compression codecs). If you have lots of tiny files,
the cost of starting the worker processes can be disproportionally high compared
to the data it is processing. This kind of block fragmentation also results in more
Mapper tasks, increasing the overall job run times.
[9]
Overview and Architecture
These factors need to be weighed when determining the rotation period to use when
writing to HDFS. If the plan is to keep the data around for a short time, then you can
lean toward the smaller file size. However, if you plan on keeping the data for a very
long time, you can either target larger files or do some periodic cleanup to compact
smaller files into fewer, larger files to make them more MapReduce friendly. After
all, you only ingest the data once, but you might run a MapReduce job on that data
hundreds or thousands of times.
Keep in mind:
• A source writes events to one or more channels.
• A channel is the holding area as events are passed from a
source to a sink.
• A sink receives events from one channel only.
• An agent can have many channels.
Flume events
The basic payload of data transported by Flume is called an event. An event is
composed of zero or more headers and a body.
[ 10 ]
Chapter 1
The headers are key/value pairs that can be used to make routing decisions or
carry other structured information (such as the timestamp of the event or the
hostname of the server from which the event originated). You can think of it as
serving the same function as HTTP headers—a way to pass additional information
that is distinct from the body.
The body is an array of bytes that contains the actual payload. If your input is
comprised of tailed log files, the array is most likely a UTF-8-encoded string
containing a line of text.
Flume may add additional headers automatically (like when a source adds the
hostname where the data is sourced or creating an event's timestamp), but the
body is mostly untouched unless you edit it en route using interceptors.
[ 11 ]
Overview and Architecture
Channel selectors are responsible for how data moves from a source to one or more
channels. Flume comes packaged with two channel selectors that cover most use
cases you might have, although you can write your own if need be. A replicating
channel selector (the default) simply puts a copy of the event into each channel,
assuming you have configured more than one. In contrast, a multiplexing channel
selector can write to different channels depending on some header information.
Combined with some interceptor logic, this duo forms the foundation for routing
input to different channels.
Finally, a sink processor is the mechanism by which you can create failover paths for
your sinks or load balance events across multiple sinks from a channel.
In the following diagram, you can see that there are two places where data is
created (on the left-hand side) and two final destinations for the data (the HDFS
and ElasticSearch cloud bubbles on the right-hand side). To make things more
interesting, let's say one of the machines generates two kinds of data (let's call
them square and triangle data). You can see that in the lower-left agent, we use a
multiplexing channel selector to split the two kinds of data into different channels.
The rectangle channel is then routed to the agent in the upper-right corner (along
with the data coming from the upper-left agent). The combined volume of events
is written together in HDFS in Datacenter 1. Meanwhile, the triangle data is sent
to the agent that writes to ElasticSearch in Datacenter 2. Keep in mind that data
transformations can occur after any source. How all of these components can be
used to build complicated data workflows will be become clear as we proceed.
[ 12 ]
Chapter 1
If you are a fan of pipelining Unix commands, this will be very familiar to you.
The commands themselves are intended to be small, single-purpose functions that
when chained together create powerful logic. In many ways, using a Morphline
command chain can be identical in functionality to the interceptor paradigm just
mentioned. There is a Morphline interceptor we will cover in Chapter 6, Interceptors,
ETL, and Routing, which you can use instead of, or in addition to, the included
Java-based interceptors.
To get an idea of how useful these commands can be, take a look
at the handy grok command and its included extensible regular
expression library at https://github.com/kite-sdk/kite/
blob/master/kite-morphlines/kite-morphlines-core/
src/test/resources/grok-dictionaries/grok-patterns
[ 13 ]
Overview and Architecture
Many of the custom Java interceptors that I've written in the past were to modify
the body (data) and can easily be replaced with an out-of-the-box Morphline
command chain. You can get familiar with the Morphline commands by checking
out their reference guide at http://kitesdk.org/docs/current/kite-
morphlines/morphlinesReferenceGuide.html
Flume Version 1.4 also includes a Morphline-backed sink used primarily to feed
data into Solr. We'll see more of this in Chapter 4, Sinks and Sink Processors,
Morphline Solr Search Sink.
Morphlines are just one component of the KiteSDK included in Flume. Starting
with Version 1.5, Flume has added experimental support for KiteData, which is an
effort to create a standard library for datasets in Hadoop. It looks very promising,
but it is outside the scope of this book.
Please see the project home page for more information, as it will
certainly become more prominent in the Hadoop ecosystem as
the technology matures. You can read all about the KiteSDK at
http://kitesdk.org.
Summary
In this chapter, we discussed the problem that Flume is attempting to solve: getting
data into your Hadoop cluster for data processing in an easily configured, reliable
way. We also discussed the Flume agent and its logical components, including
events, sources, channel selectors, channels, sink processors, and sinks. Finally, we
briefly discussed Morphlines as a powerful new ETL (Extract, Transform, Load)
library, starting with Version 1.4 of Flume.
The next chapter will cover these in more detail, specifically, the most commonly
used implementations of each. Like all good open source projects, almost all of these
components are extensible if the bundled ones don't do what you need them to do.
[ 14 ]
Exploring the Variety of Random
Documents with Different Content
having something about me that interests most people at first sight in my favour?
In a letter to Mrs. Thrale, Johnson once wrote: “It has become so much
the fashion to publish letters that in order to avoid it, I put as little into mine
as I can.” Boswell was not afraid of publication. His fear, as he said, was
that letters, like sermons, would not continue to attract public curiosity, so
he spiced his highly. Did he do or say a foolish thing, he at once sat down
and told Temple all about it, usually adding that in the near future he
intended to amend. His comment on his contemporaries is characteristic.
“Hume,” he says, “told me that he would give me half-a-crown for every
page of Johnson’s Dictionary in which he could not find an absurdity, if I
would give him half-a-crown for every page in which he could find one.”
He announces Adam Smith’s election to membership in the famous
literary club by saying: “Smith is now of our club—it has lost its select
merit.” Of Gibbon he says: “I hear nothing of the publication of his second
volume. He is an ugly, affected, disgusting fellow, and poisons our literary
club to me.”
As he grows older and considers how unsuccessful his life has been, how
he had failed at the bar both in Scotland and in London, he begins to
complain. He can get no clients; he fears that, even were he entrusted with
cases, he would fail utterly.
I am afraid [he says], that, were I to be tried, I should be found so deficient in the
forms, the quirks and the quiddities, which early habit acquires, that I should expose
myself. Yet the delusion of Westminster Hall, of brilliant reputation and splendid fortune as
a barrister, still weighs upon my imagination. I must be seen in the Courts, and must hope
for some happy openings in causes of importance. The Chancellor, as you observe, has not
done as I expected; but why did I expect it? I am going to put him to the test. Could I be
satisfied with being Baron of Auchinleck, with a good income for a gentleman in Scotland,
I might, no doubt, be independent. What can be done to deaden the ambition which has
ever raged in my veins like a fever?
But the highest spirits will sometimes flag. Boswell, the friendly,
obliging, generous roué, was getting old. He begins to speak of the past.
Do you remember when you and I sat up all night at Cambridge, and read Gray with a
noble enthusiasm; when we first used to read Mason’s “Elfrida,” and when we talked of
that elegant knot of worthies, Gray, Mason and Walpole?
His wife dies and Johnson dies. One by one the props are pulled from
under him; he drinks, constantly gets drunk; is, in this condition, knocked
down in the streets and robbed, and thinks with horror of giving up his soul,
intoxicated, to his Maker. “Oh, Temple, Temple!” he writes, “is this
realizing any of the towering hopes which have so often been the subject of
our conversation and letters?” At last he begins a letter which he is never to
finish. “I would fain write you in my own hand but really cannot.” These
were the last words poor Boswell ever wrote.
On another occasion:—
When I rode out I was mounted on Paoli’s own horse, with rich furniture of crimson
velvet, with broad gold lace, and had my guard marching along with me. I allowed myself
to indulge a momentary pride in this parade, as I was curious to experience what should
really be the pleasure of state and distinction with which mankind are so strangely
intoxicated.
The success of “Corsica” was not very great, but it sufficed to turn
Boswell’s head completely. He spent as much time in London as he could
contrive to, and led there the life of a dissipated man of fashion. He
quarreled with his father, and after a series of escapades with women of the
town and love-affairs with heiresses, he finally married his cousin, Margaret
Montgomerie, a girl without a fortune. Much to Boswell’s disgust, his
father, on the very same day, married for the second time, and married his
cousin.
For a time after marriage he seemed to take his profession seriously, but
he deceived neither his father nor his clients. The old man said that Jamie
was simply taking a toot on a new horn. Meanwhile Boswell never allowed
his interest in Johnson to cool for a moment. When he was in London,—and
he went there on one excuse or another as often as his means permitted,—
he was much with Johnson; and when he was at home, he was constantly
worrying Johnson for some evidence of his affection for him. Finally
Johnson writes, “My regard for you is greater almost than I have words to
express” (this from the maker of a dictionary); “but I do not chuse to be
always repeating it; write it down in the first leaf of your pocketbook, and
never doubt of it again.”
Neither wife nor father could understand the feeling of reverence and
affection which their Jamie had for Johnson. I always delight in the story of
his father saying to an old friend, “There’s nae hope for Jamie, mon. Jamie
is gaen clean gyte. What do you think, mon? He’s done wi’ Paoli—he’s off
wi’ the land-louping scoundrel of a Corsican; and whose tail do you think
he has pinned himself to now, mon? A dominie, mon—an auld dominie: he
keeped a schule, and ca’d it an academy.”
Mrs. Boswell, a sensible, cold, rather shadowy person, saw but little of
Johnson, and was satisfied that it should be so. There is one good story to
her credit. Unaccustomed to the ways of genius, she caught Johnson, who
was nearsighted, one evening burnishing a lighted candle on her carpet to
make it burn more brightly, and remarked, “I have seen many a bear led by
a man, but never before have I seen a man led by a bear.” Boswell was just
the fellow to appreciate this, and promptly repeated it to Johnson, who
failed to see the humor of it.
In 1782 his father died and he came into the estate, but by his
improvident management he soon found himself in financial difficulties.
Johnson’s death two years later removed a restraining influence that he
much needed. He tried to practice law, but he was unsuccessful. Never an
abstemious man, he now drank heavily and constantly, and as constantly
resolved to turn over a new leaf.
Shortly after Johnson’s death, Boswell published his “Journal of the Tour
of the Hebrides,” which reached a third edition within the year and
established his reputation as a writer of a new kind, in which anecdotes and
conversation are woven into a narrative with a fidelity and skill which were
as easy to him as they were impossible to others.
The great success of this book encouraged him to begin, and continue to
work upon, the great biography of Johnson on which his fame so securely
rests. Others had published before him. Mrs. Piozzi’s “Anecdotes of the
Late Samuel Johnson” had sold well, and Hawkins, the “unclubable
Knight,” as Johnson called him, had been commissioned by the booksellers
of London to write a formal biography, which appeared in 1787; while of
lesser publications there was seemingly no end; nevertheless, Boswell
persevered, and wrote his friend Temple that his
mode of biography which gives not only a history of Johnson’s visible progress through the
world, and of his publications, but a view of his mind in his letters and conversations, is the
most perfect that can be conceived, and will be more of a life than any work that has yet
appeared.
He had been preparing for the task for more than twenty years; he had, in
season and out, been taking notes of Johnson’s conversations, and Johnson
himself had supplied him with much of the material. Thus in poverty,
interrupted by periods of dissipation, amid the sneers of many, he continued
his work. While it was in progress his wife died, and he, poor fellow, justly
upbraided himself for his neglect of her.
The great scholar Jowett confessed that he had read the book fifty times.
Carlyle said, “Boswell has given more pleasure than any other man of this
time, and perhaps, two or three excepted, has done the world greater
service.” Lowell refers to the “Life” as a perfect granary of discussion and
conversation. Leslie Stephen says that his fondness for reading began and
would end with Boswell’s “Life of Johnson.” Robert Louis Stevenson
wrote: “I am taking a little of Boswell daily by way of a Bible. I mean to
read him now until the day I die.” It is one of the few classics which is not
merely talked about and taken as read, but is constantly being read; and I
love to think that perhaps not a day goes by when some one, somewhere,
does not open the book for the first time and become a confirmed
Boswellian.
“What a wonderful thing your English literature is!” a learned Hungarian
once said to me. “You have the greatest drama, the greatest poetry, and the
greatest fiction in the world, and you are the only nation that has any
biography.” The great English epic is Boswell’s “Life of Johnson.”
VII
A LIGHT-BLUE STOCKING
SOMETIME, when seated in your library, as it becomes too dark to read and
is yet too light,—to ring for candles, I was going to say, but nowadays we
simply touch a button,—let your thoughts wander over the long list of
women who have made for themselves a place in English literature, and see
if you do not agree with me that the woman you would like most to meet in
the flesh, were it possible, would be Mrs. Piozzi, born Hester Lynch
Salusbury, but best known to us as Mrs. Thrale.
Let us argue the matter. It may at first seem almost absurd to mention the
wife of the successful London brewer, Henry Thrale, in a list which would
include the names of Fanny Burney, Jane Austen, George Eliot, the Brontës,
and Mrs. Browning; but the woman I have in mind should unite feminine
charm with literary gifts: she should be a woman whom you would honestly
enjoy meeting and whom you would be glad to find yourself seated next to
at dinner.
The men of the Johnsonian circle affected to love “little Burney,” but
was it not for the pleasure her “Evelina” gave them rather than for anything
in the author herself? According to her own account, she was so easily
embarrassed as to be always “retiring in confusion,” or “on the verge of
swooning.” It is possible that we would find this rather limp young lady a
trifle tiresome.
Jane Austen was actually as shy and retiring as Fanny Burney affected to
be. She could hardly have presided gracefully in a drawing-room in a
cathedral city; much less would she have been at home among the wits in a
salon in London.
Of George Eliot one would be inclined to say, as Dr. Johnson said of
Burke when he was ill, “If I should meet Burke now it would kill me.”
Perhaps it would not kill one to meet George Eliot, but I suspect few men
would care for an hour’s tête-à-tête with her without a preliminary oiling of
their mental machinery—a hateful task.
The Brontës were geniuses undoubtedly, particularly Emily, but one
would hardly select the author of “Wuthering Heights” as a companion for a
social evening.
Mrs. Browning, with her placid smile and tiresome ringlets, was too
deeply in love with her husband. After all, the woman one enjoys meeting
must be something of a woman of the world. She need not necessarily be a
good wife or mother. We are provided with the best of wives and at the
moment are not on the lookout for a good mother.
It may at once be admitted that as a mother Mrs. Thrale was not a
conspicuous success; but she was a woman of charm, with a sound mind in
a sound body. Although she could be brilliant in conversation, she would let
you take the lead if you were able to; but she was quite prepared to take it
herself rather than let the conversation flag; and she must have been a very
exceptional woman, to steady, as she did, a somewhat roving husband, to
call Dr. Johnson to order, and upon occasion to reprove Burke, even while
entertaining the most brilliant society of which London at the period could
boast.
At the time when we first make her acquaintance, she was young and
pretty, the mistress of a luxurious establishment; and if she was not
possessed of literary gifts herself, it may fairly be said that she was the
cause of literature in others.
In these days, when women, having everything else, want the vote also
(and I would give it to them promptly and end the discussion), it may be
suggested that to shine by a reflected light is to shine not at all. Frankly,
Mrs. Thrale owes her position in English letters, not to anything important
that she herself did or was capable of doing, but to the eminence of those
she gathered about her. But her position is not the less secure; she was a
charming and fluffy person; and as firmly as I believe that women have
come to stay, so firmly am I of the opinion that, in spite of all the well-
meaning efforts of some of their sex to prevent it, a certain, and, thank God,
sufficient number of women will stay charming and fluffy to the end of the
chapter.
On one subject only could Mrs. Thrale be tedious—her pedigree. I have
it before me, written in her own bold hand, and I confess that it seems very
exalted indeed. She would not have been herself had she not stopped in
transcribing it to relate how one of her ancestors, Katherine Tudor de
Berayne, cousin and ward of Queen Elizabeth and a famous heiress, as she
was returning from the grave of her first husband, Sir John Salusbury, was
asked in marriage by Maurice Wynne of Gwydir, who was amazed to learn
that he was too late, as she had already engaged herself to Sir Richard
Clough. “But,” added the lady, “if in the providence of God I am
unfortunate enough to survive him, I consent to be the lady of Gwydir.” Nor
does the tale end here, for she married yet another, and having sons by all
four husbands, she came to be called “Mam y Cymry,”—Mother of Wales,
—and no doubt she deserved the appellation.
With such marrying blood in her veins it is easily understood that, as
soon as Thrale’s halter was off her neck,—this sporting phrase, I regret to
say, is Dr. Johnson’s,—she should think of marrying again; and that having
the first time married to please her family, she should, at the second
venture, marry to please herself. But this chapter is moving too rapidly—the
lady is not yet born.
Hester Lynch Salusbury’s birthplace was Bodvel, in Wales, and the year,
1741. She was an only child, very precocious, with a retentive memory. She
soon became the plaything of the elderly people around her, who called her
“Fiddle.” Her father had the reputation of being a scamp, and it fell to her
uncle’s lot to direct, somewhat, her education. Handed from one relation to
another, she quickly adapted herself to her surroundings. Her mother taught
her French; a tutor, Latin; Quin, the actor, taught her to recite; Hogarth
painted her portrait; and the grooms of her grandmother, whom she visited
occasionally, made her an accomplished horsewoman. In those days
education for a woman was highly irregular, but judging from the results in
the case of Mrs. Thrale and her friends, who shall say that it was
ineffective? We have no Elizabeth Carters nowadays, good at translating
Epictetus, and—we have it on high authority—better at making a pudding.
Study soon became little Hester’s delight. At twelve years she wrote for
the newspapers; also, she used to rise at four in the morning to study, which
her mother would not have allowed had she known of it. I have a letter
written many years afterwards in which she says: “My mother always told
me I ruined my Figure and stopt my Growth by sitting too long at a Writing
Desk, though ignorant how much Time I spent at it. Dear Madam, was my
saucy Answer,—
She is quoting Dr. Watts from memory evidently, and improving, perhaps,
upon the original.
But little girls grow up and husbands must be found for them. Henry
Thrale, the son of a rich Southwark brewer, was brought forward by her
uncle; while her father, protesting that he would not have his only child
exchanged for a barrel of “bitter,” fell into a rage and died of an apoplexy.
Her dot was provided by the uncle; her mother did the courting, with little
opposition on the part of the lady and no enthusiasm on the part of the
suitor. So, without love on either side, she being twenty-two and her
husband thirty-five, she became Mrs. Thrale. “My uncle,” she records in her
journal, “went with us to the church, gave me away, dined with us at
Streatham after the ceremony, and then left me to conciliate as best I could
a husband who had never thrown away five minutes of his time upon me
unwitnessed by company till after the wedding day was done.”
More happiness came from this marriage than might have been expected.
Henry Thrale, besides his suburban residence, Streatham, had two other
establishments, one adjoining the brewery in Southwark, where he lived in
winter, and another, an unpretentious villa at the seaside. He also
maintained a stable of horses and a pack of hounds at Croydon; but,
although a good horsewoman, Mrs. Thrale was not permitted to join her
husband in his equestrian diversions; indeed, her place in her husband’s
establishment was not unlike that of a woman in a seraglio. She was
allowed few pleasures, and but one duty was impressed upon her, namely,
that of supplying an heir to the estate; to this duty she devoted herself
unremittingly.
In due time a child was born, a daughter; and while this was of course
recognized as a mistake, it was believed to be one which could be corrected.
Meanwhile Thrale was surprised to find that his wife could think and
talk—that she had a mind of her own. The discovery dawned slowly upon
him, as did the idea that the pleasure of living in the country may be
enhanced by hospitality. Finally the doors of Streatham Park were thrown
open. For a time her husband’s bachelor friends and companions were the
only company. Included among these was one Arthur Murphy, who had
been un maître de plaisir to Henry Thrale in the gay days before his
marriage, when they had frequented the green rooms and Ranelagh
together. It was Murphy who suggested that “Dictionary Johnson” might be
secured to enliven a dinner-party, and then followed some discussion as to
the excuse which should be given Johnson for inviting him to the table of
the rich brewer. It was finally suggested that he be invited to meet a minor
celebrity, James Woodhouse, the shoemaker poet.
Johnson rose to the bait,—Johnson rose easily to any bait which would
provide him a good dinner and lift him out of himself,—and the dinner
passed off successfully. Mrs. Thrale records that they all liked each other so
well that a dinner was arranged for the following week, without the
shoemaker, who, having served his purpose, disappears from the record.
And now, and for twenty years thereafter, we find Johnson enjoying the
hospitality of the Thrales, which opened for him a new world. When he was
taken ill, not long after the introduction, Mrs. Thrale called on him in his
stuffy lodgings in a court off Fleet Street, and suggested that the air of
Streatham would be good for him. Would he come to them? He would. He
was not the man to deny himself the care of a young, rich, and charming
woman, who would feed him well, understand him, and add to the joys of
conversation. From that time on, whether at their residence in Deadman’s
Place in Southwark, or at Streatham, or at Brighton, even on their journeys,
the Thrales and Johnson were constantly together; and when he went on a
journey alone, as was sometimes the case, he wrote long letters to his
mistress or his master, as he affectionately called his friends.
Who gained most by this intercourse? It would be hard to say. It is a fit
subject for a debate, a copy of Boswell’s “Life of Johnson” to go to the
successful contestant. Johnson summed up his obligations to the lady in the
famous letter written just before her second marriage, probably the last he
ever wrote her. “I wish that God may grant you every blessing, that you
may be happy in this world ... and eternally happy in a better state; and
whatever I can contribute to your happiness I am ready to repay for that
kindness which soothed twenty years of a life radically wretched.”
On the other hand, the Thrales secured what, perhaps unconsciously,
they most desired, social position and distinction. At Streatham they
entertained the best, if not perhaps the very highest, society of the time.
Think for a moment of the intimates of this house, whose portraits, painted
by Reynolds, hung in the library. There were my Lords Sandys and
Westcote, college friends of Thrale; there were Johnson and Goldsmith;
Garrick and Burke; Burney, and Reynolds himself, and a number of others,
all from the brush of the great master; and could we hear the voices which
from time to time might have been heard in the famous room, we should
recognize Boswell and Piozzi, Baretti, and a host of others; and would it be
necessary for the servant to announce the entrance of the great Mrs.
Siddons, or Mrs. Garrick, or Fanny Burney, or Hannah More, or Mrs.
Montagu, or any of the other ladies who later formed that famous coterie
which came to be known as the Blue-Stockings?
But Johnson was the Thrales’ first lion and remained their greatest. He
first gave Streatham parties distinction. The master of the house enjoyed
having the wits about him, but was not one himself. Johnson said of him
that “his mind struck the hours very regularly but did not mark the
minutes.” It was his wife who, by her sprightliness and her wit and
readiness, kept the ball rolling, showing infinite tact and skill in drawing
out one and, when necessary, repressing another; asking—when the Doctor
was not speaking—for a flash of silence from the company that a newcomer
might be heard.
But I am anticipating. All this was not yet. A salon such as she created at
Streatham Park is not the work of a month or of a year.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com