簡體   English   中英

Google App Engine無法連接安裝在Google Compute Engine上的Aerospike

[英]Google App Engine fails to connect Aerospike installed on Google Compute Engine

我正在嘗試將我的GAE應用程序連接到Google Compute Engine上安裝的Aerospike。 如果我使用main函數,則下面的代碼段還可以。

    public static void main(String[] args) {
        AerospikeClient client = new AerospikeClient("xxx.xxx.xx.xx", 3000);
        boolean isConnect = client.isConnected();       
        Key key = new Key("test", "demo", "putgetkey");
        Bin bin1 = new Bin("bin1", "value1");
        Bin bin2 = new Bin("bin2", "value2");       
        client.put(null, key, bin1, bin2);
        Record record = client.get(null, key);
        client.close();
    }

但是,當我將應用程序部署到GAE時,出現了此錯誤。

    java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
    at java.security.AccessController.checkPermission(AccessController.java:559)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:429)
    at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkAccess(DevAppServerFactory.java:454)
    at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
    at java.lang.Thread.init(Thread.java:391)
    at java.lang.Thread.init(Thread.java:349)
    at java.lang.Thread.<init>(Thread.java:461)
    at com.aerospike.client.cluster.Cluster.initTendThread(Cluster.java:163)
    at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:195)
    at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:160)

我使用Compute Engine實例的外部和內部IP創建了新的AerospikeClient(“ compute_engine_ip”,3000),但存在相同的錯誤。 有解決我的問題的主意嗎? 謝謝。

GAE不允許前端實例(GAE實例)產生線程,並且嘗試這樣做會導致AccessControlException。

您將需要在GCE機器上運行Aerospike客戶端,然后使用您的GAE應用程序連接到GCE機器,而不是在GAE上運行Aerospike客戶端。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM