Published site at d5aaeee88b331e064830a2774f4fed238631457c.
[hbase-site.git] / cygwin.html
1 <!DOCTYPE html>
2 <!--
3 | Generated by Apache Maven Doxia Site Renderer 1.6
4 | Rendered using Apache Maven Fluido Skin 1.5-HBASE
5 -->
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <meta charset="UTF-8" />
9 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10 <meta name="Date-Revision-yyyymmdd" content="20180311" />
11 <meta http-equiv="Content-Language" content="en" />
12 <title>Apache HBase &#x2013; Installing Apache HBase (TM) on Windows using Cygwin</title>
13 <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
14 <link rel="stylesheet" href="./css/site.css" />
15 <link rel="stylesheet" href="./css/print.css" media="print" />
16
17
18 <script type="text/javascript" src="./js/apache-maven-fluido-1.5-HBASE.min.js"></script>
19
20
21
22 <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
23
24
25 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css"/>
26
27
28 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css"/>
29
30
31 <link rel="stylesheet" href="css/site.css"/>
32
33
34 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script>
35
36 </head>
37 <body class="topBarEnabled">
38
39
40
41
42
43 <div id="topbar" class="navbar navbar-fixed-top ">
44 <div class="navbar-inner">
45 <div class="container">
46 <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
47 <span class="icon-bar"></span>
48 <span class="icon-bar"></span>
49 <span class="icon-bar"></span>
50 </a>
51 <div class="nav-collapse">
52
53 <ul class="nav">
54 <li class="dropdown">
55 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache HBase Project <b class="caret"></b></a>
56 <ul class="dropdown-menu">
57
58 <li> <a href="index.html" title="Overview">Overview</a>
59 </li>
60
61 <li> <a href="license.html" title="License">License</a>
62 </li>
63
64 <li> <a href="http://www.apache.org/dyn/closer.cgi/hbase/" title="Downloads">Downloads</a>
65 </li>
66
67 <li> <a href="https://issues.apache.org/jira/browse/HBASE?report=com.atlassian.jira.plugin.system.project:changelog-panel#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel" title="Release Notes">Release Notes</a>
68 </li>
69
70 <li> <a href="coc.html" title="Code Of Conduct">Code Of Conduct</a>
71 </li>
72
73 <li> <a href="http://blogs.apache.org/hbase/" title="Blog">Blog</a>
74 </li>
75
76 <li> <a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
77 </li>
78
79 <li> <a href="team-list.html" title="Team">Team</a>
80 </li>
81
82 <li> <a href="https://reviews.apache.org/" title="ReviewBoard">ReviewBoard</a>
83 </li>
84
85 <li> <a href="sponsors.html" title="Thanks">Thanks</a>
86 </li>
87
88 <li> <a href="poweredbyhbase.html" title="Powered by HBase">Powered by HBase</a>
89 </li>
90
91 <li> <a href="resources.html" title="Other resources">Other resources</a>
92 </li>
93 </ul>
94 </li>
95 <li class="dropdown">
96 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Information <b class="caret"></b></a>
97 <ul class="dropdown-menu">
98
99 <li> <a href="project-summary.html" title="Project Summary">Project Summary</a>
100 </li>
101
102 <li> <a href="dependency-info.html" title="Dependency Information">Dependency Information</a>
103 </li>
104
105 <li> <a href="team-list.html" title="Team">Team</a>
106 </li>
107
108 <li> <a href="source-repository.html" title="Source Repository">Source Repository</a>
109 </li>
110
111 <li> <a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
112 </li>
113
114 <li> <a href="dependency-management.html" title="Dependency Management">Dependency Management</a>
115 </li>
116
117 <li> <a href="dependencies.html" title="Dependencies">Dependencies</a>
118 </li>
119
120 <li> <a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a>
121 </li>
122
123 <li> <a href="integration.html" title="Continuous Integration">Continuous Integration</a>
124 </li>
125
126 <li> <a href="plugin-management.html" title="Plugin Management">Plugin Management</a>
127 </li>
128
129 <li> <a href="plugins.html" title="Plugins">Plugins</a>
130 </li>
131 </ul>
132 </li>
133 <li class="dropdown">
134 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation and API <b class="caret"></b></a>
135 <ul class="dropdown-menu">
136
137 <li> <a href="book.html" target="_blank" title="Reference Guide">Reference Guide</a>
138 </li>
139
140 <li> <a href="apache_hbase_reference_guide.pdf" target="_blank" title="Reference Guide (PDF)">Reference Guide (PDF)</a>
141 </li>
142
143 <li> <a href="book.html#quickstart" target="_blank" title="Getting Started">Getting Started</a>
144 </li>
145
146 <li> <a href="apidocs/index.html" target="_blank" title="User API">User API</a>
147 </li>
148
149 <li> <a href="testapidocs/index.html" target="_blank" title="User API (Test)">User API (Test)</a>
150 </li>
151
152 <li> <a href="devapidocs/index.html" target="_blank" title="Developer API">Developer API</a>
153 </li>
154
155 <li> <a href="testdevapidocs/index.html" target="_blank" title="Developer API (Test)">Developer API (Test)</a>
156 </li>
157
158 <li> <a href="http://abloz.com/hbase/book.html" target="_blank" title="中文参考指南(单页)">中文参考指南(单页)</a>
159 </li>
160
161 <li> <a href="book.html#faq" target="_blank" title="FAQ">FAQ</a>
162 </li>
163
164 <li> <a href="book.html#other.info" target="_blank" title="Videos/Presentations">Videos/Presentations</a>
165 </li>
166
167 <li> <a href="http://wiki.apache.org/hadoop/Hbase" target="_blank" title="Wiki">Wiki</a>
168 </li>
169
170 <li> <a href="acid-semantics.html" target="_blank" title="ACID Semantics">ACID Semantics</a>
171 </li>
172
173 <li> <a href="book.html#arch.bulk.load" target="_blank" title="Bulk Loads">Bulk Loads</a>
174 </li>
175
176 <li> <a href="metrics.html" target="_blank" title="Metrics">Metrics</a>
177 </li>
178
179 <li> <a href="cygwin.html" target="_blank" title="HBase on Windows">HBase on Windows</a>
180 </li>
181
182 <li> <a href="book.html#replication" target="_blank" title="Cluster replication">Cluster replication</a>
183 </li>
184
185 <li class="dropdown-submenu">
186 <a href="" title="1.2 Documentation">1.2 Documentation</a>
187 <ul class="dropdown-menu">
188 <li> <a href="1.2/apidocs/index.html" target="_blank" title="API">API</a>
189 </li>
190 <li> <a href="1.2/xref/index.html" target="_blank" title="X-Ref">X-Ref</a>
191 </li>
192 <li> <a href="1.2/book.html" target="_blank" title="Ref Guide (single-page)">Ref Guide (single-page)</a>
193 </li>
194 </ul>
195 </li>
196 </ul>
197 </li>
198 <li class="dropdown">
199 <a href="#" class="dropdown-toggle" data-toggle="dropdown">ASF <b class="caret"></b></a>
200 <ul class="dropdown-menu">
201
202 <li> <a href="http://www.apache.org/foundation/" target="_blank" title="Apache Software Foundation">Apache Software Foundation</a>
203 </li>
204
205 <li> <a href="http://www.apache.org/foundation/how-it-works.html" target="_blank" title="How Apache Works">How Apache Works</a>
206 </li>
207
208 <li> <a href="http://www.apache.org/foundation/sponsorship.html" target="_blank" title="Sponsoring Apache">Sponsoring Apache</a>
209 </li>
210 </ul>
211 </li>
212 </ul>
213
214 <div id="search-form" class="navbar-search pull-right">
215 <script type="text/javascript">
216 var cx = '000385458301414556862:sq1bb0xugjg';
217
218 (function() {
219 var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
220 gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cse.google.com/cse.js?cx=' + cx;
221 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
222 })();
223
224 </script>
225 <gcse:search></gcse:search>
226 </div>
227
228
229
230 </div>
231
232 </div>
233 </div>
234 </div>
235
236 <div class="container">
237 <div id="banner">
238 <div class="pull-left">
239 <a href="./" id="bannerLeft">
240 <img src="" alt=""/>
241 </a>
242 </div>
243 <div class="pull-right"> <a href="./" id="bannerRight">
244 <img src="images/hbase_logo_with_orca_large.png" alt="Apache HBase"/>
245 </a>
246 </div>
247 <div class="clear"><hr/></div>
248 </div>
249
250 <div id="breadcrumbs">
251 <ul class="breadcrumb">
252
253
254
255
256
257
258 </ul>
259 </div>
260
261
262
263 <div id="bodyColumn" >
264
265 <!-- Licensed to the Apache Software Foundation (ASF) under one
266 or more contributor license agreements. See the NOTICE file
267 distributed with this work for additional information
268 regarding copyright ownership. The ASF licenses this file
269 to you under the Apache License, Version 2.0 (the
270 "License"); you may not use this file except in compliance
271 with the License. You may obtain a copy of the License at
272
273 http://www.apache.org/licenses/LICENSE-2.0
274
275 Unless required by applicable law or agreed to in writing,
276 software distributed under the License is distributed on an
277 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
278 KIND, either express or implied. See the License for the
279 specific language governing permissions and limitations
280 under the License. -->
281
282 <div class="section">
283 <h2><a name="Introduction"></a>Introduction</h2>
284
285 <p><a class="externalLink" href="http://hbase.apache.org" target="_blank" title="HBase project">Apache HBase (TM)</a> is a distributed, column-oriented store, modeled after Google's <a class="externalLink" href="http://research.google.com/archive/bigtable.html" target="_blank" title="Google's BigTable">BigTable</a>. Apache HBase is built on top of <a class="externalLink" href="http://hadoop.apache.org" title="Hadoop project">Hadoop</a> for its <a class="externalLink" href="http://hadoop.apache.org/mapreduce" target="_blank" title="Hadoop MapReduce project">MapReduce </a>and <a class="externalLink" href="http://hadoop.apache.org/hdfs" title="Hadoop DFS project">distributed file system</a> implementation. All these projects are open-source and part of the <a class="externalLink" href="http://www.apache.org/" target="_blank" title="The Apache Software Foundation">Apache Software Foundation</a>.</p>
286
287
288 <p style="text-align: justify; ">As being distributed, large scale platforms, the Hadoop and HBase projects mainly focus on <i><b>*nix</b></i><b> environments</b> for production installations. However, being developed in <b>Java</b>, both projects are fully <b>portable</b> across platforms and, hence, also to the <b>Windows operating system</b>. For ease of development the projects rely on <a class="externalLink" href="http://www.cygwin.com/" target="_blank" title="Cygwin site">Cygwin</a> to have a *nix-like environment on Windows to run the shell scripts.</p>
289 </div>
290
291 <div class="section">
292 <h2><a name="Purpose"></a>Purpose</h2>
293
294 <p style="text-align: justify; ">This document explains the <b>intricacies of running Apache HBase on Windows using Cygwin</b> as an all-in-one single-node installation for testing and development. The HBase <a class="externalLink" href="http://hbase.apache.org/apidocs/overview-summary.html#overview_description" target="_blank" title="HBase Overview">Overview</a> and <a class="externalLink" href="http://hbase.apache.org/book/quickstart.html" target="_blank" title="HBase QuickStart">QuickStart</a> guides on the other hand go a long way in explaning how to setup <a class="externalLink" href="http://hadoop.apache.org/hbase" target="_blank" title="HBase project">HBase</a> in more complex deployment scenario's.</p>
295 </div>
296
297
298 <div class="section">
299 <h2><a name="Installation"></a>Installation</h2>
300
301 <p style="text-align: justify; ">For running Apache HBase on Windows, 3 technologies are required: <b>Java, Cygwin and SSH</b>. The following paragraphs detail the installation of each of the aforementioned technologies.</p>
302
303 <div class="section">
304 <h2><a name="Java"></a>Java</h2>
305
306 <p style="text-align: justify; ">HBase depends on the <a class="externalLink" href="http://java.sun.com/javase/6/" target="_blank" title="Java Platform, Standard Edition, 6 Release">Java Platform, Standard Edition, 6 Release</a>. So the target system has to be provided with at least the Java Runtime Environment (JRE); however if the system will also be used for development, the Jave Development Kit (JDK) is preferred. You can download the latest versions for both from <a class="externalLink" href="http://java.sun.com/javase/downloads/index.jsp" target="_blank" title="Java SE Downloads">Sun's download page</a>. Installation is a simple GUI wizard that guides you through the process.</p>
307 </div>
308
309 <div class="section">
310 <h2><a name="Cygwin"></a>Cygwin</h2>
311
312 <p style="text-align: justify; ">Cygwin is probably the oddest technology in this solution stack. It provides a dynamic link library that emulates most of a *nix environment on Windows. On top of that a whole bunch of the most common *nix tools are supplied. Combined, the DLL with the tools form a very *nix-alike environment on Windows.</p>
313
314
315 <p style="text-align: justify; ">For installation, Cygwin provides the <a class="externalLink" href="http://cygwin.com/setup.exe" target="_blank" title="Cygwin Setup Utility"><b><tt>setup.exe</tt> utility</b></a> that tracks the versions of all installed components on the target system and provides the mechanism for <b>installing</b> or <b>updating </b>everything from the mirror sites of Cygwin.</p>
316
317
318 <p style="text-align: justify; ">To support installation, the <tt>setup.exe</tt> utility uses 2 directories on the target system. The <b>Root</b> directory for Cygwin (defaults to <tt>C:\cygwin)</tt> which will become <tt>/</tt> within the eventual Cygwin installation; and the <b>Local Package </b>directory (e.g. <tt>C:\cygsetup</tt> that is the cache where <tt>setup.exe</tt> stores the packages before they are installed. The cache must not be the same folder as the Cygwin root.</p>
319
320
321 <p style="text-align: justify; ">Perform following steps to install Cygwin, which are elaboratly detailed in the <a class="externalLink" href="http://cygwin.com/cygwin-ug-net/setup-net.html" target="_self" title="Setting Up Cygwin">2nd chapter</a> of the <a class="externalLink" href="http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html" target="_blank" title="Cygwin User's Guide">Cygwin User's Guide</a>:</p>
322
323
324 <ol style="list-style-type: decimal">
325
326 <li>Make sure you have <tt>Administrator</tt> privileges on the target system.</li>
327
328 <li>Choose and create you <b>Root</b> and <b>Local Package</b> directories. A good suggestion is to use <tt>C:\cygwin\root</tt> and <tt>C:\cygwin\setup</tt> folders.</li>
329
330 <li>Download the <tt>setup.exe</tt> utility and save it to the <b>Local Package</b> directory.</li>
331
332 <li>Run the <tt>setup.exe</tt> utility,
333
334 <ol style="list-style-type: decimal">
335
336 <li>Choose the <tt>Install from Internet</tt> option,</li>
337
338 <li>Choose your <b>Root</b> and <b>Local Package</b> folders</li>
339
340 <li>and select an appropriate mirror.</li>
341
342 <li>Don't select any additional packages yet, as we only want to install Cygwin for now.</li>
343
344 <li>Wait for download and install</li>
345
346 <li>Finish the installation</li>
347 </ol>
348 </li>
349
350 <li>Optionally, you can now also add a shortcut to your Start menu pointing to the <tt>setup.exe</tt> utility in the <b>Local Package </b>folder.</li>
351
352 <li>Add <tt>CYGWIN_HOME</tt> system-wide environment variable that points to your <b>Root </b>directory.</li>
353
354 <li>Add <tt>%CYGWIN_HOME%\bin</tt> to the end of your <tt>PATH</tt> environment variable.</li>
355
356 <li>Reboot the sytem after making changes to the environment variables otherwise the OS will not be able to find the Cygwin utilities.</li>
357
358 <li>Test your installation by running your freshly created shortcuts or the <tt>Cygwin.bat</tt> command in the <b>Root</b> folder. You should end up in a terminal window that is running a <a class="externalLink" href="http://www.gnu.org/software/bash/manual/bashref.html" target="_blank" title="Bash Reference Manual">Bash shell</a>. Test the shell by issuing following commands:
359
360 <ol style="list-style-type: decimal">
361
362 <li><tt>cd /</tt> should take you to thr <b>Root</b> directory in Cygwin;</li>
363
364 <li>the <tt>LS</tt> commands that should list all files and folders in the current directory.</li>
365
366 <li>Use the <tt>exit</tt> command to end the terminal.</li>
367 </ol>
368 </li>
369
370 <li>When needed, to <b>uninstall</b> Cygwin you can simply delete the <b>Root</b> and <b>Local Package</b> directory, and the <b>shortcuts</b> that were created during installation.</li>
371 </ol>
372 </div>
373
374 <div class="section">
375 <h2><a name="SSH"></a>SSH</h2>
376
377 <p style="text-align: justify; ">HBase (and Hadoop) rely on <a class="externalLink" href="http://nl.wikipedia.org/wiki/Secure_Shell" target="_blank" title="Secure Shell"><b>SSH</b></a> for interprocess/-node <b>communication</b> and launching<b> remote commands</b>. SSH will be provisioned on the target system via Cygwin, which supports running Cygwin programs as <b>Windows services</b>!</p>
378
379
380 <ol style="list-style-type: decimal">
381
382 <li>Rerun the <tt><b>setup.exe</b></tt><b> utility</b>.</li>
383
384 <li>Leave all parameters as is, skipping through the wizard using the <tt>Next</tt> button until the <tt>Select Packages</tt> panel is shown.</li>
385
386 <li>Maximize the window and click the <tt>View</tt> button to toggle to the list view, which is ordered alfabetically on <tt>Package</tt>, making it easier to find the packages we'll need.</li>
387
388 <li>Select the following packages by clicking the status word (normally <tt>Skip</tt>) so it's marked for installation. Use the <tt>Next </tt>button to download and install the packages.
389
390 <ol style="list-style-type: decimal">
391
392 <li>OpenSSH</li>
393
394 <li>tcp_wrappers</li>
395
396 <li>diffutils</li>
397
398 <li>zlib</li>
399 </ol>
400 </li>
401
402 <li>Wait for the install to complete and finish the installation.</li>
403 </ol>
404 </div>
405
406 <div class="section">
407 <h2><a name="HBase"></a>HBase</h2>
408
409 <p style="text-align: justify; ">Download the <b>latest release </b>of Apache HBase from the <a class="externalLink" href="http://www.apache.org/dyn/closer.cgi/hbase/" target="_blank" title="HBase Releases">website</a>. As the Apache HBase distributable is just a zipped archive, installation is as simple as unpacking the archive so it ends up in its final <b>installation</b> directory. Notice that HBase has to be installed in Cygwin and a good directory suggestion is to use <tt>/usr/local/</tt> (or [<tt><b>Root</b> directory]\usr\local</tt> in Windows slang). You should end up with a <tt>/usr/local/hbase-<i>&lt;version&gt;</i></tt> installation in Cygwin.</p>
410
411 This finishes installation. We go on with the configuration.
412 </div>
413 </div>
414
415 <div class="section">
416 <h2><a name="Configuration"></a>Configuration</h2>
417
418 <p style="text-align: justify; ">There are 3 parts left to configure: <b>Java, SSH and HBase</b> itself. Following paragraphs explain eacht topic in detail.</p>
419
420 <div class="section">
421 <h2><a name="Java"></a>Java</h2>
422
423 <p style="text-align: justify; ">One important thing to remember in shell scripting in general (i.e. *nix and Windows) is that managing, manipulating and assembling path names that contains spaces can be very hard, due to the need to escape and quote those characters and strings. So we try to stay away from spaces in path names. *nix environments can help us out here very easily by using <b>symbolic links</b>.</p>
424
425
426 <ol style="list-style-type: decimal">
427
428 <li style="text-align: justify; ">Create a link in <tt>/usr/local</tt> to the Java home directory by using the following command and substituting the name of your chosen Java environment:
429
430 <div>
431 <pre>LN -s /cygdrive/c/Program\ Files/Java/<i>&lt;jre name&gt; </i>/usr/local/<i>&lt;jre name&gt;</i></pre></div>
432 </li>
433
434 <li>Test your java installation by changing directories to your Java folder <tt>CD /usr/local/<i>&lt;jre name&gt;</i></tt> and issueing the command <tt>./bin/java -version</tt>. This should output your version of the chosen JRE.</li>
435 </ol>
436 </div>
437
438 <div class="section">
439 <h2><a name="null"></a></h2>
440
441
442 <p style="text-align: justify; ">Configuring <b>SSH </b>is quite elaborate, but primarily a question of launching it by default as a<b> Windows service</b>.</p>
443
444
445 <ol style="list-style-type: decimal">
446
447 <li style="text-align: justify; ">On Windows Vista and above make sure you run the Cygwin shell with <b>elevated privileges</b>, by right-clicking on the shortcut an using <tt>Run as Administrator</tt>.</li>
448
449 <li style="text-align: justify; ">First of all, we have to make sure the <b>rights on some crucial files</b> are correct. Use the commands underneath. You can verify all rights by using the <tt>LS -L</tt> command on the different files. Also, notice the auto-completion feature in the shell using <tt>&lt;TAB&gt;</tt> is extremely handy in these situations.
450
451 <ol style="list-style-type: decimal">
452
453 <li><tt>chmod +r /etc/passwd</tt> to make the passwords file readable for all</li>
454
455 <li><tt>chmod u+w /etc/passwd</tt> to make the passwords file writable for the owner</li>
456
457 <li><tt>chmod +r /etc/group</tt> to make the groups file readable for all</li>
458 </ol>
459
460 <ol style="list-style-type: decimal">
461
462 <li><tt>chmod u+w /etc/group</tt> to make the groups file writable for the owner</li>
463 </ol>
464
465 <ol style="list-style-type: decimal">
466
467 <li><tt>chmod 755 /var</tt> to make the var folder writable to owner and readable and executable to all</li>
468 </ol>
469 </li>
470
471 <li>Edit the <b>/etc/hosts.allow</b> file using your favorite editor (why not VI in the shell!) and make sure the following two lines are in there before the <tt>PARANOID</tt> line:
472
473 <ol style="list-style-type: decimal">
474
475 <li><tt>ALL : localhost 127.0.0.1/32 : allow</tt></li>
476
477 <li><tt>ALL : [::1]/128 : allow</tt></li>
478 </ol>
479 </li>
480
481 <li>Next we have to <b>configure SSH</b> by using the script <tt>ssh-host-config</tt>
482
483 <ol style="list-style-type: decimal">
484
485 <li>If this script asks to overwrite an existing <tt>/etc/ssh_config</tt>, answer <tt>yes</tt>.</li>
486
487 <li>If this script asks to overwrite an existing <tt>/etc/sshd_config</tt>, answer <tt>yes</tt>.</li>
488
489 <li>If this script asks to use privilege separation, answer <tt>yes</tt>.</li>
490
491 <li>If this script asks to install <tt>sshd</tt> as a service, answer <tt>yes</tt>. Make sure you started your shell as Adminstrator!</li>
492
493 <li>If this script asks for the CYGWIN value, just <tt>&lt;enter&gt;</tt> as the default is <tt>ntsec</tt>.</li>
494
495 <li>If this script asks to create the <tt>sshd</tt> account, answer <tt>yes</tt>.</li>
496
497 <li>If this script asks to use a different user name as service account, answer <tt>no</tt> as the default will suffice.</li>
498
499 <li>If this script asks to create the <tt>cyg_server</tt> account, answer <tt>yes</tt>. Enter a password for the account.</li>
500 </ol>
501 </li>
502
503 <li><b>Start the SSH service</b> using <tt>net start sshd</tt> or <tt>cygrunsrv --start sshd</tt>. Notice that <tt>cygrunsrv</tt> is the utility that make the process run as a Windows service. Confirm that you see a message stating that <tt>the CYGWIN sshd service was started succesfully.</tt></li>
504
505 <li>Harmonize Windows and Cygwin<b> user account</b> by using the commands:
506
507 <ol style="list-style-type: decimal">
508
509 <li><tt>mkpasswd -cl &gt; /etc/passwd</tt></li>
510
511 <li><tt>mkgroup --local &gt; /etc/group</tt></li>
512 </ol>
513 </li>
514
515 <li><b>Test </b>the installation of SSH:
516
517 <ol style="list-style-type: decimal">
518
519 <li>Open a new Cygwin terminal</li>
520
521 <li>Use the command <tt>whoami</tt> to verify your userID</li>
522
523 <li>Issue an <tt>ssh localhost</tt> to connect to the system itself
524
525 <ol style="list-style-type: decimal">
526
527 <li>Answer <tt>yes</tt> when presented with the server's fingerprint</li>
528
529 <li>Issue your password when prompted</li>
530
531 <li>test a few commands in the remote session</li>
532
533 <li>The <tt>exit</tt> command should take you back to your first shell in Cygwin</li>
534 </ol>
535 </li>
536
537 <li><tt>Exit</tt> should terminate the Cygwin shell.</li>
538 </ol>
539 </li>
540 </ol>
541 </div>
542
543 <div class="section">
544 <h2><a name="HBase"></a>HBase</h2>
545 If all previous configurations are working properly, we just need some tinkering at the <b>HBase config</b> files to properly resolve on Windows/Cygwin. All files and paths referenced here start from the HBase <tt>[<b>installation</b> directory]</tt> as working directory.
546
547 <ol style="list-style-type: decimal">
548
549 <li>HBase uses the <tt>./conf/<b>hbase-env.sh</b></tt> to configure its dependencies on the runtime environment. Copy and uncomment following lines just underneath their original, change them to fit your environemnt. They should read something like:
550
551 <ol style="list-style-type: decimal">
552
553 <li><tt>export JAVA_HOME=/usr/local/<i>&lt;jre name&gt;</i></tt></li>
554
555 <li><tt>export HBASE_IDENT_STRING=$HOSTNAME</tt> as this most likely does not inlcude spaces.</li>
556 </ol>
557 </li>
558
559 <li>HBase uses the ./conf/<tt><b>hbase-default.xml</b></tt> file for configuration. Some properties do not resolve to existing directories because the JVM runs on Windows. This is the major issue to keep in mind when working with Cygwin: within the shell all paths are *nix-alike, hence relative to the root <tt>/</tt>. However, every parameter that is to be consumed within the windows processes themself, need to be Windows settings, hence <tt>C:\</tt>-alike. Change following propeties in the configuration file, adjusting paths where necessary to conform with your own installation:
560
561 <ol style="list-style-type: decimal">
562
563 <li><tt>hbase.rootdir</tt> must read e.g. <tt>file:///C:/cygwin/root/tmp/hbase/data</tt></li>
564
565 <li><tt>hbase.tmp.dir</tt> must read <tt>C:/cygwin/root/tmp/hbase/tmp</tt></li>
566
567 <li><tt>hbase.zookeeper.quorum</tt> must read <tt>127.0.0.1</tt> because for some reason <tt>localhost</tt> doesn't seem to resolve properly on Cygwin.</li>
568 </ol>
569 </li>
570
571 <li>Make sure the configured <tt>hbase.rootdir</tt> and <tt>hbase.tmp.dir</tt> <b>directories exist</b> and have the proper<b> rights</b> set up e.g. by issuing a <tt>chmod 777</tt> on them.</li>
572 </ol>
573 </div>
574 </div>
575
576 <div class="section">
577 <h2><a name="null"></a></h2>
578
579
580 <p>
581 This should conclude the installation and configuration of Apache HBase on Windows using Cygwin. So it's time <b>to test it</b>.
582 </p>
583 <ol style="list-style-type: decimal">
584
585 <li>Start a Cygwin<b> terminal</b>, if you haven't already.</li>
586
587 <li>Change directory to HBase <b>installation</b> using <tt>CD /usr/local/hbase-<i>&lt;version&gt;</i></tt>, preferably using auto-completion.</li>
588
589 <li><b>Start HBase</b> using the command <tt>./bin/start-hbase.sh</tt>
590
591 <ol style="list-style-type: decimal">
592
593 <li>When prompted to accept the SSH fingerprint, answer <tt>yes</tt>.</li>
594
595 <li>When prompted, provide your password. Maybe multiple times.</li>
596
597 <li>When the command completes, the HBase server should have started.</li>
598
599 <li>However, to be absolutely certain, check the logs in the <tt>./logs</tt> directory for any exceptions.</li>
600 </ol>
601 </li>
602
603 <li>Next we <b>start the HBase shell</b> using the command <tt>./bin/hbase shell</tt></li>
604
605 <li>We run some simple <b>test commands</b>
606
607 <ol style="list-style-type: decimal">
608
609 <li>Create a simple table using command <tt>create 'test', 'data'</tt></li>
610
611 <li>Verify the table exists using the command <tt>list</tt></li>
612
613 <li>Insert data into the table using e.g.
614
615 <div>
616 <pre>put 'test', 'row1', 'data:1', 'value1'
617 put 'test', 'row2', 'data:2', 'value2'
618 put 'test', 'row3', 'data:3', 'value3'</pre></div>
619 </li>
620
621 <li>List all rows in the table using the command <tt>scan 'test'</tt> that should list all the rows previously inserted. Notice how 3 new columns where added without changing the schema!</li>
622
623 <li>Finally we get rid of the table by issuing <tt>disable 'test'</tt> followed by <tt>drop 'test'</tt> and verified by <tt>list</tt> which should give an empty listing.</li>
624 </ol>
625 </li>
626
627 <li><b>Leave the shell</b> by <tt>exit</tt></li>
628
629 <li>To <b>stop the HBase server</b> issue the <tt>./bin/stop-hbase.sh</tt> command. And wait for it to complete!!! Killing the process might corrupt your data on disk.</li>
630
631 <li>In case of <b>problems</b>,
632
633 <ol style="list-style-type: decimal">
634
635 <li>verify the HBase logs in the <tt>./logs</tt> directory.</li>
636
637 <li>Try to fix the problem</li>
638
639 <li>Get help on the forums or IRC (<tt>#hbase@freenode.net</tt>). People are very active and keen to help out!</li>
640
641 <li>Stopr, restart and retest the server.</li>
642 </ol>
643 </li>
644 </ol>
645
646 </div>
647
648
649 <div class="section">
650 <h2><a name="Conclusion"></a>Conclusion</h2>
651
652 <p>
653 Now your <b>HBase </b>server is running, <b>start coding</b> and build that next killer app on this particular, but scalable datastore!
654 </p>
655 </div>
656
657
658 </div>
659 </div>
660
661 <hr/>
662
663 <footer>
664 <div class="container">
665 <div class="row">
666 <p >Copyright &copy; 2007&#x2013;2018
667 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
668 All rights reserved.
669
670 <li id="publishDate" class="pull-right">Last Published: 2018-03-11</li>
671 </p>
672 </div>
673
674 <p id="poweredBy" class="pull-right">
675 <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
676 <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
677 </a>
678 </p>
679
680 </div>
681 </footer>
682 </body>
683 </html>