在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ 數(shù)據(jù)庫/ Cassandra安裝與配置
Cassandra批量
Cassandra與HBase比較(區(qū)別)
Cassandra截斷表
Cassandra刪除鍵空間
Cassandra刪除索引
Cassandra是什么?
Cassandra創(chuàng)建表
Cassandra數(shù)據(jù)類型
Cassandra修改鍵空間
Cassandra刪除表
Cassandra讀取數(shù)據(jù)
Cassandra數(shù)據(jù)模型
Cassandra教程
Cassandra刪除數(shù)據(jù)記錄
Cassandra更新數(shù)據(jù)
Cassandra修改表
Cassandra安裝與配置
Cassandra插入數(shù)據(jù)
Cassandra歷史
Cassandra的特點
Cassandra創(chuàng)建索引
Cassandra創(chuàng)建鍵空間(Keyspace)
Cassandra應(yīng)用場景(案例)
Cassandra與關(guān)系數(shù)據(jù)庫比較(區(qū)別)
Cassandra數(shù)據(jù)類型
Cassandra集合
Cassandra的架構(gòu)
Cassandra CQLsh

Cassandra安裝與配置

Apache Cassandra和Datastax企業(yè)級被不同組織用于存儲大量數(shù)據(jù)。在安裝Apache Cassandra之前,您必須具備以下事項:

  • 必須擁有datastax社區(qū)版本,可以點擊這里下載Cassandra3.10。
  • 必須提前安裝好JDK8以上版本。
  • 必須提前安裝好JDK。
    最新版本的Java 8,要驗證是否安裝了正確版本的Java,請在終端上輸入:
java -version

對于使用cqlsh, 需要安裝Python 2.7(一定要使用這個版本哦)。要驗證是否安裝了正確版本的Python,請在終端上輸入:

python --version

如下所示 -

C:\Users\Administrator>python --version
Python 2.7.10

C:\Users\Administrator>

從二進制tar文件安裝

從Apache Cassandra下載網(wǎng)站下載最新的穩(wěn)定版本。
將文件解壓到某處,如在本示例為:D:\software\apache-cassandra-3.10,例如:

注:為了使用方便,可以將D:\software\apache-cassandra-3.10\bin添加到環(huán)境變量中。

進入目錄D:\software\apache-cassandra-3.10\bin,通過從命令行調(diào)用 cassandra -f,在前臺啟動Cassandra。 按“Control + C”鍵停止Cassandra。 在后臺通過從命令行調(diào)用cassandra啟動Cassandra。 調(diào)用kill pidpkill -f CassandraDaemon來停止Cassandra,其中pid是Cassandra進程標識,可以通過調(diào)用pgrep -f CassandraDaemon來找到它。

通過從命令行調(diào)用nodetool狀態(tài)來驗證Cassandra是否正在運行。

配置文件位于conf子目錄中。
由于Cassandra,日志和數(shù)據(jù)目錄分別位于日志和數(shù)據(jù)子目錄中。 舊版本默認為/var/log/cassandra/var/lib/cassandra。 因此,有必要以root權(quán)限啟動Cassandra,或者將conf/cassandra.yaml更改為使用當前用戶擁有的目錄,如下文有關(guān)更改目錄位置的部分所述。

現(xiàn)在我們來一步步地演示上面的命令,首先啟動 cassandra , 在前臺啟動Cassandra使用以下命令 -

D:\software\apache-cassandra-3.10\bin> cassandra -f
WARNING! Powershell script execution unavailable.
   Please use 'powershell Set-ExecutionPolicy Unrestricted'
   on this user-account to run cassandra with fully featured
   functionality on this platform.
Starting with legacy startup options
.... ....
INFO  [main] 2017-04-17 22:35:51,658 Server.java:155 - Using Netty Version: [netty-buffer=netty-buffer-4.0.39.Final.38bdf86, netty-codec=netty-codec-4.0.39.Final.38bdf86, netty-codec-haproxy=netty-codec-haproxy-4.0.39.Final.38bdf86, netty-codec-http=netty-codec-http-4.0.39.Final.38bdf86, netty-codec-socks=netty-codec-socks-4.0.39.Final.38bdf86, netty-common=netty-common-4.0.39.Final.38bdf86, netty-handler=netty-handler-4.0.39.Final.38bdf86, netty-tcnative=netty-tcnative-1.1.33.Fork19.fe4816e, netty-transport=netty-transport-4.0.39.Final.38bdf86, netty-transport-native-epoll=netty-transport-native-epoll-4.0.39.Final.38bdf86, netty-transport-rxtx=netty-transport-rxtx-4.0.39.Final.38bdf86, netty-transport-sctp=netty-transport-sctp-4.0.39.Final.38bdf86, netty-transport-udt=netty-transport-udt-4.0.39.Final.38bdf86]
INFO  [main] 2017-04-17 22:35:51,677 Server.java:156 - Starting listening for CQL clients on localhost/127.0.0.1:9042 (unencrypted)...
INFO  [main] 2017-04-17 22:35:51,919 CassandraDaemon.java:528 - Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it

這就啟動了。。。
按“Control + C”鍵停止Cassandra。接下來演示在后臺通過從命令行調(diào)用cassandra啟動Cassandra。

D:\software\apache-cassandra-3.10\bin> cassandra 
... ...
INFO  [main] 2017-04-17 22:37:38,985 ColumnFamilyStore.java:406 - Initializing system.schema_usertypes
INFO  [main] 2017-04-17 22:37:39,002 ColumnFamilyStore.java:406 - Initializing system.schema_functions
INFO  [main] 2017-04-17 22:37:39,042 ColumnFamilyStore.java:406 - Initializing system.schema_aggregates
INFO  [main] 2017-04-17 22:37:39,046 ViewManager.java:137 - Not submitting build tasks for views in keyspace system as storage service is not initialized
INFO  [main] 2017-04-17 22:37:39,614 ApproximateTime.java:44 - Scheduling approximate time-check task with a precision of 10 milliseconds
... ...
INFO  [main] 2017-04-17 22:37:56,101 Server.java:155 - Using Netty Version: [netty-buffer=netty-buffer-4.0.39.Final.38bdf86, netty-codec=netty-codec-4.0.39.Final.38bdf86, netty-codec-haproxy=netty-codec-haproxy-4.0.39.Final.38bdf86, netty-codec-http=netty-codec-http-4.0.39.Final.38bdf86, netty-codec-socks=netty-codec-socks-4.0.39.Final.38bdf86, netty-common=netty-common-4.0.39.Final.38bdf86, netty-handler=netty-handler-4.0.39.Final.38bdf86, netty-tcnative=netty-tcnative-1.1.33.Fork19.fe4816e, netty-transport=netty-transport-4.0.39.Final.38bdf86, netty-transport-native-epoll=netty-transport-native-epoll-4.0.39.Final.38bdf86, netty-transport-rxtx=netty-transport-rxtx-4.0.39.Final.38bdf86, netty-transport-sctp=netty-transport-sctp-4.0.39.Final.38bdf86, netty-transport-udt=netty-transport-udt-4.0.39.Final.38bdf86]
INFO  [main] 2017-04-17 22:37:56,128 Server.java:156 - Starting listening for CQL clients on localhost/127.0.0.1:9042 (unencrypted)...
INFO  [main] 2017-04-17 22:37:56,427 CassandraDaemon.java:528 - Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it

如下圖所示 -

要運行Cassandra shell,重新啟動一個命令行窗口并輸入cqlsh命令,您將看到命令行執(zhí)行的結(jié)果以下:

D:\software\apache-cassandra-3.10\bin> cqlsh

WARNING: console codepage must be set to cp65001 to support utf-8 encoding on Windows platforms.
If you experience encoding problems, change your console codepage with 'chcp 65001' before starting cqlsh.

Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.10 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
WARNING: pyreadline dependency missing.  Install to enable tab completion.
cqlsh>