我正在寻找一组指令,以创建一个本地多节点卡桑德拉 2.x集群窗口7 64位PC。
最好使用CCM“Cassandra群集管理器”,允许使用DataStax OpsCenter进行管理。
我遵循了“在Windows上开始使用的简单方法”中的说明,但它们是针对单个节点集群的。
编辑:我在每个节点上使用CCM部署OpsCenter代理,有什么想法吗?
发布于 2015-12-10 10:33:59
用于本教程的文章:
另请参阅:
Prerequisites:
假定已经安装了下列工具:
步骤1:安装Python
从这里下载并安装Python2.x的最新版本,例如https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi
注意:这也将安装“pip”工具。
需要将下列目录添加到路径中
<PYTHON_INSTALL_DIR>\Python
<PYTHON_INSTALL_DIR>\Python\Scripts
<ANT_INSTALL_DIR>\bin步骤2:安装CCM“Cassandra群集管理器”
在新的命令提示符/Powershell窗口中(以自己的身份登录)
输入“pip”-它将自动下载和安装ccm
> pip install ccm
Collecting ccm
Downloading ccm-2.0.6.tar.gz (56kB)
100% |################################| 57kB 1.8MB/s
Collecting pyYaml (from ccm)
Downloading PyYAML-3.11.tar.gz (248kB)
100% |################################| 249kB 1.7MB/s
Collecting six>=1.4.1 (from ccm)
Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: pyYaml, six, ccm
Running setup.py install for pyYaml
Running setup.py install for ccm
Successfully installed ccm-2.0.6 pyYaml-3.11 six-1.10.0步骤3:安装“psutil (python和流程实用程序)”
在步骤2的同一窗口中:
输入“psutil”--这将自动下载和安装psutil。
> pip install psutil
Collecting psutil
Downloading psutil-3.3.0-cp27-none-win_amd64.whl (92kB)
100% |################################| 94kB 1.4MB/s
Installing collected packages: psutil
Successfully installed psutil-3.3.0注意:此窗口现在可以关闭。
步骤4:在新的Powershell窗口中设置-ExecutionPolicy不受限制的(以本地管理身份登录),键入“Set-ExecutionPolicy无限制”
*注意:必须设置的执行策略,以允许CCM启动Cassandra实例。不受限制的执行策略还允许CCM在常规命令提示符(cmd)和Windows上运行
PS C:\Windows\system32> Set-ExecutionPolicy Unrestricted
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution
policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y步骤5:注册PY扩展
注意:将.PY扩展添加到环境变量$PATHEXT中,以允许从任何位置执行PowerShell (以管理员身份在PowerShell上运行):
在与步骤4相同的窗口中
[Environment]::SetEnvironmentVariable("PATHEXT", "$env:PATHEXT;.PY", "MACHINE")注意:此窗口现在可以关闭。
步骤6:检查CCM是否已启动并运行
在新的命令提示符窗口(以自己身份登录)中,键入:
>ccm status
No currently active cluster (use ccm cluster switch)步骤7:更新主机文件
以管理员身份打开记事本,并在C:\Windows\System32 32\drivers\etc\host文件中插入以下行:
#cassandra nodes
127.0.0.1 127.0.0.2
127.0.0.1 127.0.0.3
127.0.0.1 127.0.0.4
127.0.0.1 127.0.0.5
127.0.0.1 127.0.0.6步骤8:使用Cassandrav2.1.2创建和填充一个3节点集群
注意:这将下载Cassandra的2.1.2版本,构建它,然后使用它创建一个名为“mytest群集”的新CCM集群。
C:\Users\myusername>ccm create mytestcluster -v 2.1.2
Downloading http://archive.apache.org/dist/cassandra/2.1.2/apache-cassandra-2.1.2-bin.tar.gz to c:\users\myusername\appdata\local\temp\ccm-qwauvs.tar.gz (21.735MB)
22790390 [100.00%]
Extracting c:\users\myusername\appdata\local\temp\ccm-qwauvs.tar.gz as version 2.1.2 ...
Current cluster is now: mytestcluster
C:\Users\myusername>ccm status
Cluster: 'mytestcluster'
------------------------
No node in this cluster yet
C:\Users\myusername>ccm populate -n 3
C:\Users\myusername>ccm status
Cluster: 'mytestcluster'
------------------------
node1: DOWN (Not initialized)
node3: DOWN (Not initialized)
node2: DOWN (Not initialized)
C:\Users\myusername>ccm start
Started: node1 with pid: 17432
Started: node3 with pid: 6308
Started: node2 with pid: 22484
C:\Users\myusername>ccm status
Cluster: 'mytestcluster'
------------------------
node1: UP
node3: UP
node2: UP
C:\Users\myusername>ccm jconsole

C:\Users\myusername>ccm node1 show
node1: UP
cluster=mytestcluster
auto_bootstrap=False
thrift=('127.0.0.1', 9160)
binary=('127.0.0.1', 9042)
storage=('127.0.0.1', 7000)
jmx_port=7100
remote_debug_port=0
initial_token=-9223372036854775808
pid=17432
C:\Users\myusername>ccm node2 show
node2: UP
cluster=mytestcluster
auto_bootstrap=False
thrift=('127.0.0.2', 9160)
binary=('127.0.0.2', 9042)
storage=('127.0.0.2', 7000)
jmx_port=7200
remote_debug_port=0
initial_token=-3074457345618258603
pid=22484
C:\Users\myusername>ccm node3 show
node3: UP
cluster=mytestcluster
auto_bootstrap=False
thrift=('127.0.0.3', 9160)
binary=('127.0.0.3', 9042)
storage=('127.0.0.3', 7000)
jmx_port=7300
remote_debug_port=0
initial_token=3074457345618258602
pid=6308https://stackoverflow.com/questions/34199466
复制相似问题