Cassandra Powershell Problem

I try to run Cassandra on my windows laptop and I see the following error:

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 Starting Cassandra Server Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap 

So, I opened Powershell to try to set ExecutionPolicy unlimited, and I get the following:

error from powershell

So, I follow this in the registry entry, which is described in the error, and it seems that the key is already installed correctly. Did I just miss something obvious? The previous version of Cassandra worked fine on my machine, but since I updated, it gives me all kinds of problems.

+6
source share
4 answers

By chance, you are using the 64-bit powershell.exe file, but is Cassandra trying to use the 32-bit powershell.exe file, or vice versa?

"C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \ powershell.exe"

vs

"C: \ Windows \ SysWOW64 \ WindowsPowerShell \ v1.0 \ powershell.exe"

-1
source

You can go and change Xmx to a smaller heap size .....
E.g. search JAVA_OPTS in file CASSANDRA_HOME \ bin \ cassandra.bat
......
set JAVA_OPTS = -ea ^
-javaagent: "% CASSANDRA_HOME% \ Lib \ Jamm-0.3.0.jar" ^
-Xms2G ^
-Xmx2G ^
......


-Xms1G ^
-Xmx1G ^

-1
source

"Limited" is the default policy.

Run the command below to get the policy

 Get-ExecutionPolicy -Scope CurrentUser 

Run below to set unlimited policy

 Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser 

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1&viewFallbackFrom=powershell-Microsoft.PowerShell.Core

-1
source

Run the CMD prompt as an administrator. Then:

 C:\your\path\to\C*\root>bin\cassandra.bat run 

Works on my windows box

-2
source

Source: https://habr.com/ru/post/984239/


All Articles