Code Monkey home page Code Monkey logo

scylla-code-samples's Introduction

Scylla Code Samples

This repository holds ScyllaDB usage examples, from simple to more complex.

Adding a new example

Add a new directory with your example. Each example (directory) should have a README.md file with the following:

  • Short description of the example
  • How to build the example
  • Prerequisites
  • The version of ScyllaDB, and other packages, used in the example. I.E.:
    • ScyllaDB 5.2
    • Spark 2.0.2
  • How to clean up the installation

Contributions should be submitted as pull requests.

Further reading

Many of the examples are explained in detail in the Mutant Monitoring System (MMS) and Integrations course on ScyllaDB University.

You can ask questions and discuss these code samples in the ScyllaDB community forum and on the Slack channel.

scylla-code-samples's People

Contributors

alfex4936 avatar dmcken avatar dorlaor avatar dyasny avatar fruch avatar glommer avatar guy9 avatar hludde avatar hopugop avatar informalict avatar iravid avatar ivenn-scylladb avatar jul-stas avatar lorak-mmk avatar mkorolyov avatar mmatczuk avatar mses-bly avatar nsipplswezey avatar roydahan avatar sergeylanzman avatar sevamorotskiy avatar sharonovd avatar siculars avatar snowch avatar tarzanek avatar tgrabiec avatar tomer-sandler avatar tzach avatar vladzcloudius avatar zimnx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scylla-code-samples's Issues

Process is exiting without the error for the Strucutred Streaming to ScyllaDB data sending module

Hello all I am new to this , I have read a Stream and then I want to select some fields and push that strucutred Stream to ScyllaDb please tell me where I am making a mistake.

import org.apache.spark.sql.functions._
import org.apache.spark.sql.types.{DataTypes, IntegerType, StringType, StructType}
import org.apache.spark.sql.SaveMode
import org.apache.spark.sql.streaming.OutputMode
import org.apache.spark.sql.{SQLContext, SparkSession}
import org.apache.spark.sql.execution.streaming.Sink
import org.apache.spark.sql.sources.StreamSinkProvider
import org.apache.spark.sql.{functions => f, DataFrame}
import org.apache.spark.sql.cassandra._

object StreamProcessor {
def main(args: Array[String]): Unit = {
new StreamProcessor().process()
}
}

class StreamProcessor {

def process(): Unit = {
val spark = SparkSession.builder()
.config("spark.eventLog.enabled", "false") // 3 lines included later
.config("spark.driver.memory", "2g")
.config("spark.executor.memory", "2g")
.config("spark.sql.catalog.cass100", "com.datastax.spark.connector.datasource.CassandraCatalog")
.config("spark.sql.catalog.cass100.spark.cassandra.connection.host", "192.168.144.23")
.appName("kafka-tutorials")
.master("local[*]")
.getOrCreate()

spark.sparkContext.setLogLevel("DEBUG")

// spark.conf.set("spark.sql.catalog.cass100", "com.datastax.spark.connector.datasource.CassandraCatalog")
// spark.conf.set("spark.sql.catalog.cass100.spark.cassandra.connection.host", "192.168.144.24")

val jsonSchema = new StructType()
.add("@type", DataTypes.StringType).add("1", DataTypes.IntegerType)
.add("2", DataTypes.IntegerType)
.add("8", DataTypes.StringType).add("12", DataTypes.StringType)
.add("7", DataTypes.StringType).add("11", DataTypes.StringType)
 .add("4", DataTypes.StringType).add("6", DataTypes.StringType)
.add("27", DataTypes.StringType).add("28", DataTypes.StringType)
.add("152", DataTypes.StringType).add("153", DataTypes.StringType)
.add("0", DataTypes.StringType).add("subTemplateMultiList",DataTypes.StringType)

import spark.implicits._
val outputTopic = "test"
val inputTopic= "ipfix320"
val brokers= "192.168.144.93:9092"

val inputDf = spark.readStream
  .format("kafka")
  .option("kafka.bootstrap.servers", brokers)
  .option("subscribe", inputTopic)
  .load()
  .selectExpr("CAST(value AS STRING)")
  .select(from_json($"value", jsonSchema) as "value") //.where($"value.1">2000 && $"value.2">12)
  .select("value.*")
  .withColumn("timestamp", lit(current_timestamp()))

val newDf= inputDf.columns.foldLeft(inputDf)((curr, n)=>curr.withColumnRenamed(n, "c"+n.toString()))

     newDf.printSchema()

val otherDf= newDf.select(col("c12").as("src"),col("c8").as("dest"),col("c2").as("max"),col("c1").as("sum"),col("c152").as("window"))

otherDf.printSchema()

try {
  val query = otherDf
    .writeStream
    .format("ScyllaSinkProvider")
    .outputMode(OutputMode.Append)
    .options(
      Map(
        "cluster" -> "Test Cluster",
        "keyspace" -> "tls",
        "table" -> "agg",
        "checkpointLocation" -> "/tmp/checkpoints"
      )
    )
    .start()
}
catch {
  case ex:Exception=>println
}

}
}

class ScyllaSinkProvider extends StreamSinkProvider {
println("########################################HELLO############################")
override def createSink(sqlContext: SQLContext,
parameters: Map[String, String],
partitionColumns: Seq[String],
outputMode: OutputMode): ScyllaSink =
new ScyllaSink(parameters)
}

class ScyllaSink(parameters: Map[String, String]) extends Sink {
override def addBatch(batchId: Long, data: DataFrame): Unit =
data.write
.cassandraFormat(parameters("agg"),
parameters("tls"),
parameters("Test Cluster"))
.mode(SaveMode.Append)
.save()
}
And my keyspace is tls, with table agg as following on ScyllaDb :

CREATE TABLE tls.agg (
src text,
dest text,
max float,
sum float,
window text,
PRIMARY KEY (src, dest)
) WITH CLUSTERING ORDER BY (dest ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';

Please tell me why the code is getting exited without giving any error.

typos in README.md

typos in README.md
examlpe -> example
submited -> submitted
build and the example -> build the example

it's not enough to just replace name of DateTiered to TimeWindow

cd1194f
introduced a regression

since TWCS DOESN'T
have options like

'base_time_seconds': 3600, 'max_sstable_age_days': 1

so conversion per docs:

base_time_seconds: This is the size of the first window, defaults to 3600 seconds (1 hour). The rest of the windows will be min_threshold (default 4) times the size of the previous window.

max_sstable_age_days: This is the cut-off when SSTables wont be compacted anymore, if they only contain data that is older than this value, they will not be included in compactions. This value should be set to some point where you won't (frequently) read any data. In a monitoring system for example, you might only very rarely read data that is older than one year. This avoids write amplification by not recompacting data that you never read. Defaults to 365 days.

you need to rewrite it to proper https://enterprise.docs.scylladb.com/stable/cql/compaction.html#twcs-options
options

@guy9

so above translated will be cca (you cannot simulate fully)

'class' : 'TimeWindowCompactionStrategy',
  'compaction_window_unit' : 'HOURS',
  'compaction_window_size' : 1,
}

we should ideally set the default_ttl on table to make sure above won't grow over 20-50 windows
that means setting on top of above for table (but please check if it fits the MMS use case, if not warn about this being not ideal and ICS + SAG might be better) - 3600 x 20 or 3600 x 50 MAX (https://thelastpickle.com/blog/2016/12/08/TWCS-part1.html , but my experience with (older) Scylla is 13-20 windows, with newer Scylla it probably can go a bit higher)

default_time_to_live = 40 372

so that would be 20h retention for such time series data ...

[question] Kubernetes - ScyllaDB

I was taking a look at how ScyllaDB handled integration with Kubernetes and I came upon this solution. While it is very elegant and utilizes Kubernetes' built-in primitives, I have a few questions, coming from a Cassandra background:

  1. How do you handle Node / Disk failure ? Cassandra requires that you supply the IP address of the dead instance and I imagine that Scylla requires that too.
  2. Is there any mechanism for backup/restore/repair of the cluster without having to visit each node separately ?
  3. What are other limitations you have encountered with this solution that could be tackled by developing a Kubernetes operator ? Do you find that it needs manual intervention often ?

[HELM] namespace is hardcoded to default

What do I expect to see?

helm install --namespace mynamespace kubernetes-scylla

I expected to see a fully working Scylla cluster in mynamespace

What did I see instead?

The Scylla nodes didn't start successfully. The seed node couldn't be contacted

In statefulset.yaml, this line needs to be changed:

{{ template "scylladb.fullname" . }}-0.{{ template "scylladb.fullname" . }}.default.svc.cluster.local

and retrieve the namespace instead of using default

MMS GPG error

W: GPG error: http://ppa.launchpad.net/scylladb/ppa/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6B2BFD3660EF3F5B
W: The repository 'http://ppa.launchpad.net/scylladb/ppa/ubuntu xenial InRelease' is not signed.
W: GPG error: https://repositories.scylladb.com/scylla/scylladb/c9b1cee446693faf5c4e0f13ab88f854/deb/ubuntu/scylladb-2.1 xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 17723034C56D4B19
W: The repository 'https://repositories.scylladb.com/scylla/scylladb/c9b1cee446693faf5c4e0f13ab88f854/deb/ubuntu/scylladb-2.1 xenial InRelease' is not signed.

...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
W: --force-yes is deprecated, use one of the options starting with --allow instead.

While running initial docker-compose up -d command from here: https://www.scylladb.com/2017/11/30/mutant-monitoring-system-day-1/

[HELM] When pod is replaced (helm upgrade), it is decommissioned and ring is completely broken

Using HELM to setup Scylla.
If I stop my cluster or do an upgrade of the helm chart or the pods are temporarily down, I get errors :

ERROR 2018-07-02 00:05:10,045 [shard 0] storage_service - This node was decommissioned and will not rejoin the ring unless override_decommission=true has been set,or all existing data is removed and the node is bootstrapped again
ERROR 2018-07-02 00:05:10,045 [shard 0] seastar - Exiting on unhandled exception: std::runtime_error (This node was decommissioned and will not rejoin the ring unless override_decommission=true has been set,or all existing data is removed and the node is bootstrapped again)

I'm used to Cassandra. If a node is unavailable (Kubernetes might be resizing cluster or any reason), it does not matter. The node can stay DN for as long as it wants. It does not get decommissioned.
When the node comes back online and reattach it's volume, everything is back to normal.

What is Scylla's behaviour? is it compatible with Kubernetes?

Sata machine import data single thread is very slow

I install scylla with this doc:docs, withe developer mode on.
and i insert data single thread the data writing speed is "3M/min"
is there any reason ?
` public static void createTable()
{
// a,b为复合主键 a:分区键,b:集群键
String cql = "CREATE TABLE if not exists mydb.test (a text,PRIMARY KEY (a))";
session.execute(cql);
}
public static void close(){
session.close();
cluster.close();
System.out.println("close.");
}
public static void insert(String value)
{
String cql = "INSERT INTO mydb.test (a ) VALUES ('" + value + "');";
session.execute(cql);
}

public static void createKeyspace()
{
    // 单数据中心 复制策略 :1
    String cql = "CREATE KEYSPACE if not exists mydb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}";
    session.execute(cql);
}
public static  void main(String[] args) throws IOException {

    connect();
    String fileName = "vertex_person";
    File file = new File(fileName);
    BufferedReader reader = null;
    StringBuffer sbf = new StringBuffer();
    createKeyspace();
    createTable();
    try {
        reader = new BufferedReader(new FileReader(file));
        String tempStr;
        int count =0;
        while ((tempStr = reader.readLine()) != null) {
            insert(tempStr);
            count += 1;
            System.out.println(count);
        }



        }catch (Exception e){
        e.printStackTrace();
    }
    close();
}

`

MMS example use depricated DateTieredCompactionStrategy

 CREATE TABLE tracking_data ( first_name text, last_name text, timestamp timestamp, location varchar, speed double, heat double, telepathy_powers int, primary key((first_name, last_name), timestamp)) WITH CLUSTERING ORDER BY (timestamp DESC) AND COMPACTION = {'class': 'DateTieredCompactionStrategy', 'base_time_seconds': 3600, 'max_sstable_age_days': 1};

Cannot make Presto work

Following the day 3 tutorial of scylla I got an error when I want to start presto's container after building it.

cd scylla-code-samples/mms
git pull
cd presto
docker build -t presto .
docker run --name presto --network mms_web -p 8080:8080 -d presto

Then I got the error for presto :

2019-03-26T14:03:08.977Z	ERROR	main	com.facebook.presto.server.PrestoServer	null
java.lang.ExceptionInInitializerError
at sun.security.ssl.SSLSessionImpl.<init>(SSLSessionImpl.java:188)
[...] // hundred of line of at ...

I cannot launch the service on the web page.

I have docker on MacOS.

EDIT : I updated the Presto's version from 0.190 to 0.218 but nothing is working.
Everywhere I'm searching for this error it's pointed to OpenJDK 1.8.0. I try to base the image on woahbase/alpine-openjdk8:x86_64 but still the same issue.

[HELM] more than 1 seed in statefulset

I assume Scylla should run with more than one seed in production. Probably 2 minimum or 3 if running across 3 zones.

I tried to alter the statefulset as follow:

    args:
      - --seeds 
      - {{ template "scylladb.fullname" . }}-0.{{ template "scylladb.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local,{{ template "scylladb.fullname" . }}-1.{{ template "scylladb.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local,{{ template "scylladb.fullname" . }}-2.{{ template "scylladb.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local

Which is what I would do for Cassandra.
However none of the nodes will start as they refuse to unless all seeds are ready. Basically they are all waiting for each other to be ready:

ERROR 2018-07-01 23:38:03,621 [shard 0] init - Bad configuration: invalid value in 'seeds': 'scylla-scylladb-1.scylla-scylladb.vince-scylladb7.svc.cluster.local': std::system_error (error C-Ares:4, Not found)

ERROR 2018-07-01 23:38:43,300 [shard 0] init - Bad configuration: invalid value in 'seeds': 'scylla-scylladb-2.scylla-scylladb.vince-scylladb7.svc.cluster.local': std::system_error (error C-Ares:4, Not found)

How do we specify more than one seed?

Scylla readiness probe does not work

The readiness probe defined in here:

It uses exec to execute the probe script, which will always return 0.

➤ kubectl get pods scylla-2
NAME       READY   STATUS    RESTARTS   AGE
scylla-2   1/1     Running   0          15m

➤ kubectl exec scylla-2 bash /opt/ready-probe.sh
command terminated with exit code 1

➤ kubectl exec scylla-2 -- bash -c exec /opt/ready-probe.sh
(returned 0 here)

➤ kubectl get pods scylla-2 -ojsonpath='{.spec.containers[].readinessProbe}'
map[exec:map[command:[/bin/bash -c exec /opt/ready-probe.sh]] failureThreshold:3 initialDelaySeconds:15 periodSeconds:10 successThreshold:1 timeoutSeconds:5]

For the "manager" code sample, the S3 bucket is not created in minio container

When the "manager" code sample is used, the Docker configuration does not create the S3 bucket in the minio container. This causes errors to be seen when the backup command is run.

Steps to reproduce

Follow the instructions on the Monitoring and Manager Lab in Scylla University.

  1. Clone the repo:
git clone https://github.com/scylladb/scylla-code-samples.git
  1. Change to the "manager" directory in the repo:
cd scylla-code-samples/manager
  1. Build the containers:
docker-compose build
docker-compose up -d
  1. Create the cluster in ScyllaDB Manager:
docker-compose exec scylla-manager sctool cluster add --name test_university --host=scylla-node1 --auth-token=token
  1. Attempt to run a backup:
docker-compose exec scylla-manager sctool backup -c test_university --location s3:docker

Actual results

An error is seen, because the bucket does not exist:

Error: create backup target: location is not accessible
 172.18.0.4: agent [HTTP 404] no put permission: s3 upload: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Key>scylla-manager-agent-979845285/test</Key><BucketName>docker</BucketName><Resource>/docker/scylla-manager-agent-979845285/test</Resource><RequestId>17AD0E97586A5447</RequestId><HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId></Error> - make sure the location is correct and credentials are set, to debug SSH to 172.18.0.4 and run "scylla-manager-agent check-location -L s3:docker --debug"
 172.18.0.6: agent [HTTP 404] no put permission: s3 upload: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Key>scylla-manager-agent-719114050/test</Key><BucketName>docker</BucketName><Resource>/docker/scylla-manager-agent-719114050/test</Resource><RequestId>17AD0E975866E38A</RequestId><HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId></Error> - make sure the location is correct and credentials are set, to debug SSH to 172.18.0.6 and run "scylla-manager-agent check-location -L s3:docker --debug"
 172.18.0.5: agent [HTTP 404] no put permission: s3 upload: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Key>scylla-manager-agent-951999125/test</Key><BucketName>docker</BucketName><Resource>/docker/scylla-manager-agent-951999125/test</Resource><RequestId>17AD0E975872880C</RequestId><HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId></Error> - make sure the location is correct and credentials are set, to debug SSH to 172.18.0.5 and run "scylla-manager-agent check-location -L s3:docker --debug"
Trace ID: XXoqT7hsQdyTmHrnSyj7Zw (grep in scylla-manager logs)

Expected results

To get the expected results, the bucket must be created:

  1. Create a bash shell in the container:
sudo docker exec -it manager_minio_1 bash
  1. Run some mc commands in the container:
/usr/bin/mc alias set myminio http://minio:9000/ minio minio123
/usr/bin/mc mb myminio/docker
/usr/bin/mc anonymous set public myminio/docker
  1. Exit the container:
exit
  1. Run the backup command:
docker-compose exec scylla-manager sctool backup -c test_university --location s3:docker

Now it completes successfully:

$ docker-compose exec scylla-manager sctool backup -c test_university --location s3:docker
backup/1fbda45e-70e0-482f-a565-23e7a35b9d04
$ docker-compose exec scylla-manager sctool task list
Cluster: test_university (d9872a62-3cf4-47c7-adfc-92cbf3a2c6a1)
+-------------------------------------------------------------+--------------+-------------------------------+--------+
| Task                                                        | Arguments    | Next run                      | Status |
+-------------------------------------------------------------+--------------+-------------------------------+--------+
| healthcheck/ba279f5d-1b68-45f5-a119-197c732e65cc            |              | 23 Jan 24 19:44:05 UTC (+15s) | DONE   |
| healthcheck_alternator/a4d81068-1eeb-4648-824d-6556315d32e7 |              | 23 Jan 24 19:44:05 UTC (+15s) | DONE   |
| healthcheck_rest/b7e840db-3b01-4318-85cd-1d4d6e37cc58       |              | 23 Jan 24 19:44:35 UTC (+1m)  | DONE   |
| repair/ea793a56-21d6-4335-a4fb-366903fcc771                 |              | 24 Jan 24 00:00:00 UTC (+7d)  | NEW    |
| backup/1fbda45e-70e0-482f-a565-23e7a35b9d04                 | -L s3:docker |                               | DONE   |
+-------------------------------------------------------------+--------------+-------------------------------+--------+

This fix could be improved by changing the Docker configuration to run the mc commands, as described in this Stack Overflow post.

Creating kubernetes statefulset doesnt work

I wanna get Scylla on my GCP kubernetes and am following this guide.

https://github.com/scylladb/scylla-code-samples/tree/master/kubernetes-scylla

but when I run this command
kubectl create -f scylla-statefulset.yaml

I get an error

error: error validating "scylla-statefulset.yaml": error validating data: unknown object type schema.GroupVersionKind{Group:"apps", Version:"v1beta2", Kind:"StatefulSet"}; if you choose to ignore these errors, turn validation off with --validate=false

nodetool status exit code 137

nodetool status does not seem to work:

it hangs for a few seconds before exiting

command terminated with exit code 137

The container also dies:

scylla-1                               0/1       Running   1          1m

I've tried with scylla-2.0.0 and 2.1.5

mms is not working for me, nodetool status got error

follow the instruction: https://github.com/scylladb/scylla-code-samples/tree/master/mms

nodetool status got error

[root@5c70acb5c2e8 /]# nodetool status nodetool: Unable to connect to Scylla API server: java.net.ConnectException: Connection refused (Connection refused) See 'nodetool help' or 'nodetool help <command>'.

[root@5c70acb5c2e8 /]# java -version openjdk version "1.8.0_252" OpenJDK Runtime Environment (build 1.8.0_252-b09) OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

[root@5c70acb5c2e8 /]# cqlsh Connection error: ('Unable to connect to any servers', {'172.18.0.4': error(111, "Tried connecting to [('172.18.0.4', 9042)]. Last error: Connection refused")})

scylla-check-gossiper-generation hits false-positive matches

Pattern used in the script to select "node-IP-section" (grep -A1 "$IP") allows false positives if searched IP is a sub-string of another node IPs. As result the script fails.
E.g. (in our setup):

$ IP=$(hostname -i) && nodetool gossipinfo | grep -A1 "$IP"
/10.3.80.6
  generation:1583954108
#...
--
/10.3.80.69
  generation:1583957204
#...

We did proceed with upgrade after modification, but would it be possible to change it to something like grep -A1 "^/${IP}$"?

BTW, existing PR modifying patterns in this script has the same issue only in awk pattern.

For the "kubernetes-university-live" code sample, the google-cloud-cli-gke-gcloud-auth-plugin dependency is not listed in Scylla U

When following the instructions to use the "kubernetes-university-live" code sample in Scylla U, a dependency is not listed, which causes a failure.

Steps to reproduce

  1. Install gcloud via the Google Cloud SDK.

  2. Initialize gcloud:

gcloud init
  1. Login via gcloud:
gcloud auth login
  1. Install kubectl.

  2. Install helm.

  3. Clone the repo:

git clone https://github.com/scylladb/scylla-code-samples.git
  1. Change directory:
cd scylla-code-samples/kubernetes-university-live
  1. Set the account and project to environment variables:
export GCP_USER=$(gcloud config list account --format "value(core.account)")   
export GCP_PROJECT=$(gcloud config list project --format "value(core.project)") 
  1. Run the gke.sh script:
./gke.sh --gcp-user "$GCP_USER" -p "$GCP_PROJECT" -c "university-live-demo"

Actual results

A failure occurs due to a missing dependency:

Checking if kubectl is present on the machine...
Checking if helm is present on the machine...
WARNING: The `--enable-stackdriver-kubernetes` flag is deprecated and will be removed in an upcoming release. Please use `--logging` and `--monitoring` instead. For more information, please read: https://cloud.google.com/stackdriver/docs/solutions/gke/installing.
Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
Creating cluster university-live-demo in us-west1-b... Cluster is being health-checked (master is healthy)...done.               
Created [https://container.googleapis.com/v1/projects/skilled-adapter-452/zones/us-west1-b/clusters/university-live-demo].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/us-west1-b/university-live-demo?project=skilled-adapter-452
CRITICAL: ACTION REQUIRED: gke-gcloud-auth-plugin, which is needed for continued use of kubectl, was not found or is not executable. Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
kubeconfig entry generated for university-live-demo.
NAME                  LOCATION    MASTER_VERSION      MASTER_IP      MACHINE_TYPE   NODE_VERSION        NUM_NODES  STATUS
university-live-demo  us-west1-b  1.27.8-gke.1067004  35.233.177.76  n1-standard-8  1.27.8-gke.1067004  2          RUNNING
Creating node pool scylla-pool...done.                                                                                           
Created [https://container.googleapis.com/v1beta1/projects/skilled-adapter-452/zones/us-west1-b/clusters/university-live-demo/nodePools/scylla-pool].
NAME         MACHINE_TYPE   DISK_SIZE_GB  NODE_VERSION
scylla-pool  n1-standard-4  20            1.27.8-gke.1067004
Waiting GKE to UPGRADE_MASTER
Waiting for cluster readiness...
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
Waiting for cluster readiness... 
university-live-demo us-west1-b 1.27.8-gke.1067004 35.233.177.76 n1-standard-8 1.27.8-gke.1067004 8 RECONCILING
Listed 0 items.
Listed 0 items.
university-live-demo  us-west1-b  1.27.8-gke.1067004  35.233.177.76  n1-standard-8  1.27.8-gke.1067004  8          RUNNING
Getting credentials for newly created cluster...
Fetching cluster endpoint and auth data.
CRITICAL: ACTION REQUIRED: gke-gcloud-auth-plugin, which is needed for continued use of kubectl, was not found or is not executable. Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
kubeconfig entry generated for university-live-demo.
Setting up GKE RBAC...
error: failed to create clusterrolebinding: Post "https://35.233.177.76/apis/rbac.authorization.k8s.io/v1/clusterrolebindings?fieldManager=kubectl-create&fieldValidation=Strict": getting credentials: exec: executable gke-gcloud-auth-plugin not found

It looks like you are trying to use a client-go credential plugin that is not installed.

To learn more about this feature, consult the documentation available at:
      https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins

Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke

Expected results

The missing dependency must be installed prior to running gke.sh:

sudo apt install google-cloud-cli-gke-gcloud-auth-plugin

Range defined in the query should be open from one side.

Shouldn't the query contain the range open from only one side, in other words, if >= is the lower bound, then upper bound should be strict inequality:< ?

In the vastness of the token range this is an edge case, but will probably catch someday someone.

defaultQueryTemplate = "SELECT token(key) FROM keyspace1.standard1 WHERE token(key) >= %s AND token(key) <= %s;"

Error while deploying on bare metal servers.

This might be out of the scope issue or not even an issue. I am trying to deploy the scylla on kubernetes, baremetal server. I have installed the Kubernetes 1.9 on 2 nodes (master and node). I understand that this deployment is for google cloud but can someone points that how to configure the NFS provisioning in kubernetes. I am getting the following error while creating the deployment.

Warning FailedMount 25s (x4 over 7m) kubelet, node-pc Unable to mount volumes for pod "scylla-0_default(ef01bfc8-05b4-11e8-9bc8-98e7f452d34d)": timeout expired waiting for volumes to attach/mount for pod "default"/"scylla-0". list of unattached/unmounted volumes=[scylla-data]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.