Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra Powershell Issue

I'm trying to start Cassandra on my Windows laptop and I'm seeing 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 and set the ExecutionPolicy to Unrestricted and I get the following:

error from powershell

So I follow this to the registry entry which is described in the error and it seems the key is already set correctly. Am I just missing something obvious? The previous version of Cassandra ran perfectly on my machine, but ever since I updated, this is giving me all kinds of issues.

like image 959
user3270760 Avatar asked Mar 25 '15 15:03

user3270760


2 Answers

You must allow the execution of PowerShell Scripts on Windows 7. The default execution policy of PowerShell is called Restricted. In this mode, PowerShell operates as an interactive shell only.

On PowerShell open C:\Windows\system32 directory, and run the command

Set-ExecutionPolicy Unrestricted

Also, it’s a serious security risk if you forget to set the Execution Policy back to Restricted mode.

So, in the same directory don'tforget to run

Set-ExecutionPolicy Restricted

For detailed information click here

like image 97
Semih Eker Avatar answered Sep 22 '22 08:09

Semih Eker


"Restricted" is the default policy.

Run the below command to get the policy

Get-ExecutionPolicy -Scope CurrentUser

Run the below to set unrestricted 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

like image 30
Mathi Avatar answered Sep 19 '22 08:09

Mathi