Free Download Apache for Mac Os X Updated
Free Download Apache for Mac Os X
If you use Mac OS X as your platform for evolution piece of work, then you may exist interested to know how easy it is to use Apache Cassandra on the Mac. The following shows y'all how to download and setup Cassandra, its utilities, and as well use DataStax OpsCenter, which is a browser-based, visual management and monitoring tool for Cassandra.
Download the Software
DataStax makes available the DataStax Community Edition, which contains the latest customs version of Apache Cassandra, along with the Cassandra Query Language (CQL) utility, and a gratis edition of DataStax OpsCenter. To get Datastax Community Edition, go to Planet Cassandra and download both Cassandra and OpsCenter, and select the tar downloads of both the DataStax Community Server and OpsCenter. Yous tin can besides employ the curl control on Mac to direct download the files to your automobile. For case, to download the DataStax Customs Server, you could enter the following at terminal prompt: curl -OL http://downloads.datastax.com/community/dsc.tar.gz
Install Cassandra
One time your download of Cassandra finishes, motion the file to whatsoever directory you'd similar to use for testing Cassandra. Then uncompress the file (whose proper name will alter depending on the version yous're downloading):
tar -xzf dsc-cassandra-1.2.2-bin.tar.gz
Then switch to the new Cassandra bin directory and start upwardly Cassandra:
robinsmac:dev robin$ cd dsc-cassandra-1.2.ii/bin robinsmac:bin robin$ sudo ./cassandra robinsmac:bin robin$ INFO 14:49:57,739 Logging initialized INFO xiv:49:57,750 JVM vendor/version: Coffee HotSpot(TM) 64-Fleck Server VM/1.6.0_35 INFO 14:49:57,750 Heap size: 2093809664/2093809664 INFO xiv:49:57,751 Classpath: . . INFO 14:49:59,208 Completed flushing /var/lib/cassandra/data/system/schema_columns/arrangement-schema_columns-ib-2-Data.db (210 bytes) for commitlog position ReplayPosition(segmentId=1362167398602, position=53130)
At present that y'all have Cassandra running, the side by side thing to do is connect to the server and begin creating database objects. This is done with the Cassandra Query Language (CQL) utility. CQL is a very SQL-like language that lets you lot create objects as you're likely used to doing in the RDBMS globe. The CQL utility (cqlsh) is in the same bin directory as the cassandra executable:
robinsmac:bin robin$ ./cqlsh Continued to Test Cluster at localhost:9160.
[cqlsh 2.3.0 | Cassandra ane.two.ii | CQL spec iii.0.0 | Austerity protocol 19.35.0]
Use HELP for assistance. cqlsh>
Cassandra has the concept of a keyspace, which is similar to a database in a RDBMS. A keyspace holds information objects and is the level where y'all specify options for a information division and replication strategy. For this brief introduction, we'll just create a basic keyspace to concur some example data objects we'll create:
cqlsh> create keyspace dev ... with replication = {'class':'SimpleStrategy','replication_factor':1}; At present that you have a keyspace created, it'southward time to create a data object to shop data. Considering Cassandra is based on Google Bigtable, yous'll apply column families /tables to store data. Tables in Cassandra are like to RDBMS tables, but are much more flexible and dynamic. Cassandra tables have rows like RDBMS tables, but they are a sparse column type of object, significant that rows in a cavalcade family tin can have different columns depending on the data you want to shop for a particular row. Allow's create a base tabular array to hold employee information:
cqlsh> use dev; cqlsh:dev> create table emp (empid int primary fundamental, ... emp_first varchar, emp_last varchar, emp_dept varchar); cqlsh:dev>
The column family is named emp and contains four columns, including the employee ID, which acts as the main key of the table. Note that a cavalcade family must have a primary cardinal that's used for initial query activity. Let's at present go alee and insert data into our new column family using the CQL INSERT command:
cqlsh:dev> insert into emp (empid, emp_first, emp_last, emp_dept) ... values (i,'fred','smith','eng');
Notice how Cassandra's CQL is literally identical to the RDBMS INSERT command. Other DML statements are also:
cqlsh:dev> update emp set emp_dept = 'fin' where empid = i;
Querying data uses the familiar SELECT argument:
cqlsh:dev> select * from emp; empid | emp_dept | emp_first | emp_last ------+----------+-----------+---------- 1 | fin | fred | smith
All the same, look what happens when you try to use a WHERE predicate and reference a non-primary key column:
cqlsh:dev> select * from emp where empid = 1; empid | emp_dept | emp_first | emp_last ------+----------+-----------+---------- 1 | fin | fred | smith cqlsh:dev> select * from emp where emp_dept = 'fin'; Bad Asking: No indexed columns nowadays in by-columns clause with Equal operator
In Cassandra, if you want to query columns other than the primary cardinal, you need to create a secondary index on them:
cqlsh:dev> create alphabetize idx_dept on emp(emp_dept); cqlsh:dev> select * from emp where emp_dept = 'fin'; empid | emp_dept | emp_first | emp_last ------+----------+-----------+---------- 1 | fin | fred | smith
Installing and using DataStax OpsCenter
Installing DataStax OpsCenter on Mac involves working through the following steps in a final window:
- Untar the package (
tar –xzf) in the directory you want to apply for OpsCenter. - Change directories to the OpsCenter home bin directory, and run the
./setup.pyscript. - Y'all can now start the chief OpsCenter process in the background by entering the command
./opscenter &from the bin directory. - At present you lot demand to become the agent configured to monitor the Cassandra instance you likely already have running on your Mac. Modify to the agent/bin directory and run the setup script passing the localhost IP (normally 127.0.0.1) twice:
./setup 127.0.0.1 127.0.0.ane. - Start the agent from the agent/bin directory:
./datastax-agent. - Open up either a Firefox, Chrome, or Safari spider web browser and enter the following in the address bar: http://127.0.0.1:8888/opscenter/index.html.
Conclusion
That's it – you've now got Cassandra and DataStax OpsCenter installed and running on your Mac. For other software such as various application drivers and client libraries, visit the DataStax downloads page.
Free Download Apache for Mac Os X
Posted by: skippermuseem.blogspot.com
