-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcygwin.html
683 lines (435 loc) · 31.8 KB
/
cygwin.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.6
| Rendered using Apache Maven Fluido Skin 1.5-HBASE
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20180327" />
<meta http-equiv="Content-Language" content="en" />
<title>Apache HBase – Installing Apache HBase (TM) on Windows using Cygwin</title>
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido-1.5-HBASE.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css"/>
<link rel="stylesheet" href="css/site.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script>
</head>
<body class="topBarEnabled">
<div id="topbar" class="navbar navbar-fixed-top ">
<div class="navbar-inner">
<div class="container">
<a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache HBase Project <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="index.html" title="Overview">Overview</a>
</li>
<li> <a href="license.html" title="License">License</a>
</li>
<li> <a href="http://www.apache.org/dyn/closer.cgi/hbase/" title="Downloads">Downloads</a>
</li>
<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>
</li>
<li> <a href="coc.html" title="Code Of Conduct">Code Of Conduct</a>
</li>
<li> <a href="http://blogs.apache.org/hbase/" title="Blog">Blog</a>
</li>
<li> <a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
<li> <a href="team-list.html" title="Team">Team</a>
</li>
<li> <a href="https://reviews.apache.org/" title="ReviewBoard">ReviewBoard</a>
</li>
<li> <a href="sponsors.html" title="Thanks">Thanks</a>
</li>
<li> <a href="poweredbyhbase.html" title="Powered by HBase">Powered by HBase</a>
</li>
<li> <a href="resources.html" title="Other resources">Other resources</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Information <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="project-summary.html" title="Project Summary">Project Summary</a>
</li>
<li> <a href="dependency-info.html" title="Dependency Information">Dependency Information</a>
</li>
<li> <a href="team-list.html" title="Team">Team</a>
</li>
<li> <a href="source-repository.html" title="Source Repository">Source Repository</a>
</li>
<li> <a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
<li> <a href="dependency-management.html" title="Dependency Management">Dependency Management</a>
</li>
<li> <a href="dependencies.html" title="Dependencies">Dependencies</a>
</li>
<li> <a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a>
</li>
<li> <a href="integration.html" title="Continuous Integration">Continuous Integration</a>
</li>
<li> <a href="plugin-management.html" title="Plugin Management">Plugin Management</a>
</li>
<li> <a href="plugins.html" title="Plugins">Plugins</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation and API <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="book.html" target="_blank" title="Reference Guide">Reference Guide</a>
</li>
<li> <a href="apache_hbase_reference_guide.pdf" target="_blank" title="Reference Guide (PDF)">Reference Guide (PDF)</a>
</li>
<li> <a href="book.html#quickstart" target="_blank" title="Getting Started">Getting Started</a>
</li>
<li> <a href="apidocs/index.html" target="_blank" title="User API">User API</a>
</li>
<li> <a href="testapidocs/index.html" target="_blank" title="User API (Test)">User API (Test)</a>
</li>
<li> <a href="devapidocs/index.html" target="_blank" title="Developer API">Developer API</a>
</li>
<li> <a href="testdevapidocs/index.html" target="_blank" title="Developer API (Test)">Developer API (Test)</a>
</li>
<li> <a href="http://abloz.com/hbase/book.html" target="_blank" title="中文参考指南(单页)">中文参考指南(单页)</a>
</li>
<li> <a href="book.html#faq" target="_blank" title="FAQ">FAQ</a>
</li>
<li> <a href="book.html#other.info" target="_blank" title="Videos/Presentations">Videos/Presentations</a>
</li>
<li> <a href="http://wiki.apache.org/hadoop/Hbase" target="_blank" title="Wiki">Wiki</a>
</li>
<li> <a href="acid-semantics.html" target="_blank" title="ACID Semantics">ACID Semantics</a>
</li>
<li> <a href="book.html#arch.bulk.load" target="_blank" title="Bulk Loads">Bulk Loads</a>
</li>
<li> <a href="metrics.html" target="_blank" title="Metrics">Metrics</a>
</li>
<li> <a href="cygwin.html" target="_blank" title="HBase on Windows">HBase on Windows</a>
</li>
<li> <a href="book.html#replication" target="_blank" title="Cluster replication">Cluster replication</a>
</li>
<li class="dropdown-submenu">
<a href="" title="1.2 Documentation">1.2 Documentation</a>
<ul class="dropdown-menu">
<li> <a href="1.2/apidocs/index.html" target="_blank" title="API">API</a>
</li>
<li> <a href="1.2/xref/index.html" target="_blank" title="X-Ref">X-Ref</a>
</li>
<li> <a href="1.2/book.html" target="_blank" title="Ref Guide (single-page)">Ref Guide (single-page)</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">ASF <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="http://www.apache.org/foundation/" target="_blank" title="Apache Software Foundation">Apache Software Foundation</a>
</li>
<li> <a href="http://www.apache.org/foundation/how-it-works.html" target="_blank" title="How Apache Works">How Apache Works</a>
</li>
<li> <a href="http://www.apache.org/foundation/sponsorship.html" target="_blank" title="Sponsoring Apache">Sponsoring Apache</a>
</li>
</ul>
</li>
</ul>
<div id="search-form" class="navbar-search pull-right">
<script type="text/javascript">
var cx = '000385458301414556862:sq1bb0xugjg';
(function() {
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div id="banner">
<div class="pull-left">
<a href="./" id="bannerLeft">
<img src="" alt=""/>
</a>
</div>
<div class="pull-right"> <a href="./" id="bannerRight">
<img src="images/hbase_logo_with_orca_large.png" alt="Apache HBase"/>
</a>
</div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
</ul>
</div>
<div id="bodyColumn" >
<!-- Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. -->
<div class="section">
<h2><a name="Introduction"></a>Introduction</h2>
<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>
<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>
</div>
<div class="section">
<h2><a name="Purpose"></a>Purpose</h2>
<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>
</div>
<div class="section">
<h2><a name="Installation"></a>Installation</h2>
<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>
<div class="section">
<h2><a name="Java"></a>Java</h2>
<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>
</div>
<div class="section">
<h2><a name="Cygwin"></a>Cygwin</h2>
<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>
<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>
<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>
<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>
<ol style="list-style-type: decimal">
<li>Make sure you have <tt>Administrator</tt> privileges on the target system.</li>
<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>
<li>Download the <tt>setup.exe</tt> utility and save it to the <b>Local Package</b> directory.</li>
<li>Run the <tt>setup.exe</tt> utility,
<ol style="list-style-type: decimal">
<li>Choose the <tt>Install from Internet</tt> option,</li>
<li>Choose your <b>Root</b> and <b>Local Package</b> folders</li>
<li>and select an appropriate mirror.</li>
<li>Don't select any additional packages yet, as we only want to install Cygwin for now.</li>
<li>Wait for download and install</li>
<li>Finish the installation</li>
</ol>
</li>
<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>
<li>Add <tt>CYGWIN_HOME</tt> system-wide environment variable that points to your <b>Root </b>directory.</li>
<li>Add <tt>%CYGWIN_HOME%\bin</tt> to the end of your <tt>PATH</tt> environment variable.</li>
<li>Reboot the sytem after making changes to the environment variables otherwise the OS will not be able to find the Cygwin utilities.</li>
<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:
<ol style="list-style-type: decimal">
<li><tt>cd /</tt> should take you to thr <b>Root</b> directory in Cygwin;</li>
<li>the <tt>LS</tt> commands that should list all files and folders in the current directory.</li>
<li>Use the <tt>exit</tt> command to end the terminal.</li>
</ol>
</li>
<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>
</ol>
</div>
<div class="section">
<h2><a name="SSH"></a>SSH</h2>
<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>
<ol style="list-style-type: decimal">
<li>Rerun the <tt><b>setup.exe</b></tt><b> utility</b>.</li>
<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>
<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>
<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.
<ol style="list-style-type: decimal">
<li>OpenSSH</li>
<li>tcp_wrappers</li>
<li>diffutils</li>
<li>zlib</li>
</ol>
</li>
<li>Wait for the install to complete and finish the installation.</li>
</ol>
</div>
<div class="section">
<h2><a name="HBase"></a>HBase</h2>
<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><version></i></tt> installation in Cygwin.</p>
This finishes installation. We go on with the configuration.
</div>
</div>
<div class="section">
<h2><a name="Configuration"></a>Configuration</h2>
<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>
<div class="section">
<h2><a name="Java"></a>Java</h2>
<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>
<ol style="list-style-type: decimal">
<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:
<div>
<pre>LN -s /cygdrive/c/Program\ Files/Java/<i><jre name> </i>/usr/local/<i><jre name></i></pre></div>
</li>
<li>Test your java installation by changing directories to your Java folder <tt>CD /usr/local/<i><jre name></i></tt> and issueing the command <tt>./bin/java -version</tt>. This should output your version of the chosen JRE.</li>
</ol>
</div>
<div class="section">
<h2><a name="null"></a></h2>
<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>
<ol style="list-style-type: decimal">
<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>
<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><TAB></tt> is extremely handy in these situations.
<ol style="list-style-type: decimal">
<li><tt>chmod +r /etc/passwd</tt> to make the passwords file readable for all</li>
<li><tt>chmod u+w /etc/passwd</tt> to make the passwords file writable for the owner</li>
<li><tt>chmod +r /etc/group</tt> to make the groups file readable for all</li>
</ol>
<ol style="list-style-type: decimal">
<li><tt>chmod u+w /etc/group</tt> to make the groups file writable for the owner</li>
</ol>
<ol style="list-style-type: decimal">
<li><tt>chmod 755 /var</tt> to make the var folder writable to owner and readable and executable to all</li>
</ol>
</li>
<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:
<ol style="list-style-type: decimal">
<li><tt>ALL : localhost 127.0.0.1/32 : allow</tt></li>
<li><tt>ALL : [::1]/128 : allow</tt></li>
</ol>
</li>
<li>Next we have to <b>configure SSH</b> by using the script <tt>ssh-host-config</tt>
<ol style="list-style-type: decimal">
<li>If this script asks to overwrite an existing <tt>/etc/ssh_config</tt>, answer <tt>yes</tt>.</li>
<li>If this script asks to overwrite an existing <tt>/etc/sshd_config</tt>, answer <tt>yes</tt>.</li>
<li>If this script asks to use privilege separation, answer <tt>yes</tt>.</li>
<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>
<li>If this script asks for the CYGWIN value, just <tt><enter></tt> as the default is <tt>ntsec</tt>.</li>
<li>If this script asks to create the <tt>sshd</tt> account, answer <tt>yes</tt>.</li>
<li>If this script asks to use a different user name as service account, answer <tt>no</tt> as the default will suffice.</li>
<li>If this script asks to create the <tt>cyg_server</tt> account, answer <tt>yes</tt>. Enter a password for the account.</li>
</ol>
</li>
<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>
<li>Harmonize Windows and Cygwin<b> user account</b> by using the commands:
<ol style="list-style-type: decimal">
<li><tt>mkpasswd -cl > /etc/passwd</tt></li>
<li><tt>mkgroup --local > /etc/group</tt></li>
</ol>
</li>
<li><b>Test </b>the installation of SSH:
<ol style="list-style-type: decimal">
<li>Open a new Cygwin terminal</li>
<li>Use the command <tt>whoami</tt> to verify your userID</li>
<li>Issue an <tt>ssh localhost</tt> to connect to the system itself
<ol style="list-style-type: decimal">
<li>Answer <tt>yes</tt> when presented with the server's fingerprint</li>
<li>Issue your password when prompted</li>
<li>test a few commands in the remote session</li>
<li>The <tt>exit</tt> command should take you back to your first shell in Cygwin</li>
</ol>
</li>
<li><tt>Exit</tt> should terminate the Cygwin shell.</li>
</ol>
</li>
</ol>
</div>
<div class="section">
<h2><a name="HBase"></a>HBase</h2>
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.
<ol style="list-style-type: decimal">
<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:
<ol style="list-style-type: decimal">
<li><tt>export JAVA_HOME=/usr/local/<i><jre name></i></tt></li>
<li><tt>export HBASE_IDENT_STRING=$HOSTNAME</tt> as this most likely does not inlcude spaces.</li>
</ol>
</li>
<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:
<ol style="list-style-type: decimal">
<li><tt>hbase.rootdir</tt> must read e.g. <tt>file:///C:/cygwin/root/tmp/hbase/data</tt></li>
<li><tt>hbase.tmp.dir</tt> must read <tt>C:/cygwin/root/tmp/hbase/tmp</tt></li>
<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>
</ol>
</li>
<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>
</ol>
</div>
</div>
<div class="section">
<h2><a name="null"></a></h2>
<p>
This should conclude the installation and configuration of Apache HBase on Windows using Cygwin. So it's time <b>to test it</b>.
</p>
<ol style="list-style-type: decimal">
<li>Start a Cygwin<b> terminal</b>, if you haven't already.</li>
<li>Change directory to HBase <b>installation</b> using <tt>CD /usr/local/hbase-<i><version></i></tt>, preferably using auto-completion.</li>
<li><b>Start HBase</b> using the command <tt>./bin/start-hbase.sh</tt>
<ol style="list-style-type: decimal">
<li>When prompted to accept the SSH fingerprint, answer <tt>yes</tt>.</li>
<li>When prompted, provide your password. Maybe multiple times.</li>
<li>When the command completes, the HBase server should have started.</li>
<li>However, to be absolutely certain, check the logs in the <tt>./logs</tt> directory for any exceptions.</li>
</ol>
</li>
<li>Next we <b>start the HBase shell</b> using the command <tt>./bin/hbase shell</tt></li>
<li>We run some simple <b>test commands</b>
<ol style="list-style-type: decimal">
<li>Create a simple table using command <tt>create 'test', 'data'</tt></li>
<li>Verify the table exists using the command <tt>list</tt></li>
<li>Insert data into the table using e.g.
<div>
<pre>put 'test', 'row1', 'data:1', 'value1'
put 'test', 'row2', 'data:2', 'value2'
put 'test', 'row3', 'data:3', 'value3'</pre></div>
</li>
<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>
<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>
</ol>
</li>
<li><b>Leave the shell</b> by <tt>exit</tt></li>
<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>
<li>In case of <b>problems</b>,
<ol style="list-style-type: decimal">
<li>verify the HBase logs in the <tt>./logs</tt> directory.</li>
<li>Try to fix the problem</li>
<li>Get help on the forums or IRC (<tt>#[email protected]</tt>). People are very active and keen to help out!</li>
<li>Stopr, restart and retest the server.</li>
</ol>
</li>
</ol>
</div>
<div class="section">
<h2><a name="Conclusion"></a>Conclusion</h2>
<p>
Now your <b>HBase </b>server is running, <b>start coding</b> and build that next killer app on this particular, but scalable datastore!
</p>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container">
<div class="row">
<p >Copyright © 2007–2018
<a href="https://www.apache.org/">The Apache Software Foundation</a>.
All rights reserved.
<li id="publishDate" class="pull-right">Last Published: 2018-03-27</li>
</p>
</div>
<p id="poweredBy" class="pull-right">
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</p>
</div>
</footer>
</body>
</html>