Find the 'edits' file in the hadoop dfs.name.dir/current and write this sequence to it :
printf "\xff\xff\xff\xee\xff" > edits
After that, you should be able to start hadoop. Credit here.
printf "\xff\xff\xff\xee\xff" > edits
#!/bin/bash
mkdir /tmp/locka 2>/dev/null || {
exit
}
trap "rmdir /tmp/locka" EXIT
#script work, the sleep 10 below is to test this
#without having a real script.
sleep 10
public static byte[] getEscapedBlob(byte[] blob) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
for (int i=0; i<blob.length; i++) {
if (blob[i]=='\t' || blob[i]=='\n' || blob[i]=='\\') {
bos.write('\\');
bos.write(blob[i]);
} else if (blob[i] == 0) {
bos.write('\\');
bos.write('0');
} else {
bos.write(blob[i]);
}
}
return bos.toByteArray();
}
//gen infile for mysql
byte[] out = getEscapedBlob(data);
BufferedOutputStream f = new BufferedOutputStream(new FileOutputStream("/path/to/data.csv")) ;
String nonBlobFields = "\\N\t10\t20100301\t18\t1102010\t2010-03-01 00:00:00\t";
byte[] nonBlobData = nonBlobFields.getBytes("UTF-8");
f.write(nonBlobData, 0, nonBlobData.length);
f.write(out, 0, out.length);
f.write('\n');
f.close();
for m in m1 m2 m3 m4 ; do echo $m; ssh $m "echo password | sudo -S apt-get -y install curl" ; done
perl -ne 's/([^\r])\r/$1\n/g; s/\r//g; print;' imported.csv
public class ASyncUDPSvr {
static int BUF_SZ = 1024;
class Con {
ByteBuffer req;
ByteBuffer resp;
SocketAddress sa;
public Con() {
req = ByteBuffer.allocate(BUF_SZ);
}
}
static int port = 8340;
private void process() {
try {
Selector selector = Selector.open();
DatagramChannel channel = DatagramChannel.open();
InetSocketAddress isa = new InetSocketAddress(port);
channel.socket().bind(isa);
channel.configureBlocking(false);
SelectionKey clientKey = channel.register(selector, SelectionKey.OP_READ);
clientKey.attach(new Con());
while (true) {
try {
selector.select();
Iterator selectedKeys = selector.selectedKeys().iterator();
while (selectedKeys.hasNext()) {
try {
SelectionKey key = (SelectionKey) selectedKeys.next();
selectedKeys.remove();
if (!key.isValid()) {
continue;
}
if (key.isReadable()) {
read(key);
key.interestOps(SelectionKey.OP_WRITE);
} else if (key.isWritable()) {
write(key);
key.interestOps(SelectionKey.OP_READ);
}
} catch (IOException e) {
System.err.println("glitch, continuing... " +(e.getMessage()!=null?e.getMessage():""));
}
}
} catch (IOException e) {
System.err.println("glitch, continuing... " +(e.getMessage()!=null?e.getMessage():""));
}
}
} catch (IOException e) {
System.err.println("network error: " + (e.getMessage()!=null?e.getMessage():""));
}
}
private void read(SelectionKey key) throws IOException {
DatagramChannel chan = (DatagramChannel)key.channel();
Con con = (Con)key.attachment();
con.sa = chan.receive(con.req);
System.out.println(new String(con.req.array(), "UTF-8"));
con.resp = Charset.forName( "UTF-8" ).newEncoder().encode(CharBuffer.wrap("send the same string"));
}
private void write(SelectionKey key) throws IOException {
DatagramChannel chan = (DatagramChannel)key.channel();
Con con = (Con)key.attachment();
chan.send(con.resp, con.sa);
}
static public void main(String[] args) {
ASyncUDPSvr svr = new ASyncUDPSvr();
svr.process();
}
}