java - impl.ServerClient:无法在服务器列表中找到可用的服务器:

标签 java eclipse hadoop apache-zookeeper accumulo

我正在尝试查询要使用Windows客户端PC [Casa-PC]进行测试的PC服务器[JARVIS](在具有Ubuntu Server 14.04.3的PC上使用Apache 1.7.0累积-Zookeper 3.4.6- Hadoop 2.7.1)。 PC](在Eclipse中制造,我在该项目中执行了一个带有maven库Accumulation-1.7.0和hadoop-core-1.2.1的项目),它们都在同一LAN上。
当我尝试使用以下代码查询PC服务器时,在PC客户端上运行Java Eclipse将我带回以下列表:

15/11/30 07:14:31 WARN client.ClientConfiguration: Found no client.conf in default paths. Using default client configuration values. 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:host.name=Casa-PC 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:java.version=1.8.0_60 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:java.home=... 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:java.class.path=... 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:java.library.path=...;;. 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=... 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:java.compiler= 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows 7 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:os.version=6.1 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:user.name=... 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:user.home=... 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Client environment:user.dir=... 15/11/30 07:14:32 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=JARVIS sessionTimeout=30000 watcher=org.apache.accumulo.fate.zookeeper.ZooSession$ZooWatcher@1ccaa 15/11/30 07:14:38 INFO zookeeper.ClientCnxn: Opening socket connection to server JARVIS/192.168.1.104:2181. Will not attempt to authenticate using SASL (unknown error) 15/11/30 07:14:38 INFO zookeeper.ClientCnxn: Socket connection established to JARVIS/192.168.1.104:2181, initiating session 15/11/30 07:14:38 INFO zookeeper.ClientCnxn: Session establishment complete on server JARVIS/192.168.1.104:2181, sessionid = 0x15155768163000b, negotiated timeout = 30000 15/12/03 17:05:26 WARN rpc.ThriftUtil: Failed to open transport to JARVIS:9997 15/12/03 17:05:26 WARN impl.ServerClient: Failed to find an available server in the list of servers: [JARVIS:9997 (120000)] 15/12/03 17:05:27 WARN rpc.ThriftUtil: Failed to open transport to JARVIS:9997 15/12/03 17:05:28 WARN rpc.ThriftUtil: Failed to open transport to JARVIS:9997 15/12/03 17:05:29 WARN rpc.ThriftUtil: Failed to open transport to JARVIS:9997


import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.ZooKeeperInstance;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.ColumnVisibility;
import org.apache.hadoop.io.Text;



public class Accumulo1 {

  public Connector connection;

  @SuppressWarnings("deprecation")
  public static void main(String[] args)throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException, IOException {

    String instanceName = "instanceName ";
    String zooServers = "zooServers ";
    String userName = "userName ";
    String password = "password ";


    Instance inst = new ZooKeeperInstance(instanceName,zooServers);
    Connector connection = inst.getConnector(userName, password);

    BatchWriter bw = connection.createBatchWriter("demotable",1000000, 60000, 2);


    Text rowID = new Text("row1");
    Text colFam = new Text("colFam");
    Text colQual = new Text("colQual");

    ColumnVisibility colVis = new ColumnVisibility("public");
    long timestamp = System.currentTimeMillis();

    Value value = new Value("some-value".getBytes());

    Mutation mutation = new Mutation(rowID);
    mutation.put(colFam, colQual, colVis, timestamp, value);

    bw.addMutation(mutation);

    bw.close();
  }

}

我检查了服务器并存在存储('http://JARVIS:50095/servers')。
我不明白可能是什么问题。
也许我没有正确配置Eclipse。

最佳答案

There are no tablet servers: check that zookeeper and accumulo are running.



确保您提供了正确的Zookeeper仲裁字符串和Accumulo实例名称。您应该能够从Accumulo监视器http://JARVIS:50095中获得所有这些信息。这意味着,根据您提供的属性,Accumulo没有运行。

这也应该告诉您Accumulo是否正在实际运行-查看最近的日志页面是否有任何Accumulo错误。

关于java - impl.ServerClient:无法在服务器列表中找到可用的服务器:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33993858/

相关文章:

java - 在 Java Swing 程序中使用命令行参数

java - 如何使用 Jsoup 从 html 页面检索代码片段?

eclipse - 在Eclipse中清除控制台的快捷键

使用 C#.NET 从 Hadoop HDFS 读取 JSON 文件

hadoop - 德鲁伊中的精确不同计数

java - s3 hadoop错误:NoSuchMethodError:org.apache.hadoop.metrics2.lib.MetricsRegistry.newCounter

java - 如何避免排序字符串数组中的重复值?

java - 从 Java Runtime.getRuntime 执行 linux mutt 不发送邮件也没有给出错误

java - 如何查看jar文件中的源代码?

java - VM 初始化期间发生错误,无法为对象堆保留足够的空间 - Spring Tool Suite?