我正在使用Apache Hadoop和Apache Sqoop。我试图将mysql表导入hdfs。
这是我正在执行的命令:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF8">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" type="text/javascript"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" type="text/javascript"></script>
<link href="javascripts/frontend.js">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="/stylesheets/userlist.css" rel="stylesheet">
<link href='//fonts.googleapis.com/css?family=Amatic SC' rel='stylesheet'>
<link href='//fonts.googleapis.com/css?family=NTR' rel='stylesheet'>
<title>Userlist</title>
<!-- <script>$(document).ready({
});
</script> -->
</head>
<body>
<div class="container-fluid">
<div class="row">
<h1><strong>FORM</strong></h1>
<hr id="hr2" style="border: 6px solid palevioletred">
<form action="/users/add_user" class="form-horizontal" id="user_form" method="post" name="user_form">
<fieldset>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Name :</label>
<div class="col-md-4">
<input class="form-control input-md" id="nameinput" name="name" onfocus="if (this.value=='Name') this.value='';" placeholder="Enter Username" type="text" value="Name">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Age :</label>
<div class="col-md-4">
<input class="form-control input-md" id="ageinput" name="age" placeholder="Enter Age" type="number">
</div>
</div>
<!-- Button -->
<!-- Button (Double) -->
<div class="form-group">
<div class="col-md-8">
<button class="btn btn-success" id="singlebutton" type="submit"><b>Add User</b></button>
</div>
</div>
</fieldset>
</form>
<h1><strong>USERS</strong>
</h1>
<hr id="hr1" style="border: 6px solid #7ec4ec;">
<ul class="triangle" id="list">
<!-- Link trigger modal -->
<!-- Modal -->
<li style="list-style: none; display: inline">
<%for(var i=0; i<userlist.length; i++) {%>
</li>
<!-- ______ MODAL ______ -->
<div aria-labelledby="myModalLabel" class="modal fade" id="openModal" role="dialog" tabindex="-1">
<div class="modal-dialog" role="dialog">
<div class="modal-content">
<div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Edit :</h4>
</div>
<div class="modal-body">
HEY!!
<!-- <form>
Name:<input id="nameId" name="modal_username" type="text" value=""> Age:<input id="ageId" name="modal_age" type="number" value="">
</form> -->
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" type="button">Close</button> <button class="btn btn-primary" type="button">Save changes</button>
</div>
</div>
</div>
</div>
<li>
<%= userlist[i].name %>:
<%= userlist[i].age %> <a class="delete_user" data-id="<%= userlist[i]._id %>" href="#" id="delete" title="Delete this User">Delete</a> || <a href="#openModal" class="update_user" data-target="#openModal" data-toggle="modal" id="update" title="Update user info"
data-id="<%= userlist[i]._id %>">Update</a>
</li>
<%} %>
</ul>
</div>
</div>
</body>
</html>
我已按如下方式设置Sqoop家庭环境变量:
sqoop-import --connect jdbc:mysql://localhost/billing_engine -username root -password root > --table cpDetail;
但是执行上面的命令会给我以下错误:
export SQOOP_HOME=/Users/bng/Documents/sqoop-1.4.6.bin__hadoop-2.0.4-alpha
export PATH=$PATH:$SQOOP_HOME/bin
请建议,我哪里错了?
答案 0 :(得分:0)
这是我需要使用的正确命令:
sqoop import --connect jdbc:mysql://localhost/billing_engine?useSSL=false --username bil --password bil --table cpdetail -m 1 --target-dir /sqoopFromMysql
该命令的详细信息如下;