how to start cassandra server - powershell

I'm trying to start cassandra server
C:\Program Files\DataStax Community\apache-cassandra\bin>cassandra
but it is giving me 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 object heap
Could not create the Java virtual machine.
I also tried powershell Set-ExecutionPolicy Unrestricted but still gives some errors... like
C:\Program Files\DataStax Community\apache-cassandra\bin>powershell Set-ExecutionPolicy Unrestricted
C:\Program Files\DataStax Community\apache-cassandra\bin>cassandra
Detected powershell execution permissions. Running with enhanced startup scripts.
This following statement comes in red colour
The term '/' is not recognized as a cmdlet, function, operable program, or
script file. Verify the term and try again.
At line:1 char:2
+ /f <<<< ile C:\Program Files\DataStax Community\apache-cassandra\\bin\cassandra.ps1
If it's still not clear I attached an image:

I am studding Cassandra and I had the same issue. Follow the steps below to start it. I hope it help you.
1 - To open windows variables editor:
2 - Add the following variables according to your Java physical path (64 bits), Cassandra physical path and Java Memory Option. In my case:
JAVA_HOME = C:\Program Files\Java\jre1.8.0_221
CASSANDRA_HOME = C:\Program Files (x86)\apache-cassandra-3.11.4
_JAVA_OPTIONS = -Xmx2048‬M
3 - To open your powershell as administrator
4 - Access your Cassandra folder:
5 - Execute the command ".\cassandra" then your cassandra will start.

Powershell permissions
As the error states, you need to grant Powershell permissions to the Windows account running the Cassandra script.
You can grant permissions to all Windows accounts on your machine with:
C:\> powershell Set-ExecutionPolicy Unrestricted
WARNING: You need to run the command prompt as an administrator for the command above to work.
As an alternative, you can grant unrestricted access just for your current user with:
C:\> powershell Set-ExecutionPolicy -Scope CurrentUser Unrestricted
Heap size
As a side note, this error indicates that you don't have enough RAM on your machine to run Cassandra with the default configuration:
Error occurred during initialization of VM
Could not reserve enough space for object heap
My guess is that your laptop/desktop only has 8GB of RAM. By default, Cassandra will attempt to start with 2GB of memory allocated to the heap but if there isn't enough free memory, Java will fail to reserve it.
Try to start Cassandra with a more conservative allocation of 1GB for max heap size and 400MB for NewGen by uncommenting the following lines in the "Heap Settings" section of conf/jvm.options:
-Xms1G
-Xmx1G
-Xmn400M
Windows support
I wanted to let you know that there is very limited Windows support in Cassandra 3.11 and there are several known issues that will not be fixed due to limitations in the operating system.
Furthermore, Windows support has been completely dropped in Cassandra 4.0 due to lack of maintainers and testing (CASSANDRA-16171).
As a workaround, we recommend the following:
Deploy Cassandra in Docker
Deploy Cassandra in a VM using software like VirtualBox
Deploy K8ssandra.io
If you just want to build apps with Cassandra as a backend, Astra DB has a free tier that lets you launch a Cassandra cluster in a few clicks with no credit card required. Cheers!

Related

Basic commands (db2level) not running on no cost Db2 Community Edition 11.5.5 (latest)

The previous DB2 Express-C versions were working fine over the years, but the basic commands not running on no cost Db2 Community Edition 11.5.5 (latest) .
after installing the Db2 Community Edition 11.5.5, when running the db2level command, it gives the error:
SQL1022C There is not enough memory available to process the command.
and below links didn't help:
https://www.ibm.com/support/pages/error-sql1022c-there-not-enough-memory-available-process-command-after-changing-hostname-db2-server
https://www.ibm.com/support/pages/running-db2level-db2-command-window-returning-sql1022c
Some my findings are:
db2set' not working - DBI1302E Invalid parameter detected.
'db2set -all' working - DB2_EXTSECURITY=YES
'db2level' - SQL1022C There is not enough memory available to process the command.
'db2start' not working - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.
DB2 icon not presented on taskbar
db2 get dbm cfg | find "SYSADM" - not working (no output)
db2 get dbm cfg - DB21018E A system error occurred. The command line processor could not continue processing.
db2 update dbm cfg using sysadm_group DB2ADMNS - DB21018E A system error occurred. The command line processor could not continue processing.
Followed the same recommended steps (for DB2 installation) as being following since DB2 9.7 version (on WIN 8.1 machine + RAM 8 GB).
My logged-in user is machine administrator
The supplied user is 'db2admin'
Now on the problem machine, OS is Windows 10 Pro + RAM 8 GB.
Ran the setup.exe after extracting the downloaded zip
From the DB2 Setup Launchpad > Install a Product > DB2 Version 11.5.5.0 Server Editions > Install Now > then installed with all default settings
DB2 setup installed successfully but DB2 commands not working as explained above
I had the same issue but after installing db2 with administrator privileges (starting setup.exe as an admin) the issues were gone and everything was set up as expected.

Cannot connect Firebird in IBexpert

I have installed Firebird 3.0.2 (x64) and IBExpert 2018.12.15.1.
I'm trying to create a Firebird DB on IBExpert but everytime getting this error:
Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
Error loading plugin Engine12.
Module C:\Program Files\Firebird\Firebird_Server\plugins/Engine12 exists but can not be loaded.*
My configuration:
Server/Protocol
Local, XNet (FB3)
Database
C:\Data\Example.fdb
Connection string
xnet://C:\Data\Example.fdb
Client Library File
C:\Program Files\Firebird\Firebird_Server\WOW64\fbclient.dll
Username
SYSDBA
Password
masterkey
Page size
126384
SQL Dialect 3
How to solve this problem?
This happens to me when I select the firebird fbclient dll from the following location
C:\Program Files\Firebird\Firebird_3_0\WOW64\fbclient.dll
However if I instead (against all sanity and reason) chose what I think ought to be a 64 bit dll, from c:\windows\system32, it works.
ie, client choice:
c:\windows\system32
Now it might seem logical to some readers that system32 could contain a 32 bit dll, but actually almost every dll in there, and probably EVERY dll in there SHOULD be 64 bit, on windows 64 bit systems. However I am guessing that whatever is in there must be a 32 bit fbclient.dll in the main windows 10 system directory.
Microsoft made a now ancient but at the time, kind of odd decision that c:\windows\system32 will be full of 64 bit stuff on Windows XP 64 bit, and has kept it that way. It appears to me there's something wrong with Firebird 3.0.4's installer team's decisions.

Failed to load sql modules into the database cluster during PostgreSQL Installation

I have attempted to install PostgreSQL 9.4 and 8.4 multiple times and it is failing no matter what I have tried. I am attempting to install on Windows 7 SP1 x64. After each failed install I have uninstalled and deleted the installation folder to start fresh.
Each time I attempt the install I get an error pop up near the end of installation that says:
"failed to load sql modules into the database cluster".
Then another error pop up displays immediately after that says:
"Error running post install step. Installation may not complete correctly. Error reading C:/Program Files/PostgreSQL/9.4/postgresql.conf"
I have attempted installation with the following actions:
Always installed as administrator
Turned off all virus protection and windows firewall
Changed the installation directory to something other than the Program Files directory.
Changed the data directory to something other than the installation directory of postgres
None of the actions above have helped and I always receive the error. Any help that someone can provide would be greatly appreciated!
Encountered a very similar problem that OP is reporting today while installing Postgres 9.4.
It turns out that the password generator I was using has made a password that contains non-alphanumeric characters. ("^") I believe was the culprit in this case. Removing that allowed the installation of Postgres 9.4 (Windows 64 bit) to complete.
Very easy fix once you've found it, but the error message that comes up is not descriptive, so in this case I didn't notice at first what I was doing wrong.
I was getting this same error when trying to install PostgreSQL v9.4.4 on Windows 10 Pro. Starting with a solution hosted on Stack Exchange, I came up with the following steps that allowed the installer to run successfully:
1) Create a new user account, called postgres
2) Add the new account to the Administrators and Power Users groups
3) Restart the computer
NOTE: I added step #3, since step #4 didn't work without it
4) Run a command prompt as the postgres user, using the command:
runas /user:postgres cmd.exe
5) Run the installer from the postgres command window
6) Delete the postgres user account, as well as the user directory
NOTE: I added step #6, since the postgres account is not required after installation
What worked for me is, during the install, specifying a Postgre SQL data folder that's outside of any Windows user profile directory (C:\Users), such as C:\postgres-data.
My setup:
Win 10 Pro
PostgreSQL 9.5 RC1
I ran into this issue when I tried setting PostgreSQL's data directory somewhere under my user profile's directory, such us somewhere under "My Documents".
I tried Jeff G's solution and it didn't work at first. It worked only when I kept the data directory as the default (C:\Program Files\PostgreSQL\9.5\data). So then I tested further and tried setting the data directory to somewhere outside of any user profile directories (i.e. somewhere that isn't under C:\Users). For example, C:\postgres-data and this worked.
I then just tried using that directory with my default user, and not bothering with the postgres temp user as outlined in Jeff G's solution and that also worked. So in the end, it had to do with my data directory being somewhere under C:\Users. As long as it was outside of that, it worked.
None of these answers here helped me, finally I solved this problem by creating the folder before the installation (C:\PostgreSQL\data) and giving it full access for the group "Users".
Windows 7 x64, postgresql-9.5.2-1-windows-x64
Hope It's Work.
1.)Uninstall PostgreSQL
2.)Delete the postgres user if it still exists :
net user postgres /delete
3.) Create the postgres user with a password you can remember:
net user /add postgres
4.) Add the postgres user to the Administrators group:
net localgroup administrators postgres /add
5.) Add the postgres user to the Power Users group
net localgroup "power users" postgres /add
6.) Run a command window as the postgres user:
runas /user:postgres cmd.exe
7.) Change user postgres and install postgresql
8.)Back your and remove the postgres user from the Administrators group.
net localgroup administrators postgres /delete
I had the same error ("Failed to load SQL modules into the database cluster.") when installing on W2K12R2 using the EnterpriseDB installer linked to from the PostgreSQL Windows download page. I tried running the installer with admin privs, and using the postgres-user solution offered by Jeff G, but neither worked. Finally I tried the second installer, BigSQL, and that installed without issue.
When installing PostgreSQL, do not use the following symbols in your database's admin password: %, <, and >.
Bug report and problem solution here
Changed the data directory to something other than the installation directory of postgres
Make sure NETWORK SERVICE has read/write permissions on that folder, the installation was failing for me until I did this.
I had this issue too with 9.5 and got around it by:
Installing with the default data folder.
Making sure my new data folder had full control access for the "NETWORK SERVICE" account.
Then changing the default PGDATA folder as per this instruction: https://wiki.postgresql.org/wiki/Change_the_default_PGDATA_directory_on_Windows
I had the same problem, and noticed that some Postgres .bat files were opening in a text editor. Text editors opening files during installation isn't too uncommon, but I noticed these batch files were setting directory permissions. I then found that .bat files were set to open in a text editor (Notepad++) by default. I changed the default program for .bat files, uninstalled Postgres, re-ran the installer, and it worked perfectly. Hope this helps.
I had the same problem before. I solved this by installing Visual Studio C++ Express first.
I had the same experience as #gomisha. #Jeff G's solution did not work for me no matter which user ran the installer.
As long as the target data directory was anywhere under c:\users, the install or database cluster init would fail.
I was successful after creating c:\postgresql-data and ensuring that the postgres user had full access in the 'effective access' tool.
Note: I did not use control userpasswords2 to set up the postgres user; I did it through the traditional crappy Windows 10 user wizard that tries to make the user sign up for hotmail. I did run the install as postgres.
I was getting this issue with the BigSQL windows installer PostgreSQL-9.6.5-1-win64-bigsql.exe
The problem turned out to be that my system path was too long. After removing some uncessary junk from my System Path, and then reinstalling, the problem was gone.
One of the answers here is the only thing that worked on my machine:
I had the same error message when trying to install 9.2.4. My issue
was because even though the Win2k8 server had %SYSTEMROOT%\system32 as
part of the path, no programs could "see" anything in
C:\Windows\system32. The installer heavily uses icacls.exe during the
init routine. Since my path was screwed up, the installer bombed out.
Once I explicitly added C:\Windows\system32 to the SYSTEM's Path
environment variable and re-ran the installer as an admin, everything
worked fine.
Credits to the user.
Go to services.msc
Search for postgres service
Go to Log On tab
Select local account
Profit
The alternative solution for problems with PostgreSQL installer is setting this up with a Docker.
Install Docker Desktop
https://www.docker.com/products/docker-desktop/
Start installed Docker Desktop
In PowerShell, run:
docker pull postgres
In PowerShell, run:
docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=mypassword postgres
Now you can connect to the Postgres server for example with pgAdmin on the same machine, using:
host: localhost
port: 5432
maintenance database: postgres
username: postgres
password: mypassword
I think this would be better as individual comments above, but I don't have the required rep. I just spent days on this, with Postgres 10 on Win 10 Creators. My "answer" was to let Postgres put the data in its default install folder instead of my User folder (where it would be automatically backed-up).
1. This problem can happen with no reported install errors at all. On my very first try, I saw:
Failed to load SQL modules into the database cluster.
But that seemed to be due to:
Executing C:\Users\loren\AppData\Local\Temp\postgresql_installer_aee8e5a76f\vcredist_x64.exe /passive /norestart
Script exit code: 3010
MSI (s) (AC:FC) [14:21:35:341]: Product: Microsoft Visual C++ 2013 x86 Minimum Runtime - 12.0.40660.
Restart required. The installation or update for the product required a restart for all changes to take effect.
The restart was deferred to a later time.
Restarting Windows after the failure of the rest of the Postgres installation did not let Postgres run.
Once VC was in place, uninstalling and re-installing Postgres (still with its data in my User folder) completed with no reported errors. But every attempt to access it, by any means, still resulted in something like this:
C:\Program Files\PostgreSQL\10\bin>psql
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
The RawCap sniffer showed TCP SYN followed immediately by RST,ACK on localhost for both v4 and v6 for each try. Netstat did not see port 5432 in use at all. All Postgres runtime logs were totally empty. In Windows Services, I could manually start the postgresql-x64-10 service, but it immediately stopped itself, with the note that some services do that normally.
2. I tried moving the data directory via the Postgres wiki procedure. Apparently for Postgres 10 it is incomplete. It does not deal with:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10\Data Directory
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\postgresql-x64-10\Data Directory
C:\Program Files\PostgreSQL\10\pg_env.bat
C:\Program Files\PostgreSQL\10\scripts\serverctl.vbs
But fixing every data file instance I could find did not let it run. And even after fixing all those, and uninstalling and re-installing again with the default location, the new pgAdmin4 somehow still remembered my original User data directory location!
3. I did not try giving NETWORK SERVICE read/write permissions on my User folder. Once the default install worked I wanted to get on with my original project... Maybe that would have worked.

Adplus dump creation failed - access is denied

I'm trying to get a dump to debug some memory issues in ASP.NET processes (Windows 2003 R2 SP2 x64):
adplus -hang -o f:\dumps -pn w3wp.exe -quiet
There are nine w3wp.exe (all from different websites). Everytime I run adplus as above some of the dumps fail with this error:
WriteFullMemory.Memory.Read(0x100ea0000, 0x10000) failed 0x80070005, ABORT.
Dump creation failed, Win32 error 0n5
"Access is denied."
The failure seems to be random (or I should say I can't find the reasons), i.e. sometimes some processes dump fine and sometimes they fail with this error. Things I checked:
I do have full administration permissions
There is plenty space on the target hard drive
I disabled pinging and failure protection on IIS to prevent IIS from killing the processes while adplus is dumping.
Anything else I should check? Has anyone else run into this issue? Adplus version is 7.01.002 (02/27/2009) (downloaded a couple of days ago from the latest SDK)
This is because of inaccessible memory read failure. To avoid this you could use something like cdb/windbg and use .dump /mA command to generate full memory dump.
The .dump /mA same as .dump /ma except that it will ignore inaccessible memory read failure and continue minidump generation.
.dump options
The /mA option is equivalent to /ma
except that it ignores any failure to
read inaccessable memory and continues
generating the minidump.
HTH
It wouldn't matter if you are a member of admin you would still need to elevate privileges.
ADPlus needs to be run from a command prompt running under a local administrator account with elevated privileges. If you fail to do this, the dump file may not be created.

Changing the 'Server Collation' after installation

I want to change the Server Collation of SQL Server 2008 R2
As all opinions says (including MSDN) the following command should be executed:
E:\setup.exe /q /ACTION=RebuildDatabase /INSTANCENAME=MSSQLSERVER /SAPWD=”**″ /SQLSYSADMINACCOUNTS=”HEREISMYPROBLEM” /SqlCollation=SQL_Latin1_General_CP1_CI_AS
As I Pointed, my problem is with the SYSADMINACCOUNT paremeter because the error that I get is:
The Windows account ”blablabla” does not exist and cannot be provisioned as a SQL Server system administrator.
I tried all possible windows accounts that may be, but It's not working.
Please can you guide me how to know my correct windows account.
The MSDN link that shows this problem is
here
This page describes the switches and says to use "DOMAIN\User" format, for example:
BUILTIN\Administrators MyDomain\MyUser
For anyone else that gets stuck with this problem and cant find an answer. The commands work you just need to run cmd as an administrator for it to work.
Use this batch file for change collation on SQL Server 2008
But you need edit batch file for set you instance and target collation.
Stop SQL Server Service when you run this file
File need Run as administrator
If don't work well (maybe access problem), you can use cmd (Run as admin) and run batch file steps on cmd