Error CREATEing SolrCore 'new_core': coreNodeName missing - solr

I have hosted Bitnami helm chart for Apache Solr in our dev cluster and when I tried to create a new core it says ,
Error CREATEing SolrCore 'new_core': coreNodeName missing {schema=schema.xml, dataDir=data, config=solrconfig.xml}
So, from official documentation, this and this link, I came to know that I have to set legacyCloud true.
So, I have logged into my zookeeper pod, and when i ran the command
/opt/bitnami/zookeeper/bin/zkCli.sh -zkhost apachesolr-dev-zookeeper:2181 -cmd clusterprop -name legacyCloud -val true
It threw the following error,
I even tried replacing host with localhost/ 127.0.0.1 and it says command not found.
After trying for 5 hours of various approaches, I am requesting for the help as in where I am doing it wrong.
Connecting to localhost:2181
ZooKeeper -server host:port -client-configuration properties-file cmd args
addWatch [-m mode] path # optional mode is one of [PERSISTENT, PERSISTENT_RECURSIVE] - default is PERSISTENT_RECURSIVE
addauth scheme auth
close
config [-c] [-w] [-s]
connect host:port
create [-s] [-e] [-c] [-t ttl] path [data] [acl]
delete [-v version] path
deleteall path [-b batch size]
delquota [-n|-b|-N|-B] path
get [-s] [-w] path
getAcl [-s] path
getAllChildrenNumber path
getEphemerals path
history
listquota path
ls [-s] [-w] [-R] path
printwatches on|off
quit
reconfig [-s] [-v version] [[-file path] | [-members serverID=host:port1:port2;port3[,...]*]] | [-add serverId=host:port1:port2;port3[,...]]* [-remove serverId[,...]*]
redo cmdno
removewatches path [-c|-d|-a] [-l]
set [-s] [-v version] path data
setAcl [-s] [-v version] [-R] path acl
setquota -n|-b|-N|-B val path
stat [-w] path
sync path
version
whoami
Command not found: Command not found apachesolr-dev-zookeeper:2181
2022-11-03 15:42:34,114 [myid:] - ERROR [main:o.a.z.u.ServiceUtils#42] - Exiting JVM with code 127

You can do two things :
create the core from terminal/command-line.
you need to create the folder with the core name into {SOLR_PATH}/server/solr/ location and then need to add the conf files and create an empty data folder also, then it will work from solr admin.

Related

How run solr from command line?

I run:
solr#server:~$ /usr/lib/jvm/java-8-oracle/bin/java -server -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/solr/logs/solr_gc.log -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Djetty.home=/opt/solr/server -Dsolr.solr.home=/var/solr/data -Dsolr.install.dir=/opt/solr -Dlog4j.configuration=file:/var/solr/log4j.properties -Xss256k -XX:OnOutOfMemoryError=/opt/solr/bin/oom_solr.sh 8983 /var/solr/logs -jar /opt/solr-5.5.4/server/start.jar --module=http
And I get an error:
Error: Could not find or load main class 8983
As suggested by #MatsLindh, use solr script.
In terminal navigate to /opt/solr.
cd /opt/solr
you can see solr.sh file inside bin folder and hit the below command
bin/solr start
For other options use help command
bin/solr -h

How do I delete all data from a Solr collection?

I'd like to delete all of the indexed data in my Solr collection, preferably via a shell command on one of the nodes itself. How can I do that?
If you have access to the shell, use the solrctl command with the following options:
solrctl collection --deletedocs <collection-name>
Here's the full usage output from solrctl --help for reference:
usage: /usr/bin/solrctl [options] command [command-arg] [command [command-arg]] ...
Options:
--solr solr_uri
--zk zk_ensemble
--help
--quiet
Commands:
init [--force]
instancedir [--generate path]
[--create name path]
[--update name path]
[--get name path]
[--delete name]
[--list]
collection [--create name -s <numShards>
[-c <collection.configName>]
[-r <replicationFactor>]
[-m <maxShardsPerNode>]
[-n <createNodeSet>]]
[--delete name]
[--reload name]
[--stat name]
[--deletedocs name]
[--list]
core [--create name [-p name=value]...]
[--reload name]
[--unload name]
[--status name]
If you don't have direct access, you can use Solr's update services as described here, here, and here.
you can use below command for command prompt
curl http://<ip_address>:8983/solr/<collection_name>/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8';

Graphviz and dot path

Im trying to use schemaspy to generate a mssql db schema.
I have the following:
Schemaspy_5.0.0
Graphviz2-38
jtds-1.3.1 as mssql driver
SchemaspyGUI
after clic start the schema on schemaspy, this is the command schemaspGUI generates:
java -jar "C:\Esquema\schemaSpy_5.0.0.jar" -dp "C:\Esquema\jtds-1.3.1-dist\jtds-
1.3.1.jar" -t mssql-jtds -db database -all -host LOCAL.LOCALHOST -port 1433 -u genaro
-connprops "C:\Esquema\properties\mssql-jtds.properties" -o "C:\Esquema\database" -hq
It displays this message:
Failed to query Graphviz version information
with: dot -V
java.io.IOException: Cannot run program "dot": CreateProcess error=2, El sistema no
puede encontrar el archivo especificado
In the graphviz download page says that you must add dot to your path, but after a long search i cant figure out how to add it.
Since my PATH is already polluted enough, I tried hacking the SchemaSpyGUI text boxes to inject the -gv parameter into the schemaspy command line.
On the Output Options tab, in the Output Directory textbox, end the output path with a " and a space, then -gv "C:\Path\To\Graphviz\NotTheBinFolder
and no closing ", because this is added by SchemaSpyGUI
Like so:

nagios Check result path is not a valid directory

i'm getting error when i run below command
nagios3 -v /etc/nagios3/nagios.cfg
Error in configuration file '/etc/nagios3/nagios.cfg' - Line 469 (Check result path is not a valid directory) Error processing main config file
So i looked ls -l /var/lib/nagios3/
drwxr-x--- 3 nagios nagios 1024 Mar 14 21:13 spool
In this case, why i'm getting error? Probably i think my /var/lib/nagios3/spool/checkresult/check2JcDx5 file contains wrong line. And when i run below command, i get this output.
#cat check2JcDx5
file_time=1363378360
host_name=localhost
service_description=HTTP
check_type=0
check_options=0
scheduled_check=1
reschedule_check=1
latency=0.122000
start_time=1363378360.122234
Disable SELinux:
# getenforce
# setenforce 0
Edit /etc/selinux/config. Set SELINUX=disabled.
You may be able to install the nagios-selinux package to add the policy to run nagios in an selinux environment. Better than disabling your existing security.

How to spilt a 4GB .sql file into smaller files

I have a 4GB sql data script of my database. I want to execute it but SQL Server Management Studio does allow me to do it because it's a very big file.
So I want to split this file into smaller files so that I can execute it. I have googled it but didn't get any good solutions. I have also used HJSplit to split the files but only first split file is in correct format but others are not in correct format due to which can not be execute in SQL query Interface.
Please help me guys how can I execute this .sql file with data with or without splitting?
use the sqlcmd tool to execute the file..
sqlcmd -S myServer\instanceName -i C:\myScript.sql
or
sqlcmd -S <server> -i C:\<your file here>.sql -o
Just replace with the location of your SQL box and with the name of your script. Don't forget if you're using a SQL instance the syntax is:
sqlcmd -S \instance.
Here is the list of all arguments you can pass sqlcmd:
Sqlcmd [-U login id] [-P password]
[-S server] [-H hostname] [-E trusted connection]
[-d use database name] [-l login timeout] [-t query timeout]
[-h headers] [-s colseparator] [-w screen width]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-c cmdend] [-L[c] list servers[clean output]]
[-q "cmdline query"] [-Q "cmdline query" and exit]
[-m errorlevel] [-V severitylevel] [-W remove trailing spaces]
[-u unicode output] [-r[0|1] msgs to stderr]
[-i inputfile] [-o outputfile] [-z new password]
[-f | i:[,o:]] [-Z new password and exit]
[-k[1|2] remove[replace] control characters]
[-y variable length type display width]
[-Y fixed length type display width]
[-p[1] print statistics[colon format]]
[-R use client regional setting]
[-b On error batch abort]
[-v var = "value"...] [-A dedicated admin connection]
[-X[1] disable commands, startup script, enviroment variables [and exit]]
[-x disable variable substitution]
[-? show syntax summary]

Resources